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: 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(-) (limited to 'git-rebase--interactive.sh') 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-[^=]*=\(.*\)'`" ;; -- cgit v1.2.3 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: 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(-) (limited to 'git-rebase--interactive.sh') 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 -- cgit v1.2.3 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: 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(+) (limited to 'git-rebase--interactive.sh') 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 -- cgit v1.2.3