Skip to content

Commit 5a7a0fa

Browse files
committed
Merge branch 'maint'
* maint: clean: remove redundant variable baselen Documentation/git-pull: clarify configuration Document that rev-list --graph triggers parent rewriting. clean: avoid quoting twice document sigchain api Keep together options controlling the behaviour of diffcore-rename. t3402: test "rebase -s<strategy> -X<opt>"
2 parents d6b634f + 1c7d402 commit 5a7a0fa

File tree

6 files changed

+88
-24
lines changed

6 files changed

+88
-24
lines changed

Documentation/diff-options.txt

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -250,20 +250,6 @@ endif::git-log[]
250250
Detect copies as well as renames. See also `--find-copies-harder`.
251251
If `n` is specified, it has the same meaning as for `-M<n>`.
252252

253-
ifndef::git-format-patch[]
254-
--diff-filter=[(A|C|D|M|R|T|U|X|B)...[*]]::
255-
Select only files that are Added (`A`), Copied (`C`),
256-
Deleted (`D`), Modified (`M`), Renamed (`R`), have their
257-
type (i.e. regular file, symlink, submodule, ...) changed (`T`),
258-
are Unmerged (`U`), are
259-
Unknown (`X`), or have had their pairing Broken (`B`).
260-
Any combination of the filter characters (including none) can be used.
261-
When `*` (All-or-none) is added to the combination, all
262-
paths are selected if there is any file that matches
263-
other criteria in the comparison; if there is no file
264-
that matches other criteria, nothing is selected.
265-
endif::git-format-patch[]
266-
267253
--find-copies-harder::
268254
For performance reasons, by default, `-C` option finds copies only
269255
if the original file of the copy was modified in the same
@@ -281,6 +267,18 @@ endif::git-format-patch[]
281267
number.
282268

283269
ifndef::git-format-patch[]
270+
--diff-filter=[(A|C|D|M|R|T|U|X|B)...[*]]::
271+
Select only files that are Added (`A`), Copied (`C`),
272+
Deleted (`D`), Modified (`M`), Renamed (`R`), have their
273+
type (i.e. regular file, symlink, submodule, ...) changed (`T`),
274+
are Unmerged (`U`), are
275+
Unknown (`X`), or have had their pairing Broken (`B`).
276+
Any combination of the filter characters (including none) can be used.
277+
When `*` (All-or-none) is added to the combination, all
278+
paths are selected if there is any file that matches
279+
other criteria in the comparison; if there is no file
280+
that matches other criteria, nothing is selected.
281+
284282
-S<string>::
285283
Look for differences that introduce or remove an instance of
286284
<string>. Note that this is different than the string simply

Documentation/git-pull.txt

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,14 @@ include::merge-options.txt[]
9292
:git-pull: 1
9393

9494
--rebase::
95-
Instead of a merge, perform a rebase after fetching. If
96-
there is a remote ref for the upstream branch, and this branch
97-
was rebased since last fetched, the rebase uses that information
98-
to avoid rebasing non-local changes. To make this the default
99-
for branch `<name>`, set configuration `branch.<name>.rebase`
100-
to `true`.
95+
Rebase the current branch on top of the upstream branch after
96+
fetching. If there is a remote-tracking branch corresponding to
97+
the upstream branch and the upstream branch was rebased since last
98+
fetched, the rebase uses that information to avoid rebasing
99+
non-local changes.
100+
+
101+
See `branch.<name>.rebase` in linkgit:git-config[1] if you want to make
102+
`git pull` always use `{litdd}rebase` instead of merging.
101103
+
102104
[NOTE]
103105
This is a potentially _dangerous_ mode of operation.

Documentation/rev-list-options.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@ you would get an output like this:
9595
to be printed in between commits, in order for the graph history
9696
to be drawn properly.
9797
+
98+
This enables parent rewriting, see 'History Simplification' below.
99+
+
98100
This implies the '--topo-order' option by default, but the
99101
'--date-order' option may also be specified.
100102

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
sigchain API
2+
============
3+
4+
Code often wants to set a signal handler to clean up temporary files or
5+
other work-in-progress when we die unexpectedly. For multiple pieces of
6+
code to do this without conflicting, each piece of code must remember
7+
the old value of the handler and restore it either when:
8+
9+
1. The work-in-progress is finished, and the handler is no longer
10+
necessary. The handler should revert to the original behavior
11+
(either another handler, SIG_DFL, or SIG_IGN).
12+
13+
2. The signal is received. We should then do our cleanup, then chain
14+
to the next handler (or die if it is SIG_DFL).
15+
16+
Sigchain is a tiny library for keeping a stack of handlers. Your handler
17+
and installation code should look something like:
18+
19+
------------------------------------------
20+
void clean_foo_on_signal(int sig)
21+
{
22+
clean_foo();
23+
sigchain_pop(sig);
24+
raise(sig);
25+
}
26+
27+
void other_func()
28+
{
29+
sigchain_push_common(clean_foo_on_signal);
30+
mess_up_foo();
31+
clean_foo();
32+
}
33+
------------------------------------------
34+
35+
Handlers are given the typdef of sigchain_fun. This is the same type
36+
that is given to signal() or sigaction(). It is perfectly reasonable to
37+
push SIG_DFL or SIG_IGN onto the stack.
38+
39+
You can sigchain_push and sigchain_pop individual signals. For
40+
convenience, sigchain_push_common will push the handler onto the stack
41+
for many common signals.

builtin/clean.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ int cmd_clean(int argc, const char **argv, const char *prefix)
3838
{
3939
int i;
4040
int show_only = 0, remove_directories = 0, quiet = 0, ignored = 0;
41-
int ignored_only = 0, baselen = 0, config_set = 0, errors = 0;
41+
int ignored_only = 0, config_set = 0, errors = 0;
4242
int rm_flags = REMOVE_DIR_KEEP_NESTED_GIT;
4343
struct strbuf directory = STRBUF_INIT;
4444
struct dir_struct dir;
@@ -138,7 +138,7 @@ int cmd_clean(int argc, const char **argv, const char *prefix)
138138
if (pathspec) {
139139
memset(seen, 0, argc > 0 ? argc : 1);
140140
matches = match_pathspec(pathspec, ent->name, len,
141-
baselen, seen);
141+
0, seen);
142142
}
143143

144144
if (S_ISDIR(st.st_mode)) {
@@ -153,7 +153,7 @@ int cmd_clean(int argc, const char **argv, const char *prefix)
153153
printf("Removing %s\n", qname);
154154
if (remove_dir_recursively(&directory,
155155
rm_flags) != 0) {
156-
warning("failed to remove '%s'", qname);
156+
warning("failed to remove %s", qname);
157157
errors++;
158158
}
159159
} else if (show_only) {
@@ -173,7 +173,7 @@ int cmd_clean(int argc, const char **argv, const char *prefix)
173173
printf("Removing %s\n", qname);
174174
}
175175
if (unlink(ent->name) != 0) {
176-
warning("failed to remove '%s'", qname);
176+
warning("failed to remove %s", qname);
177177
errors++;
178178
}
179179
}

t/t3402-rebase-merge.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,4 +117,25 @@ test_expect_success 'picking rebase' '
117117
esac
118118
'
119119

120+
test_expect_success 'rebase -s funny -Xopt' '
121+
test_when_finished "rm -fr test-bin funny.was.run" &&
122+
mkdir test-bin &&
123+
cat >test-bin/git-merge-funny <<-EOF &&
124+
#!$SHELL_PATH
125+
case "\$1" in --opt) ;; *) exit 2 ;; esac
126+
shift &&
127+
>funny.was.run &&
128+
exec git merge-recursive "\$@"
129+
EOF
130+
chmod +x test-bin/git-merge-funny &&
131+
git reset --hard &&
132+
git checkout -b test-funny master^ &&
133+
test_commit funny &&
134+
(
135+
PATH=./test-bin:$PATH
136+
git rebase -s funny -Xopt master
137+
) &&
138+
test -f funny.was.run
139+
'
140+
120141
test_done

0 commit comments

Comments
 (0)