From 71fc224fe8af9202eb60c98a128150fd0ae23090 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Thu, 11 Nov 2010 13:28:57 -0800 Subject: [PATCH 1/7] t3402: test "rebase -s -X" Signed-off-by: Junio C Hamano --- t/t3402-rebase-merge.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/t/t3402-rebase-merge.sh b/t/t3402-rebase-merge.sh index 2bea65634a..be8c1d5ef9 100755 --- a/t/t3402-rebase-merge.sh +++ b/t/t3402-rebase-merge.sh @@ -117,4 +117,25 @@ test_expect_success 'picking rebase' ' esac ' +test_expect_success 'rebase -s funny -Xopt' ' + test_when_finished "rm -fr test-bin funny.was.run" && + mkdir test-bin && + cat >test-bin/git-merge-funny <<-EOF && + #!$SHELL_PATH + case "\$1" in --opt) ;; *) exit 2 ;; esac + shift && + >funny.was.run && + exec git merge-recursive "\$@" + EOF + chmod +x test-bin/git-merge-funny && + git reset --hard && + git checkout -b test-funny master^ && + test_commit funny && + ( + PATH=./test-bin:$PATH + git rebase -s funny -Xopt master + ) && + test -f funny.was.run +' + test_done From f1037448e29104cdad73b93cb961e3b40e08e925 Mon Sep 17 00:00:00 2001 From: Yann Dirson Date: Wed, 10 Nov 2010 21:27:13 +0100 Subject: [PATCH 2/7] Keep together options controlling the behaviour of diffcore-rename. It makes little sense to have --diff-filter in the middle of them, and even spares an ifndef::git-format-patch. Signed-off-by: Yann Dirson Signed-off-by: Junio C Hamano --- Documentation/diff-options.txt | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt index d723e99232..5495344e61 100644 --- a/Documentation/diff-options.txt +++ b/Documentation/diff-options.txt @@ -247,20 +247,6 @@ endif::git-log[] Detect copies as well as renames. See also `--find-copies-harder`. If `n` is specified, it has the same meaning as for `-M`. -ifndef::git-format-patch[] ---diff-filter=[(A|C|D|M|R|T|U|X|B)...[*]]:: - Select only files that are Added (`A`), Copied (`C`), - Deleted (`D`), Modified (`M`), Renamed (`R`), have their - type (i.e. regular file, symlink, submodule, ...) changed (`T`), - are Unmerged (`U`), are - Unknown (`X`), or have had their pairing Broken (`B`). - Any combination of the filter characters (including none) can be used. - When `*` (All-or-none) is added to the combination, all - paths are selected if there is any file that matches - other criteria in the comparison; if there is no file - that matches other criteria, nothing is selected. -endif::git-format-patch[] - --find-copies-harder:: For performance reasons, by default, `-C` option finds copies only if the original file of the copy was modified in the same @@ -278,6 +264,18 @@ endif::git-format-patch[] number. ifndef::git-format-patch[] +--diff-filter=[(A|C|D|M|R|T|U|X|B)...[*]]:: + Select only files that are Added (`A`), Copied (`C`), + Deleted (`D`), Modified (`M`), Renamed (`R`), have their + type (i.e. regular file, symlink, submodule, ...) changed (`T`), + are Unmerged (`U`), are + Unknown (`X`), or have had their pairing Broken (`B`). + Any combination of the filter characters (including none) can be used. + When `*` (All-or-none) is added to the combination, all + paths are selected if there is any file that matches + other criteria in the comparison; if there is no file + that matches other criteria, nothing is selected. + -S:: Look for differences that introduce or remove an instance of . Note that this is different than the string simply From ed296fe88dc8790f25a3546f1688dd40f8cbf2d1 Mon Sep 17 00:00:00 2001 From: Jeff King Date: Thu, 11 Nov 2010 23:24:56 -0500 Subject: [PATCH 3/7] document sigchain api It's pretty straightforward, but a stripped-down example never hurts. And we should make clear that it is explicitly OK to use SIG_DFL and SIG_IGN. Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- Documentation/technical/api-sigchain.txt | 41 ++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 Documentation/technical/api-sigchain.txt diff --git a/Documentation/technical/api-sigchain.txt b/Documentation/technical/api-sigchain.txt new file mode 100644 index 0000000000..535cdff164 --- /dev/null +++ b/Documentation/technical/api-sigchain.txt @@ -0,0 +1,41 @@ +sigchain API +============ + +Code often wants to set a signal handler to clean up temporary files or +other work-in-progress when we die unexpectedly. For multiple pieces of +code to do this without conflicting, each piece of code must remember +the old value of the handler and restore it either when: + + 1. The work-in-progress is finished, and the handler is no longer + necessary. The handler should revert to the original behavior + (either another handler, SIG_DFL, or SIG_IGN). + + 2. The signal is received. We should then do our cleanup, then chain + to the next handler (or die if it is SIG_DFL). + +Sigchain is a tiny library for keeping a stack of handlers. Your handler +and installation code should look something like: + +------------------------------------------ + void clean_foo_on_signal(int sig) + { + clean_foo(); + sigchain_pop(sig); + raise(sig); + } + + void other_func() + { + sigchain_push_common(clean_foo_on_signal); + mess_up_foo(); + clean_foo(); + } +------------------------------------------ + +Handlers are given the typdef of sigchain_fun. This is the same type +that is given to signal() or sigaction(). It is perfectly reasonable to +push SIG_DFL or SIG_IGN onto the stack. + +You can sigchain_push and sigchain_pop individual signals. For +convenience, sigchain_push_common will push the handler onto the stack +for many common signals. From 71567e3287cbd1c06e311579d43a7d8cc0648722 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Th=C3=A1i=20Ng=E1=BB=8Dc=20Duy?= Date: Mon, 15 Nov 2010 17:12:44 +0700 Subject: [PATCH 4/7] clean: avoid quoting twice MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit qname is the result of quote_path_relative(), which does quote_c_style_counted() internally. Remove the hard-coded quotes. Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- builtin/clean.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/builtin/clean.c b/builtin/clean.c index c8798f549e..8f602c9f41 100644 --- a/builtin/clean.c +++ b/builtin/clean.c @@ -153,7 +153,7 @@ int cmd_clean(int argc, const char **argv, const char *prefix) printf("Removing %s\n", qname); if (remove_dir_recursively(&directory, rm_flags) != 0) { - warning("failed to remove '%s'", qname); + warning("failed to remove %s", qname); errors++; } } else if (show_only) { @@ -173,7 +173,7 @@ int cmd_clean(int argc, const char **argv, const char *prefix) printf("Removing %s\n", qname); } if (unlink(ent->name) != 0) { - warning("failed to remove '%s'", qname); + warning("failed to remove %s", qname); errors++; } } From 6a6c54bafed84220bcd09b19b40c104d1ff687cc Mon Sep 17 00:00:00 2001 From: Yann Dirson Date: Fri, 12 Nov 2010 09:48:58 +0100 Subject: [PATCH 5/7] Document that rev-list --graph triggers parent rewriting. This may help to understand why --graph causes more comments to be selected. Signed-off-by: Yann Dirson Signed-off-by: Junio C Hamano --- Documentation/rev-list-options.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/rev-list-options.txt b/Documentation/rev-list-options.txt index 1aaaf5ae8b..42ca059908 100644 --- a/Documentation/rev-list-options.txt +++ b/Documentation/rev-list-options.txt @@ -95,6 +95,8 @@ you would get an output like this: to be printed in between commits, in order for the graph history to be drawn properly. + +This enables parent rewriting, see 'History Simplification' below. ++ This implies the '--topo-order' option by default, but the '--date-order' option may also be specified. From 11fe3f73cce13b759a728b0a9ac95e745470f251 Mon Sep 17 00:00:00 2001 From: Martin von Zweigbergk Date: Fri, 12 Nov 2010 19:55:58 +0100 Subject: [PATCH 6/7] Documentation/git-pull: clarify configuration The sentence about 'branch..rebase' refers to the first sentence in the paragraph and not to the sentence about avoiding rebasing non-local changes. Clarify this. Signed-off-by: Martin von Zweigbergk Signed-off-by: Junio C Hamano --- Documentation/git-pull.txt | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Documentation/git-pull.txt b/Documentation/git-pull.txt index c50f7dcb89..e1b0bd2868 100644 --- a/Documentation/git-pull.txt +++ b/Documentation/git-pull.txt @@ -92,12 +92,14 @@ include::merge-options.txt[] :git-pull: 1 --rebase:: - Instead of a merge, perform a rebase after fetching. If - there is a remote ref for the upstream branch, and this branch - was rebased since last fetched, the rebase uses that information - to avoid rebasing non-local changes. To make this the default - for branch ``, set configuration `branch..rebase` - to `true`. + Rebase the current branch on top of the upstream branch after + fetching. If there is a remote-tracking branch corresponding to + the upstream branch and the upstream branch was rebased since last + fetched, the rebase uses that information to avoid rebasing + non-local changes. ++ +See `branch..rebase` in linkgit:git-config[1] if you want to make +`git pull` always use `{litdd}rebase` instead of merging. + [NOTE] This is a potentially _dangerous_ mode of operation. From 1c7d402b3e1e9d7e50abfbfb18c88bc79be468ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Th=C3=A1i=20Ng=E1=BB=8Dc=20Duy?= Date: Mon, 15 Nov 2010 13:42:44 +0700 Subject: [PATCH 7/7] clean: remove redundant variable baselen MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit baselen used to be the result of common_prefix() when it was made builtin. Since 1d8842d (Add 'fill_directory()' helper function for directory traversal - 2009-05-14), its value will always be zero. Remove it because it's no longer variable. Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- builtin/clean.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/builtin/clean.c b/builtin/clean.c index 8f602c9f41..fb24030751 100644 --- a/builtin/clean.c +++ b/builtin/clean.c @@ -38,7 +38,7 @@ int cmd_clean(int argc, const char **argv, const char *prefix) { int i; int show_only = 0, remove_directories = 0, quiet = 0, ignored = 0; - int ignored_only = 0, baselen = 0, config_set = 0, errors = 0; + int ignored_only = 0, config_set = 0, errors = 0; int rm_flags = REMOVE_DIR_KEEP_NESTED_GIT; struct strbuf directory = STRBUF_INIT; struct dir_struct dir; @@ -138,7 +138,7 @@ int cmd_clean(int argc, const char **argv, const char *prefix) if (pathspec) { memset(seen, 0, argc > 0 ? argc : 1); matches = match_pathspec(pathspec, ent->name, len, - baselen, seen); + 0, seen); } if (S_ISDIR(st.st_mode)) {