From 562e35c34ced4ca7af024d213737411238dbe0f5 Mon Sep 17 00:00:00 2001 From: "Michael W. Olson" Date: Tue, 30 Oct 2007 09:53:47 -0400 Subject: [PATCH 01/10] Documentation/git-cvsexportcommit.txt: s/mgs/msg/ in example Signed-off-by: Junio C Hamano --- Documentation/git-cvsexportcommit.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/git-cvsexportcommit.txt b/Documentation/git-cvsexportcommit.txt index 4c8d1e6386..c3922f9238 100644 --- a/Documentation/git-cvsexportcommit.txt +++ b/Documentation/git-cvsexportcommit.txt @@ -73,7 +73,7 @@ Merge one patch into CVS:: $ export GIT_DIR=~/project/.git $ cd ~/project_cvs_checkout $ git-cvsexportcommit -v -$ cvs commit -F .mgs +$ cvs commit -F .msg ------------ Merge pending patches into CVS automatically -- only if you really know what you are doing:: From b6c9fb5100f8cd4081f1c6df5aea7335a11e9659 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Tue, 30 Oct 2007 11:30:43 -0700 Subject: [PATCH 02/10] Prevent send-pack from segfaulting (backport from 'master') 4491e62ae932d5774f628d1bd3be663c11058a73 (Prevent send-pack from segfaulting when a branch doesn't match) is hereby cherry-picked back to 'maint'. If we can't find a source match, and we have no destination, we need to abort the match function early before we try to match the destination against the remote. Signed-off-by: Junio C Hamano --- remote.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/remote.c b/remote.c index cdbbdcb00d..9a88917aab 100644 --- a/remote.c +++ b/remote.c @@ -504,8 +504,11 @@ static int match_explicit(struct ref *src, struct ref *dst, if (!matched_src) errs = 1; - if (dst_value == NULL) + if (!dst_value) { + if (!matched_src) + return errs; dst_value = matched_src->name; + } switch (count_refspec_match(dst_value, dst, &matched_dst)) { case 1: From dee48c3c7ed7f7a32a524e8a492c6bc4e3c1c78d Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Tue, 30 Oct 2007 11:54:11 -0700 Subject: [PATCH 03/10] git-merge: document but discourage the historical syntax Historically "git merge" took its command line arguments in a rather strange order. Document the historical syntax, and also document clearly that it is not encouraged in new scripts. There is no reason to deprecate the historical syntax, as the current code can sanely tell which syntax the caller is using, and existing scripts by people do use the historical syntax. Signed-off-by: Junio C Hamano --- Documentation/git-merge.txt | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Documentation/git-merge.txt b/Documentation/git-merge.txt index eae49c4876..827838f7d0 100644 --- a/Documentation/git-merge.txt +++ b/Documentation/git-merge.txt @@ -11,26 +11,27 @@ SYNOPSIS [verse] 'git-merge' [-n] [--summary] [--no-commit] [--squash] [-s ]... [-m ] ... +'git-merge' HEAD ... DESCRIPTION ----------- This is the top-level interface to the merge machinery which drives multiple merge strategy scripts. +The second syntax ( `HEAD` ) is supported for +historical reasons. Do not use it from the command line or in +new scripts. It is the same as `git merge -m `. + OPTIONS ------- include::merge-options.txt[] -:: +-m :: The commit message to be used for the merge commit (in case it is created). The `git-fmt-merge-msg` script can be used to give a good default for automated `git-merge` invocations. -:: - Our branch head commit. This has to be `HEAD`, so new - syntax does not require it - :: Other branch head merged into our branch. You need at least one . Specifying more than one From ba17892ddc85c0ffe8fecd600c29cb38ec7e5587 Mon Sep 17 00:00:00 2001 From: Sergei Organov Date: Tue, 30 Oct 2007 22:54:02 +0300 Subject: [PATCH 04/10] core-tutorial: Use new syntax for git-merge. "git-merge HEAD " is still supported but we shouldn't encourage its use. Signed-off-by: Junio C Hamano --- Documentation/core-tutorial.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Documentation/core-tutorial.txt b/Documentation/core-tutorial.txt index 6b2590d072..df147b5e76 100644 --- a/Documentation/core-tutorial.txt +++ b/Documentation/core-tutorial.txt @@ -883,7 +883,7 @@ script called `git merge`, which wants to know which branches you want to resolve and what the merge is all about: ------------ -$ git merge "Merge work in mybranch" HEAD mybranch +$ git merge -m "Merge work in mybranch" mybranch ------------ where the first argument is going to be used as the commit message if @@ -970,7 +970,7 @@ to the `master` branch. Let's go back to `mybranch`, and run ------------ $ git checkout mybranch -$ git merge "Merge upstream changes." HEAD master +$ git merge -m "Merge upstream changes." master ------------ This outputs something like this (the actual commit object names @@ -1613,8 +1613,8 @@ in both of them. You could merge in 'diff-fix' first and then 'commit-fix' next, like this: ------------ -$ git merge 'Merge fix in diff-fix' master diff-fix -$ git merge 'Merge fix in commit-fix' master commit-fix +$ git merge -m 'Merge fix in diff-fix' diff-fix +$ git merge -m 'Merge fix in commit-fix' commit-fix ------------ Which would result in: From 04bd8e5fea48a00816b461b0fb934627cfd2c45f Mon Sep 17 00:00:00 2001 From: Nicolas Pitre Date: Tue, 30 Oct 2007 15:59:24 -0400 Subject: [PATCH 05/10] cherry-pick/revert: more compact user direction message A failed cherry-pick (and friend) currently says: |Automatic cherry-pick failed. After resolving the conflicts, |mark the corrected paths with 'git-add ' |and commit the result. This can obviously be displayed on two lines only. While at it, change "git-add" to "git add". Signed-off-by: Nicolas Pitre Signed-off-by: Junio C Hamano --- builtin-revert.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin-revert.c b/builtin-revert.c index 499bbe7343..eafafbc333 100644 --- a/builtin-revert.c +++ b/builtin-revert.c @@ -351,7 +351,7 @@ static int revert_or_cherry_pick(int argc, const char **argv) die ("Error wrapping up %s", defmsg); fprintf(stderr, "Automatic %s failed. " "After resolving the conflicts,\n" - "mark the corrected paths with 'git-add '\n" + "mark the corrected paths with 'git add ' " "and commit the result.\n", me); if (action == CHERRY_PICK) { fprintf(stderr, "When commiting, use the option " From 07b45f8c1754a13bca67f70b600bf51ba33cf98d Mon Sep 17 00:00:00 2001 From: Lars Hjemli Date: Tue, 25 Sep 2007 08:36:38 +0200 Subject: [PATCH 06/10] Make merge-recursive honor diff.renamelimit It might be a sign of source code management gone bad, but when two branches has diverged almost beyond recognition and time has come for the branches to merge, the user is going to need all the help his tool can give him. Honoring diff.renamelimit has great potential as a painkiller in such situations. The painkiller effect could have been achieved by e.g. 'merge.renamelimit', but the flexibility gained by a separate option is questionable: our user would probably expect git to detect renames equally good when merging as when diffing (I known I did). Signed-off-by: Lars Hjemli Signed-off-by: Junio C Hamano --- merge-recursive.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/merge-recursive.c b/merge-recursive.c index c2e1cb69e3..fedfff4aed 100644 --- a/merge-recursive.c +++ b/merge-recursive.c @@ -96,6 +96,7 @@ static struct path_list current_directory_set = {NULL, 0, 0, 1}; static int call_depth = 0; static int verbosity = 2; +static int rename_limit = -1; static int buffer_output = 1; static struct output_buffer *output_list, *output_end; @@ -372,6 +373,7 @@ static struct path_list *get_renames(struct tree *tree, diff_setup(&opts); opts.recursive = 1; opts.detect_rename = DIFF_DETECT_RENAME; + opts.rename_limit = rename_limit; opts.output_format = DIFF_FORMAT_NO_OUTPUT; if (diff_setup_done(&opts) < 0) die("diff setup failed"); @@ -1693,6 +1695,10 @@ static int merge_config(const char *var, const char *value) verbosity = git_config_int(var, value); return 0; } + if (!strcasecmp(var, "diff.renamelimit")) { + rename_limit = git_config_int(var, value); + return 0; + } return git_default_config(var, value); } From 3524b282dabd254fc50b186e35ea5c6f612aeb46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Steinbrink?= Date: Wed, 31 Oct 2007 03:20:30 +0100 Subject: [PATCH 07/10] Fix --strategy parsing in git-rebase--interactive.sh MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For the --strategy/-s option, git-rebase--interactive.sh dropped the parameter which it was trying to parse. Signed-off-by: Björn Steinbrink Acked-by: Johannes Schindelin Signed-off-by: Junio C Hamano --- git-rebase--interactive.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh index 50b79ff8ff..ebc67e515d 100755 --- a/git-rebase--interactive.sh +++ b/git-rebase--interactive.sh @@ -357,7 +357,6 @@ do output git reset --hard && do_rest ;; -s|--strategy) - shift case "$#,$1" in *,*=*) STRATEGY="-s `expr "z$1" : 'z-[^=]*=\(.*\)'`" ;; From 2a9c53e03d8293577b5163910f178075725b39dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Steinbrink?= Date: Wed, 31 Oct 2007 03:20:31 +0100 Subject: [PATCH 08/10] git-rebase--interactive.sh: Don't pass a strategy to git-cherry-pick. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-cherry-pick doesn't support a strategy paramter, so don't pass one. This means that --strategy for interactive rebases is a no-op for anything but merge commits, but that's still better than being broken. A correct fix would probably need to port the --merge behaviour from plain git-rebase.sh, but I have no clue how to integrate that cleanly. Signed-off-by: Björn Steinbrink Acked-by: Johannes Schindelin Signed-off-by: Junio C Hamano --- git-rebase--interactive.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh index ebc67e515d..db04057653 100755 --- a/git-rebase--interactive.sh +++ b/git-rebase--interactive.sh @@ -109,7 +109,7 @@ pick_one () { sha1=$(git rev-parse --short $sha1) output warn Fast forward to $sha1 else - output git cherry-pick $STRATEGY "$@" + output git cherry-pick "$@" fi } @@ -173,7 +173,7 @@ pick_one_preserving_merges () { fi ;; *) - output git cherry-pick $STRATEGY "$@" || + output git cherry-pick "$@" || die_with_patch $sha1 "Could not pick $sha1" esac esac From f91333d646e690d9a10717c96e166a069b2bb586 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Steinbrink?= Date: Wed, 31 Oct 2007 03:20:32 +0100 Subject: [PATCH 09/10] git-rebase--interactive.sh: Make 3-way merge strategies work for -p. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-rebase--interactive.sh used to pass all parents of a merge commit to git-merge, which means that we have at least 3 heads to merge: HEAD, first parent and second parent. So 3-way merge strategies like recursive wouldn't work. Fortunately, we have checked out the first parent right before the merge anyway, so that is HEAD. Therefore we can drop simply it from the list of parents, making 3-way strategies work for merge commits with only two parents. Signed-off-by: Björn Steinbrink Acked-by: Johannes Schindelin Signed-off-by: Junio C Hamano --- git-rebase--interactive.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh index db04057653..f28c3df204 100755 --- a/git-rebase--interactive.sh +++ b/git-rebase--interactive.sh @@ -165,6 +165,8 @@ pick_one_preserving_merges () { eval "$author_script" msg="$(git cat-file commit $sha1 | \ sed -e '1,/^$/d' -e "s/[\"\\]/\\\\&/g")" + # No point in merging the first parent, that's HEAD + new_parents=${new_parents# $first_parent} # NEEDSWORK: give rerere a chance if ! output git merge $STRATEGY -m "$msg" $new_parents then From 0bdb5af7a571ee2bd71550a545632b1cb7f8f8f3 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Tue, 30 Oct 2007 21:32:49 -0700 Subject: [PATCH 10/10] Update GIT 1.5.3.5 Release Notes Signed-off-by: Junio C Hamano --- Documentation/RelNotes-1.5.3.5.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Documentation/RelNotes-1.5.3.5.txt b/Documentation/RelNotes-1.5.3.5.txt index e28d92f618..bf6a279ede 100644 --- a/Documentation/RelNotes-1.5.3.5.txt +++ b/Documentation/RelNotes-1.5.3.5.txt @@ -87,8 +87,14 @@ Fixes since v1.5.3.4 * A few workarounds to squelch false warnings from recent gcc have been added. + * "git-send-pack $remote frotz" segfaulted when there is nothing + named 'frotz' on the local end. + + * "git-rebase -interactive" did not handle its "--strategy" option + properly. + -- exec >/var/tmp/1 -O=v1.5.3.4-55-gf120ae2 +O=v1.5.3.4-65-gf91333d echo O=`git describe refs/heads/maint` git shortlog --no-merges $O..refs/heads/maint