{"thread":{"id":"10535","subject":"[PATCH 2/3] git-rebase--interactive.sh: Don't pass a strategy to git-cherry-pick.","startedAt":"2007-10-31T02:20:30Z","lastAt":"2007-10-31T02:53:20Z","messageCount":5,"participants":["Björn Steinbrink","Johannes Schindelin"],"isPatch":true,"patchVersion":1,"patchTotal":3},"messages":[{"id":"57644","messageId":"1193797232-1062-1-git-send-email-B.Steinbrink@gmx.de","threadId":"10535","inReplyTo":null,"subject":"[PATCH 1/3] Fix --strategy parsing in git-rebase--interactive.sh","fromName":"Björn Steinbrink","fromEmail":"b.steinbrink@gmx.de","sentAt":"2007-10-31T02:20:30Z","receivedAt":"2007-10-31T02:20:30Z","isPatch":true,"sender":{"key":"b.steinbrink@gmx.de","avatar":"https://avatars.githubusercontent.com/u/230962?v=4"},"body":"For the --strategy/-s option, git-rebase--interactive.sh dropped the\nparameter which it was trying to parse.\n\nSigned-off-by: BjÃ¶rn Steinbrink <B.Steinbrink@gmx.de>\n\ndiff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh\nindex 0dd77b4..f667ae8 100755\n--- a/git-rebase--interactive.sh\n+++ b/git-rebase--interactive.sh\n@@ -387,7 +387,6 @@ do\n \t\toutput git reset --hard && do_rest\n \t\t;;\n \t-s|--strategy)\n-\t\tshift\n \t\tcase \"$#,$1\" in\n \t\t*,*=*)\n \t\t\tSTRATEGY=\"-s `expr \"z$1\" : 'z-[^=]*=\\(.*\\)'`\" ;;\n-- \n1.5.3.4.456.g072a\n"},{"id":"57643","messageId":"1193797232-1062-2-git-send-email-B.Steinbrink@gmx.de","threadId":"10535","inReplyTo":"1193797232-1062-1-git-send-email-B.Steinbrink@gmx.de","subject":"[PATCH 2/3] git-rebase--interactive.sh: Don't pass a strategy to git-cherry-pick.","fromName":"Björn Steinbrink","fromEmail":"b.steinbrink@gmx.de","sentAt":"2007-10-31T02:20:31Z","receivedAt":"2007-10-31T02:20:31Z","isPatch":true,"sender":{"key":"b.steinbrink@gmx.de","avatar":"https://avatars.githubusercontent.com/u/230962?v=4"},"body":"git-cherry-pick doesn't support a strategy paramter, so don't pass one.\nThis means that --strategy for interactive rebases is a no-op for\nanything but merge commits, but that's still better than being broken. A\ncorrect fix would probably need to port the --merge behaviour from plain\ngit-rebase.sh, but I have no clue how to integrate that cleanly.\n\nSigned-off-by: BjÃ¶rn Steinbrink <B.Steinbrink@gmx.de>\n\ndiff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh\nindex f667ae8..cc949db 100755\n--- a/git-rebase--interactive.sh\n+++ b/git-rebase--interactive.sh\n@@ -116,7 +116,7 @@ pick_one () {\n \t\tsha1=$(git rev-parse --short $sha1)\n \t\toutput warn Fast forward to $sha1\n \telse\n-\t\toutput git cherry-pick $STRATEGY \"$@\"\n+\t\toutput git cherry-pick \"$@\"\n \tfi\n }\n \n@@ -184,7 +184,7 @@ pick_one_preserving_merges () {\n \t\t\tfi\n \t\t\t;;\n \t\t*)\n-\t\t\toutput git cherry-pick $STRATEGY \"$@\" ||\n+\t\t\toutput git cherry-pick \"$@\" ||\n \t\t\t\tdie_with_patch $sha1 \"Could not pick $sha1\"\n \t\t\t;;\n \t\tesac\n-- \n1.5.3.4.456.g072a\n"},{"id":"57645","messageId":"1193797232-1062-3-git-send-email-B.Steinbrink@gmx.de","threadId":"10535","inReplyTo":"1193797232-1062-2-git-send-email-B.Steinbrink@gmx.de","subject":"[PATCH 3/3] git-rebase--interactive.sh: Make 3-way merge strategies work for -p.","fromName":"Björn Steinbrink","fromEmail":"b.steinbrink@gmx.de","sentAt":"2007-10-31T02:20:32Z","receivedAt":"2007-10-31T02:20:32Z","isPatch":true,"sender":{"key":"b.steinbrink@gmx.de","avatar":"https://avatars.githubusercontent.com/u/230962?v=4"},"body":"git-rebase--interactive.sh used to pass all parents of a merge commit to\ngit-merge, which means that we have at least 3 heads to merge: HEAD,\nfirst parent and second parent. So 3-way merge strategies like recursive\nwouldn't work.\n\nFortunately, we have checked out the first parent right before the merge\nanyway, so that is HEAD. Therefore we can drop simply it from the list\nof parents, making 3-way strategies work for merge commits with only\ntwo parents.\n\nSigned-off-by: BjÃ¶rn Steinbrink <B.Steinbrink@gmx.de>\n\ndiff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh\nindex cc949db..e63e1c9 100755\n--- a/git-rebase--interactive.sh\n+++ b/git-rebase--interactive.sh\n@@ -172,6 +172,9 @@ pick_one_preserving_merges () {\n \t\t\tauthor_script=$(get_author_ident_from_commit $sha1)\n \t\t\teval \"$author_script\"\n \t\t\tmsg=\"$(git cat-file commit $sha1 | sed -e '1,/^$/d')\"\n+\n+\t\t\t# No point in merging the first parent, that's HEAD\n+\t\t\tnew_parents=${new_parents# $first_parent}\n \t\t\t# NEEDSWORK: give rerere a chance\n \t\t\tif ! GIT_AUTHOR_NAME=\"$GIT_AUTHOR_NAME\" \\\n \t\t\t\tGIT_AUTHOR_EMAIL=\"$GIT_AUTHOR_EMAIL\" \\\n-- \n1.5.3.4.456.g072a\n"},{"id":"57649","messageId":"Pine.LNX.4.64.0710310239100.4362@racer.site","threadId":"10535","inReplyTo":"1193797232-1062-3-git-send-email-B.Steinbrink@gmx.de","subject":"Re: [PATCH 3/3] git-rebase--interactive.sh: Make 3-way merge strategies work for -p.","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-10-31T02:42:03Z","receivedAt":"2007-10-31T02:42:03Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Björn,\n\nOn Wed, 31 Oct 2007, Björn Steinbrink wrote:\n\n> +\t\t\tnew_parents=${new_parents# $first_parent}\n\nI wanted to comment that this might not be present in shells other than \nbash, but I see that we rely on that construct already in am, clone, \ncommit, filter-branch, merge, pull, rebase, stash and submodule.\n\nSo I think it's okay.\n\nThe whole series is _very_ nicely done, and appears to me as obviously \ncorrect.\n\nAcked-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>\n\nThanks,\nDscho\n"},{"id":"57650","messageId":"20071031025320.GA1375@atjola.homenet","threadId":"10535","inReplyTo":"Pine.LNX.4.64.0710310239100.4362@racer.site","subject":"Re: [PATCH 3/3] git-rebase--interactive.sh: Make 3-way merge strategies work for -p.","fromName":"Björn Steinbrink","fromEmail":"b.steinbrink@gmx.de","sentAt":"2007-10-31T02:53:20Z","receivedAt":"2007-10-31T02:53:20Z","isPatch":true,"sender":{"key":"b.steinbrink@gmx.de","avatar":"https://avatars.githubusercontent.com/u/230962?v=4"},"body":"Hi Dscho,\n\nOn 2007.10.31 02:42:03 +0000, Johannes Schindelin wrote:\n> Hi Björn,\n> \n> On Wed, 31 Oct 2007, Björn Steinbrink wrote:\n> \n> > +\t\t\tnew_parents=${new_parents# $first_parent}\n> \n> I wanted to comment that this might not be present in shells other than \n> bash, but I see that we rely on that construct already in am, clone, \n> commit, filter-branch, merge, pull, rebase, stash and submodule.\n>\n> So I think it's okay.\n\nActually, I checked first that it's not bash-only (I saw the flames\nabout that on lkml some time ago, so I've been scared ;-)). Works fine\nwith dash here and it's in the posix sh specs. See 2.6.2 in\nhttp://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html\n\nSo I hope that there's a bit of a broader support for it :-)\n\n> The whole series is _very_ nicely done, and appears to me as obviously \n> correct.\n\nThanks :-)\n\nBjörn\n"}]}