{"thread":{"id":"15907","subject":"[PATCH] rebase-i-p: delay saving current-commit to REWRITTEN if squashing","startedAt":"2008-10-15T07:44:33Z","lastAt":"2008-10-22T19:15:17Z","messageCount":18,"participants":["Stephen Haberman","Jeff King","Junio C Hamano","Johannes Schindelin","Fredrik Skolmli"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"93066","messageId":"cover.1224055978.git.stephen@exigencecorp.com","threadId":"15907","inReplyTo":null,"subject":"[PATCH] rebase-i-p: squashing and limiting todo","fromName":"Stephen Haberman","fromEmail":"stephen@exigencecorp.com","sentAt":"2008-10-15T07:44:33Z","receivedAt":"2008-10-15T07:44:33Z","isPatch":true,"sender":{"key":"stephen@exigencecorp.com","avatar":"https://gravatar.com/avatar/23b93ad70a06ce53505f17ddba65176edbcfb6588e7a4c1a2dca04aaf0a6aff1?d=mp&s=160"},"body":"This is v3, rebased on top of sp/maint with sp/master and sh/maint-rebase3.\n\nSo, it should apply cleanly to that. Junio's feedback aside, the only change\nfrom v2 is that maint-rebase3's dropped commit check needs to be done before\nJohannes's recent addition of:\n\n    test -s \"$TODO\" || echo noop >> \"$TODO\"\n\nBecause now the todo may temporarily have picks in it while probing for parents\nthat could later be removed by the dropped/cherry-picked commit check.\n\nPreviously todo never had temporary entries, so it didn't matter when the\ndropped commit check was done.\n\n(Apologies for not seeing Junio's what's cooking first and using his\nmaint/master instead of Shawn's. Let me know if I need to redo this and I will\nget even more practice at rebasing.)\n\n(Gah, resending with the list cc'd this time. Dammit, sorry about that.)\n\nThanks,\nStephen\n\nStephen Haberman (7):\n  rebase-i-p: test to exclude commits from todo based on its parents\n  rebase-i-p: use HEAD for updating the ref instead of mapping OLDHEAD\n  rebase-i-p: delay saving current-commit to REWRITTEN if squashing\n  rebase-i-p: fix 'no squashing merges' tripping up non-merges\n  rebase-i-p: only list commits that require rewriting in todo\n  rebase-i-p: do not include non-first-parent commits touching UPSTREAM\n  rebase-i-p: if todo was reordered use HEAD as the rewritten parent\n\n git-rebase--interactive.sh               |  131 ++++++++++++++++++-----------\n t/t3411-rebase-preserve-around-merges.sh |  136 ++++++++++++++++++++++++++++++\n 2 files changed, 218 insertions(+), 49 deletions(-)\n create mode 100644 t/t3411-rebase-preserve-around-merges.sh\n"},{"id":"93065","messageId":"79b3f186dc599ebb5e251d5c0ca93c233263974c.1224055978.git.stephen@exigencecorp.com","threadId":"15907","inReplyTo":"cover.1224055978.git.stephen@exigencecorp.com","subject":"[PATCH] rebase-i-p: test to exclude commits from todo based on its parents","fromName":"Stephen Haberman","fromEmail":"stephen@exigencecorp.com","sentAt":"2008-10-15T07:44:34Z","receivedAt":"2008-10-15T07:44:34Z","isPatch":true,"sender":{"key":"stephen@exigencecorp.com","avatar":"https://gravatar.com/avatar/23b93ad70a06ce53505f17ddba65176edbcfb6588e7a4c1a2dca04aaf0a6aff1?d=mp&s=160"},"body":"The first case was based off a script from Avi Kivity <avi@redhat.com>.\n\nThe second case includes a merge-of-a-merge to ensure both are included in todo.\n\nSigned-off-by: Stephen Haberman <stephen@exigencecorp.com>\n---\n t/t3411-rebase-preserve-around-merges.sh |  136 ++++++++++++++++++++++++++++++\n 1 files changed, 136 insertions(+), 0 deletions(-)\n create mode 100644 t/t3411-rebase-preserve-around-merges.sh\n\ndiff --git a/t/t3411-rebase-preserve-around-merges.sh b/t/t3411-rebase-preserve-around-merges.sh\nnew file mode 100644\nindex 0000000..b3973c9\n--- /dev/null\n+++ b/t/t3411-rebase-preserve-around-merges.sh\n@@ -0,0 +1,136 @@\n+#!/bin/sh\n+#\n+# Copyright (c) 2008 Stephen Haberman\n+#\n+\n+test_description='git rebase preserve merges\n+\n+This test runs git rebase with and tries to squash a commit from after a merge\n+to before the merge.\n+'\n+. ./test-lib.sh\n+\n+# Copy/paste from t3404-rebase-interactive.sh\n+echo \"#!$SHELL_PATH\" >fake-editor.sh\n+cat >> fake-editor.sh <<\\EOF\n+case \"$1\" in\n+*/COMMIT_EDITMSG)\n+\ttest -z \"$FAKE_COMMIT_MESSAGE\" || echo \"$FAKE_COMMIT_MESSAGE\" > \"$1\"\n+\ttest -z \"$FAKE_COMMIT_AMEND\" || echo \"$FAKE_COMMIT_AMEND\" >> \"$1\"\n+\texit\n+\t;;\n+esac\n+test -z \"$EXPECT_COUNT\" ||\n+\ttest \"$EXPECT_COUNT\" = $(sed -e '/^#/d' -e '/^$/d' < \"$1\" | wc -l) ||\n+\texit\n+test -z \"$FAKE_LINES\" && exit\n+grep -v '^#' < \"$1\" > \"$1\".tmp\n+rm -f \"$1\"\n+cat \"$1\".tmp\n+action=pick\n+for line in $FAKE_LINES; do\n+\tcase $line in\n+\tsquash|edit)\n+\t\taction=\"$line\";;\n+\t*)\n+\t\techo sed -n \"${line}s/^pick/$action/p\"\n+\t\tsed -n \"${line}p\" < \"$1\".tmp\n+\t\tsed -n \"${line}s/^pick/$action/p\" < \"$1\".tmp >> \"$1\"\n+\t\taction=pick;;\n+\tesac\n+done\n+EOF\n+\n+test_set_editor \"$(pwd)/fake-editor.sh\"\n+chmod a+x fake-editor.sh\n+\n+# set up two branches like this:\n+#\n+# A1 - B1 - D1 - E1 - F1\n+#       \\        /\n+#        -- C1 --\n+\n+test_expect_success 'setup' '\n+\ttouch a &&\n+\ttouch b &&\n+\tgit add a &&\n+\tgit commit -m A1 &&\n+\tgit tag A1\n+\tgit add b &&\n+\tgit commit -m B1 &&\n+\tgit tag B1 &&\n+\tgit checkout -b branch &&\n+\ttouch c &&\n+\tgit add c &&\n+\tgit commit -m C1 &&\n+\tgit checkout master &&\n+\ttouch d &&\n+\tgit add d &&\n+\tgit commit -m D1 &&\n+\tgit merge branch &&\n+\ttouch f &&\n+\tgit add f &&\n+\tgit commit -m F1 &&\n+\tgit tag F1\n+'\n+\n+# Should result in:\n+#\n+# A1 - B1 - D2 - E2\n+#       \\        /\n+#        -- C1 --\n+#\n+test_expect_failure 'squash F1 into D1' '\n+\tFAKE_LINES=\"1 squash 3 2\" git rebase -i -p B1 &&\n+\ttest \"$(git rev-parse HEAD^2)\" = \"$(git rev-parse branch)\" &&\n+\ttest \"$(git rev-parse HEAD~2)\" = \"$(git rev-parse B1)\" &&\n+\tgit tag E2\n+'\n+\n+# Start with:\n+#\n+# A1 - B1 - D2 - E2\n+#  \\\n+#   G1 ---- L1 ---- M1\n+#    \\             /\n+#     H1 -- J1 -- K1\n+#      \\         /\n+#        -- I1 --\n+#\n+# And rebase G1..M1 onto E2\n+\n+test_expect_failure 'rebase two levels of merge' '\n+\tgit checkout -b branch2 A1 &&\n+\ttouch g &&\n+\tgit add g &&\n+\tgit commit -m G1 &&\n+\tgit checkout -b branch3 &&\n+\ttouch h\n+\tgit add h &&\n+\tgit commit -m H1 &&\n+\tgit checkout -b branch4 &&\n+\ttouch i &&\n+\tgit add i &&\n+\tgit commit -m I1 &&\n+\tgit tag I1 &&\n+\tgit checkout branch3 &&\n+\ttouch j &&\n+\tgit add j &&\n+\tgit commit -m J1 &&\n+\tgit merge I1 --no-commit &&\n+\tgit commit -m K1 &&\n+\tgit tag K1 &&\n+\tgit checkout branch2 &&\n+\ttouch l &&\n+\tgit add l &&\n+\tgit commit -m L1 &&\n+\tgit merge K1 --no-commit &&\n+\tgit commit -m M1 &&\n+\tGIT_EDITOR=: git rebase -i -p E2 &&\n+\ttest \"$(git rev-parse HEAD~3)\" = \"$(git rev-parse E2)\" &&\n+\ttest \"$(git rev-parse HEAD~2)\" = \"$(git rev-parse HEAD^2^2~2)\" &&\n+\ttest \"$(git rev-parse HEAD^2^1^1)\" = \"$(git rev-parse HEAD^2^2^1)\"\n+'\n+\n+test_done\n+\n-- \n1.6.0.2\n"},{"id":"93067","messageId":"ef8c08551dca1ddfea0017fd4026ac9ae60fbfec.1224055978.git.stephen@exigencecorp.com","threadId":"15907","inReplyTo":"79b3f186dc599ebb5e251d5c0ca93c233263974c.1224055978.git.stephen@exigencecorp.com","subject":"[PATCH] rebase-i-p: use HEAD for updating the ref instead of mapping OLDHEAD","fromName":"Stephen Haberman","fromEmail":"stephen@exigencecorp.com","sentAt":"2008-10-15T07:44:35Z","receivedAt":"2008-10-15T07:44:35Z","isPatch":true,"sender":{"key":"stephen@exigencecorp.com","avatar":"https://gravatar.com/avatar/23b93ad70a06ce53505f17ddba65176edbcfb6588e7a4c1a2dca04aaf0a6aff1?d=mp&s=160"},"body":"If OLDHEAD was reordered in the todo, and its mapped NEWHEAD was used to set the\nref, commits reordered after OLDHEAD in the todo would should up as un-committed\nchanges.\n\nSigned-off-by: Stephen Haberman <stephen@exigencecorp.com>\n---\n git-rebase--interactive.sh |   15 +--------------\n 1 files changed, 1 insertions(+), 14 deletions(-)\n\ndiff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh\nindex 30e4523..c968117 100755\n--- a/git-rebase--interactive.sh\n+++ b/git-rebase--interactive.sh\n@@ -376,20 +376,7 @@ do_next () {\n \tHEADNAME=$(cat \"$DOTEST\"/head-name) &&\n \tOLDHEAD=$(cat \"$DOTEST\"/head) &&\n \tSHORTONTO=$(git rev-parse --short $(cat \"$DOTEST\"/onto)) &&\n-\tif test -d \"$REWRITTEN\"\n-\tthen\n-\t\ttest -f \"$DOTEST\"/current-commit &&\n-\t\t\tcurrent_commit=$(cat \"$DOTEST\"/current-commit) &&\n-\t\t\tgit rev-parse HEAD > \"$REWRITTEN\"/$current_commit\n-\t\tif test -f \"$REWRITTEN\"/$OLDHEAD\n-\t\tthen\n-\t\t\tNEWHEAD=$(cat \"$REWRITTEN\"/$OLDHEAD)\n-\t\telse\n-\t\t\tNEWHEAD=$OLDHEAD\n-\t\tfi\n-\telse\n-\t\tNEWHEAD=$(git rev-parse HEAD)\n-\tfi &&\n+\tNEWHEAD=$(git rev-parse HEAD) &&\n \tcase $HEADNAME in\n \trefs/*)\n \t\tmessage=\"$GIT_REFLOG_ACTION: $HEADNAME onto $SHORTONTO)\" &&\n-- \n1.6.0.2\n"},{"id":"93064","messageId":"759654ef1f1781cd2b102e21c6f972b065560398.1224055978.git.stephen@exigencecorp.com","threadId":"15907","inReplyTo":"ef8c08551dca1ddfea0017fd4026ac9ae60fbfec.1224055978.git.stephen@exigencecorp.com","subject":"[PATCH] rebase-i-p: delay saving current-commit to REWRITTEN if squashing","fromName":"Stephen Haberman","fromEmail":"stephen@exigencecorp.com","sentAt":"2008-10-15T07:44:36Z","receivedAt":"2008-10-15T07:44:36Z","isPatch":true,"sender":{"key":"stephen@exigencecorp.com","avatar":"https://gravatar.com/avatar/23b93ad70a06ce53505f17ddba65176edbcfb6588e7a4c1a2dca04aaf0a6aff1?d=mp&s=160"},"body":"If the current-commit was dumped to REWRITTEN, but then we squash the next\ncommit in to it, we have invalidated the HEAD was just written to REWRITTEN.\nInstead, append the squash hash to current-commit and save both of them the next\ntime around.\n\nSigned-off-by: Stephen Haberman <stephen@exigencecorp.com>\n---\n git-rebase--interactive.sh |   15 ++++++++++-----\n 1 files changed, 10 insertions(+), 5 deletions(-)\n\ndiff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh\nindex c968117..23cf7a5 100755\n--- a/git-rebase--interactive.sh\n+++ b/git-rebase--interactive.sh\n@@ -170,13 +170,18 @@ pick_one_preserving_merges () {\n \n \tif test -f \"$DOTEST\"/current-commit\n \tthen\n-\t\tcurrent_commit=$(cat \"$DOTEST\"/current-commit) &&\n-\t\tgit rev-parse HEAD > \"$REWRITTEN\"/$current_commit &&\n-\t\trm \"$DOTEST\"/current-commit ||\n-\t\tdie \"Cannot write current commit's replacement sha1\"\n+\t\tif [ \"$fast_forward\" == \"t\" ]\n+\t\tthen\n+\t\t\tcat \"$DOTEST\"/current-commit | while read current_commit\n+\t\t\tdo\n+\t\t\t\tgit rev-parse HEAD > \"$REWRITTEN\"/$current_commit\n+\t\t\tdone\n+\t\t\trm \"$DOTEST\"/current-commit ||\n+\t\t\tdie \"Cannot write current commit's replacement sha1\"\n+\t\tfi\n \tfi\n \n-\techo $sha1 > \"$DOTEST\"/current-commit\n+\techo $sha1 >> \"$DOTEST\"/current-commit\n \n \t# rewrite parents; if none were rewritten, we can fast-forward.\n \tnew_parents=\n-- \n1.6.0.2\n"},{"id":"93069","messageId":"ab80b829ebfa597dc4aaac6e49f9907e505adf59.1224055978.git.stephen@exigencecorp.com","threadId":"15907","inReplyTo":"759654ef1f1781cd2b102e21c6f972b065560398.1224055978.git.stephen@exigencecorp.com","subject":"[PATCH] rebase-i-p: fix 'no squashing merges' tripping up non-merges","fromName":"Stephen Haberman","fromEmail":"stephen@exigencecorp.com","sentAt":"2008-10-15T07:44:37Z","receivedAt":"2008-10-15T07:44:37Z","isPatch":true,"sender":{"key":"stephen@exigencecorp.com","avatar":"https://gravatar.com/avatar/23b93ad70a06ce53505f17ddba65176edbcfb6588e7a4c1a2dca04aaf0a6aff1?d=mp&s=160"},"body":"Also only check out the first parent if this commit if not a squash--if it is a\nsquash, we want to explicitly ignore the parent and leave the wc as is, as\ncherry-pick will apply the squash on top of it.\n\nSigned-off-by: Stephen Haberman <stephen@exigencecorp.com>\n---\n git-rebase--interactive.sh |   14 +++++++++-----\n 1 files changed, 9 insertions(+), 5 deletions(-)\n\ndiff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh\nindex 23cf7a5..274251f 100755\n--- a/git-rebase--interactive.sh\n+++ b/git-rebase--interactive.sh\n@@ -219,15 +219,19 @@ pick_one_preserving_merges () {\n \t\t\tdie \"Cannot fast forward to $sha1\"\n \t\t;;\n \tf)\n-\t\ttest \"a$1\" = a-n && die \"Refusing to squash a merge: $sha1\"\n-\n \t\tfirst_parent=$(expr \"$new_parents\" : ' \\([^ ]*\\)')\n-\t\t# detach HEAD to current parent\n-\t\toutput git checkout $first_parent 2> /dev/null ||\n-\t\t\tdie \"Cannot move HEAD to $first_parent\"\n+\n+\t\tif [ \"$1\" != \"-n\" ]\n+\t\tthen\n+\t\t\t# detach HEAD to current parent\n+\t\t\toutput git checkout $first_parent 2> /dev/null ||\n+\t\t\t\tdie \"Cannot move HEAD to $first_parent\"\n+\t\tfi\n \n \t\tcase \"$new_parents\" in\n \t\t' '*' '*)\n+\t\t\ttest \"a$1\" = a-n && die \"Refusing to squash a merge: $sha1\"\n+\n \t\t\t# redo merge\n \t\t\tauthor_script=$(get_author_ident_from_commit $sha1)\n \t\t\teval \"$author_script\"\n-- \n1.6.0.2\n"},{"id":"93068","messageId":"0977b23f6c709d4aea76de7a88e9fe17272b31ea.1224055978.git.stephen@exigencecorp.com","threadId":"15907","inReplyTo":"ab80b829ebfa597dc4aaac6e49f9907e505adf59.1224055978.git.stephen@exigencecorp.com","subject":"[PATCH] rebase-i-p: only list commits that require rewriting in todo","fromName":"Stephen Haberman","fromEmail":"stephen@exigencecorp.com","sentAt":"2008-10-15T07:44:38Z","receivedAt":"2008-10-15T07:44:38Z","isPatch":true,"sender":{"key":"stephen@exigencecorp.com","avatar":"https://gravatar.com/avatar/23b93ad70a06ce53505f17ddba65176edbcfb6588e7a4c1a2dca04aaf0a6aff1?d=mp&s=160"},"body":"This is heavily based on Stephan Beyer's git sequencer rewrite of rebase-i-p.\n\nEach commit is still found by rev-list UPSTREAM..HEAD, but a commit is only\nincluded in todo if at least one its parents has been marked for rewriting.\n\nSigned-off-by: Stephen Haberman <stephen@exigencecorp.com>\n---\n git-rebase--interactive.sh |   77 +++++++++++++++++++++++++++++--------------\n 1 files changed, 52 insertions(+), 25 deletions(-)\n\ndiff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh\nindex 274251f..331cb18 100755\n--- a/git-rebase--interactive.sh\n+++ b/git-rebase--interactive.sh\n@@ -579,18 +579,67 @@ first and then run 'git rebase --continue' again.\"\n \t\t\t\techo $ONTO > \"$REWRITTEN\"/$c ||\n \t\t\t\t\tdie \"Could not init rewritten commits\"\n \t\t\tdone\n+\t\t\t# No cherry-pick because our first pass is to determine\n+\t\t\t# parents to rewrite and skipping dropped commits would\n+\t\t\t# prematurely end our probe\n \t\t\tMERGES_OPTION=\n \t\telse\n-\t\t\tMERGES_OPTION=--no-merges\n+\t\t\tMERGES_OPTION=\"--no-merges --cherry-pick\"\n \t\tfi\n \n \t\tSHORTUPSTREAM=$(git rev-parse --short $UPSTREAM)\n \t\tSHORTHEAD=$(git rev-parse --short $HEAD)\n \t\tSHORTONTO=$(git rev-parse --short $ONTO)\n \t\tgit rev-list $MERGES_OPTION --pretty=oneline --abbrev-commit \\\n-\t\t\t--abbrev=7 --reverse --left-right --cherry-pick \\\n+\t\t\t--abbrev=7 --reverse --left-right --topo-order \\\n \t\t\t$UPSTREAM...$HEAD | \\\n-\t\t\tsed -n \"s/^>/pick /p\" > \"$TODO\"\n+\t\t\tsed -n \"s/^>//p\" | while read shortsha1 rest\n+\t\tdo\n+\t\t\tif test t != \"$PRESERVE_MERGES\"\n+\t\t\tthen\n+\t\t\t\techo \"pick $shortsha1 $rest\" >> \"$TODO\"\n+\t\t\telse\n+\t\t\t\tsha1=$(git rev-parse $shortsha1)\n+\t\t\t\tpreserve=t\n+\t\t\t\tfor p in $(git rev-list --parents -1 $sha1 | cut -d' ' -f2-)\n+\t\t\t\tdo\n+\t\t\t\t\tif test -f \"$REWRITTEN\"/$p\n+\t\t\t\t\tthen\n+\t\t\t\t\t\tpreserve=f\n+\t\t\t\t\tfi\n+\t\t\t\tdone\n+\t\t\t\tif test f = \"$preserve\"\n+\t\t\t\tthen\n+\t\t\t\t\ttouch \"$REWRITTEN\"/$sha1\n+\t\t\t\t\techo \"pick $shortsha1 $rest\" >> \"$TODO\"\n+\t\t\t\tfi\n+\t\t\tfi\n+\t\tdone\n+\n+\t\t# Watch for commits that been dropped by --cherry-pick\n+\t\tif test t = \"$PRESERVE_MERGES\"\n+\t\tthen\n+\t\t\tmkdir \"$DROPPED\"\n+\t\t\t# Save all non-cherry-picked changes\n+\t\t\tgit rev-list $UPSTREAM...$HEAD --left-right --cherry-pick | \\\n+\t\t\t\tsed -n \"s/^>//p\" > \"$DOTEST\"/not-cherry-picks\n+\t\t\t# Now all commits and note which ones are missing in\n+\t\t\t# not-cherry-picks and hence being dropped\n+\t\t\tgit rev-list $UPSTREAM...$HEAD --left-right | \\\n+ \t\t\t\tsed -n \"s/^>//p\" | while read rev\n+\t\t\tdo\n+\t\t\t\tif test -f \"$REWRITTEN\"/$rev -a \"$(grep \"$rev\" \"$DOTEST\"/not-cherry-picks)\" = \"\"\n+\t\t\t\tthen\n+\t\t\t\t\t# Use -f2 because if rev-list is telling us this commit is\n+\t\t\t\t\t# not worthwhile, we don't want to track its multiple heads,\n+\t\t\t\t\t# just the history of its first-parent for others that will\n+\t\t\t\t\t# be rebasing on top of it\n+\t\t\t\t\tgit rev-list --parents -1 $rev | cut -d' ' -f2 > \"$DROPPED\"/$rev\n+\t\t\t\t\tcat \"$TODO\" | grep -v \"${rev:0:7}\" > \"${TODO}2\" ; mv \"${TODO}2\" \"$TODO\"\n+\t\t\t\t\trm \"$REWRITTEN\"/$rev\n+\t\t\t\tfi\n+\t\t\tdone\n+\t\tfi\n \t\ttest -s \"$TODO\" || echo noop >> \"$TODO\"\n \t\tcat >> \"$TODO\" << EOF\n \n@@ -606,28 +655,6 @@ first and then run 'git rebase --continue' again.\"\n #\n EOF\n \n-\t\t# Watch for commits that been dropped by --cherry-pick\n-\t\tif test t = \"$PRESERVE_MERGES\"\n-\t\tthen\n-\t\t\tmkdir \"$DROPPED\"\n-\t\t\t# drop the --cherry-pick parameter this time\n-\t\t\tgit rev-list $MERGES_OPTION --abbrev-commit \\\n-\t\t\t\t--abbrev=7 $UPSTREAM...$HEAD --left-right | \\\n-\t\t\t\tsed -n \"s/^>//p\" | while read rev\n-\t\t\tdo\n-\t\t\t\tgrep --quiet \"$rev\" \"$TODO\"\n-\t\t\t\tif [ $? -ne 0 ]\n-\t\t\t\tthen\n-\t\t\t\t\t# Use -f2 because if rev-list is telling this commit is not\n-\t\t\t\t\t# worthwhile, we don't want to track its multiple heads,\n-\t\t\t\t\t# just the history of its first-parent for others that will\n-\t\t\t\t\t# be rebasing on top of us\n-\t\t\t\t\tfull=$(git rev-parse $rev)\n-\t\t\t\t\tgit rev-list --parents -1 $rev | cut -d' ' -f2 > \"$DROPPED\"/$full\n-\t\t\t\tfi\n-\t\t\tdone\n-\t\tfi\n-\n \t\thas_action \"$TODO\" ||\n \t\t\tdie_abort \"Nothing to do\"\n \n-- \n1.6.0.2\n"},{"id":"93070","messageId":"3fd41e60ed27b248f15c60d5a45e543a7e32af99.1224055978.git.stephen@exigencecorp.com","threadId":"15907","inReplyTo":"0977b23f6c709d4aea76de7a88e9fe17272b31ea.1224055978.git.stephen@exigencecorp.com","subject":"[PATCH] rebase-i-p: do not include non-first-parent commits touching UPSTREAM","fromName":"Stephen Haberman","fromEmail":"stephen@exigencecorp.com","sentAt":"2008-10-15T07:44:39Z","receivedAt":"2008-10-15T07:44:39Z","isPatch":true,"sender":{"key":"stephen@exigencecorp.com","avatar":"https://gravatar.com/avatar/23b93ad70a06ce53505f17ddba65176edbcfb6588e7a4c1a2dca04aaf0a6aff1?d=mp&s=160"},"body":"This covers an odd boundary case found by Avi Kivity's script where a branch\ncoming off of UPSTREAM is merged into HEAD. Initially it show up in\nUPSTREAM..HEAD, but technically UPSTREAM is not moving, the rest of head is, so\nwe should not need to rewrite the merge.\n\nThis adds a check saying we can keep `preserve=t` if `p=UPSTREAM`...unless this\nis the first first-parent commit in our UPSTREAM..HEAD rev-list, which could\nvery well point to UPSTREAM, but we still need to consider it as rewritten so we\nstart pulling in the rest of the UPSTREAM..HEAD commits that point to it.\n\nSigned-off-by: Stephen Haberman <stephen@exigencecorp.com>\n---\n git-rebase--interactive.sh |    3 ++-\n 1 files changed, 2 insertions(+), 1 deletions(-)\n\ndiff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh\nindex 331cb18..3821692 100755\n--- a/git-rebase--interactive.sh\n+++ b/git-rebase--interactive.sh\n@@ -583,6 +583,7 @@ first and then run 'git rebase --continue' again.\"\n \t\t\t# parents to rewrite and skipping dropped commits would\n \t\t\t# prematurely end our probe\n \t\t\tMERGES_OPTION=\n+\t\t\tfirst_after_upstream=\"$(git rev-list --reverse --first-parent $UPSTREAM..$HEAD | head -n 1)\"\n \t\telse\n \t\t\tMERGES_OPTION=\"--no-merges --cherry-pick\"\n \t\tfi\n@@ -603,7 +604,7 @@ first and then run 'git rebase --continue' again.\"\n \t\t\t\tpreserve=t\n \t\t\t\tfor p in $(git rev-list --parents -1 $sha1 | cut -d' ' -f2-)\n \t\t\t\tdo\n-\t\t\t\t\tif test -f \"$REWRITTEN\"/$p\n+\t\t\t\t\tif test -f \"$REWRITTEN\"/$p -a \\( $p != $UPSTREAM -o $sha1 = $first_after_upstream \\)\n \t\t\t\t\tthen\n \t\t\t\t\t\tpreserve=f\n \t\t\t\t\tfi\n-- \n1.6.0.2\n"},{"id":"93072","messageId":"130c9caae646675893ed17cd213c53a9734fe837.1224055978.git.stephen@exigencecorp.com","threadId":"15907","inReplyTo":"3fd41e60ed27b248f15c60d5a45e543a7e32af99.1224055978.git.stephen@exigencecorp.com","subject":"[PATCH] rebase-i-p: if todo was reordered use HEAD as the rewritten parent","fromName":"Stephen Haberman","fromEmail":"stephen@exigencecorp.com","sentAt":"2008-10-15T07:44:40Z","receivedAt":"2008-10-15T07:44:40Z","isPatch":true,"sender":{"key":"stephen@exigencecorp.com","avatar":"https://gravatar.com/avatar/23b93ad70a06ce53505f17ddba65176edbcfb6588e7a4c1a2dca04aaf0a6aff1?d=mp&s=160"},"body":"This seems like the best guess we can make until git sequencer marks are\navailable. That being said, within the context of re-ordering a commit before\nits parent in todo, I think applying it on top of the current commit seems like\na reasonable assumption of what the user intended.\n\nSigned-off-by: Stephen Haberman <stephen@exigencecorp.com>\n---\n git-rebase--interactive.sh               |    9 +++++++++\n t/t3411-rebase-preserve-around-merges.sh |    4 ++--\n 2 files changed, 11 insertions(+), 2 deletions(-)\n\ndiff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh\nindex 3821692..1fc4f44 100755\n--- a/git-rebase--interactive.sh\n+++ b/git-rebase--interactive.sh\n@@ -194,6 +194,15 @@ pick_one_preserving_merges () {\n \t\tif test -f \"$REWRITTEN\"/$p\n \t\tthen\n \t\t\tnew_p=$(cat \"$REWRITTEN\"/$p)\n+\n+\t\t\t# If the todo reordered commits, and our parent is marked for\n+\t\t\t# rewriting, but hasn't been gotten to yet, assume the user meant to\n+\t\t\t# drop it on top of the current HEAD\n+\t\t\tif test -z \"$new_p\"\n+\t\t\tthen\n+\t\t\t\tnew_p=$(git rev-parse HEAD)\n+\t\t\tfi\n+\n \t\t\ttest $p != $new_p && fast_forward=f\n \t\t\tcase \"$new_parents\" in\n \t\t\t*$new_p*)\ndiff --git a/t/t3411-rebase-preserve-around-merges.sh b/t/t3411-rebase-preserve-around-merges.sh\nindex b3973c9..dfad5dd 100644\n--- a/t/t3411-rebase-preserve-around-merges.sh\n+++ b/t/t3411-rebase-preserve-around-merges.sh\n@@ -80,7 +80,7 @@ test_expect_success 'setup' '\n #       \\        /\n #        -- C1 --\n #\n-test_expect_failure 'squash F1 into D1' '\n+test_expect_success 'squash F1 into D1' '\n \tFAKE_LINES=\"1 squash 3 2\" git rebase -i -p B1 &&\n \ttest \"$(git rev-parse HEAD^2)\" = \"$(git rev-parse branch)\" &&\n \ttest \"$(git rev-parse HEAD~2)\" = \"$(git rev-parse B1)\" &&\n@@ -99,7 +99,7 @@ test_expect_failure 'squash F1 into D1' '\n #\n # And rebase G1..M1 onto E2\n \n-test_expect_failure 'rebase two levels of merge' '\n+test_expect_success 'rebase two levels of merge' '\n \tgit checkout -b branch2 A1 &&\n \ttouch g &&\n \tgit add g &&\n-- \n1.6.0.2\n"},{"id":"93496","messageId":"20081020115003.GA11309@coredump.intra.peff.net","threadId":"15907","inReplyTo":"0977b23f6c709d4aea76de7a88e9fe17272b31ea.1224055978.git.stephen@exigencecorp.com","subject":"Re: [PATCH] rebase-i-p: only list commits that require rewriting in todo","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2008-10-20T11:50:04Z","receivedAt":"2008-10-20T11:50:04Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, Oct 15, 2008 at 02:44:38AM -0500, Stephen Haberman wrote:\n\n> +\t\t\t\t\tcat \"$TODO\" | grep -v \"${rev:0:7}\" > \"${TODO}2\" ; mv \"${TODO}2\" \"$TODO\"\n\nSubstring expansion (like ${rev:0:7}) is not portable. At least it\ndoesn't work on FreeBSD /bin/sh, and \"it's not even in POSIX\", I\nbelieve.\n\n-Peff\n"},{"id":"93562","messageId":"7vej2a3kl5.fsf@gitster.siamese.dyndns.org","threadId":"15907","inReplyTo":"20081020115003.GA11309@coredump.intra.peff.net","subject":"Re: [PATCH] rebase-i-p: only list commits that require rewriting in todo","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-10-20T23:36:38Z","receivedAt":"2008-10-20T23:36:38Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> On Wed, Oct 15, 2008 at 02:44:38AM -0500, Stephen Haberman wrote:\n>\n>> +\t\t\t\t\tcat \"$TODO\" | grep -v \"${rev:0:7}\" > \"${TODO}2\" ; mv \"${TODO}2\" \"$TODO\"\n>\n> Substring expansion (like ${rev:0:7}) is not portable. At least it\n> doesn't work on FreeBSD /bin/sh, and \"it's not even in POSIX\", I\n> believe.\n\nTrue.\n\nI do not remember the individual patches in the series, but I have to say\nthat the script at the tip of the topic is, eh, less than ideal.\n\nHere is a small untested patch to fix a few issues I spotted while reading\nit for two minutes.\n\n * Why filter output from \"rev-list --left-right A...B\" and look for the\n   ones that begin with \">\"?  Wouldn't \"rev-list A..B\" give that?\n\n * The abbreviated SHA-1 are made with \"rev-list --abbrev=7\" into $TODO in\n   an earlier invocation, and it can be more than 7 letters to avoid\n   ambiguity.  Not just that \"${r:0:7} is not even in POSIX\", but use of\n   it here is actively wrong.\n\n * There is no point in catting a single file and piping it into grep.\n\n\n git-rebase--interactive.sh |    7 ++++---\n 1 files changed, 4 insertions(+), 3 deletions(-)\n\ndiff --git i/git-rebase--interactive.sh w/git-rebase--interactive.sh\nindex 848fbe7..a563dea 100755\n--- i/git-rebase--interactive.sh\n+++ w/git-rebase--interactive.sh\n@@ -635,8 +635,8 @@ first and then run 'git rebase --continue' again.\"\n \t\t\t\tsed -n \"s/^>//p\" > \"$DOTEST\"/not-cherry-picks\n \t\t\t# Now all commits and note which ones are missing in\n \t\t\t# not-cherry-picks and hence being dropped\n-\t\t\tgit rev-list $UPSTREAM...$HEAD --left-right | \\\n-\t\t\t\tsed -n \"s/^>//p\" | while read rev\n+\t\t\tgit rev-list $UPSTREAM..$HEAD |\n+\t\t\twhile read rev\n \t\t\tdo\n \t\t\t\tif test -f \"$REWRITTEN\"/$rev -a \"$(grep \"$rev\" \"$DOTEST\"/not-cherry-picks)\" = \"\"\n \t\t\t\tthen\n@@ -645,7 +645,8 @@ first and then run 'git rebase --continue' again.\"\n \t\t\t\t\t# just the history of its first-parent for others that will\n \t\t\t\t\t# be rebasing on top of it\n \t\t\t\t\tgit rev-list --parents -1 $rev | cut -d' ' -f2 > \"$DROPPED\"/$rev\n-\t\t\t\t\tcat \"$TODO\" | grep -v \"${rev:0:7}\" > \"${TODO}2\" ; mv \"${TODO}2\" \"$TODO\"\n+\t\t\t\t\tshort=$(git rev-list -1 --abbrev-commit --abbrev=7 $rev)\n+\t\t\t\t\tgrep -v \"^[a-z][a-z]* $short\" <\"$TODO\" > \"${TODO}2\" ; mv \"${TODO}2\" \"$TODO\"\n \t\t\t\t\trm \"$REWRITTEN\"/$rev\n \t\t\t\tfi\n \t\t\tdone\n"},{"id":"93569","messageId":"20081021003935.GC32569@coredump.intra.peff.net","threadId":"15907","inReplyTo":"7vej2a3kl5.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] rebase-i-p: only list commits that require rewriting in todo","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2008-10-21T00:39:35Z","receivedAt":"2008-10-21T00:39:35Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, Oct 20, 2008 at 04:36:38PM -0700, Junio C Hamano wrote:\n\n> I do not remember the individual patches in the series, but I have to say\n> that the script at the tip of the topic is, eh, less than ideal.\n> \n> Here is a small untested patch to fix a few issues I spotted while reading\n> it for two minutes.\n> \n>  * Why filter output from \"rev-list --left-right A...B\" and look for the\n>    ones that begin with \">\"?  Wouldn't \"rev-list A..B\" give that?\n> \n>  * The abbreviated SHA-1 are made with \"rev-list --abbrev=7\" into $TODO in\n>    an earlier invocation, and it can be more than 7 letters to avoid\n>    ambiguity.  Not just that \"${r:0:7} is not even in POSIX\", but use of\n>    it here is actively wrong.\n> \n>  * There is no point in catting a single file and piping it into grep.\n\nAll of those look like sane changes to me (I'll admit that before I\ndidn't even look at the script beyond the breakage on my test box).\n\n-Peff\n"},{"id":"93645","messageId":"20081022000113.bacc1923.stephen@exigencecorp.com","threadId":"15907","inReplyTo":"7vej2a3kl5.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] rebase-i-p: only list commits that require rewriting in todo","fromName":"Stephen Haberman","fromEmail":"stephen@exigencecorp.com","sentAt":"2008-10-22T05:01:13Z","receivedAt":"2008-10-22T05:01:13Z","isPatch":true,"sender":{"key":"stephen@exigencecorp.com","avatar":"https://gravatar.com/avatar/23b93ad70a06ce53505f17ddba65176edbcfb6588e7a4c1a2dca04aaf0a6aff1?d=mp&s=160"},"body":"\n> >> + cat \"$TODO\" | grep -v \"${rev:0:7}\" > \"${TODO}2\" ; mv \"${TODO}2\"\n> >> \"$TODO\"\n> >\n> > Substring expansion (like ${rev:0:7}) is not portable. At least it\n> > doesn't work on FreeBSD /bin/sh, and \"it's not even in POSIX\", I\n> > believe.\n>\n> True.\n\nThanks--sorry about that. rev:0:7 was a cute/stupid optimization to\navoid an extra `git rev-parse` call.\n\n> I do not remember the individual patches in the series, but I have to\n> say that the script at the tip of the topic is, eh, less than ideal.\n\nAgreed. The previous dropped commits check was nicer, with just one\npass, as todo already had all of the non-dropped of the commits in it.\n\nNow that todo has to include all commits initially to do parent probing,\nthe dropped commits check requires two passes, dropping lines from todo,\netc., and is a good deal uglier.\n\n> Here is a small untested patch to fix a few issues I spotted while reading\n> it for two minutes.\n> \n>  * Why filter output from \"rev-list --left-right A...B\" and look for the\n>    ones that begin with \">\"?  Wouldn't \"rev-list A..B\" give that?\n\nOh--right. I was being too careful about keeping the existing rev-list\ncall and only changing what I needed that I didn't step back realize\nthat.\n\n>  * The abbreviated SHA-1 are made with \"rev-list --abbrev=7\" into $TODO in\n>    an earlier invocation, and it can be more than 7 letters to avoid\n>    ambiguity.  Not just that \"${r:0:7} is not even in POSIX\", but use of\n>    it here is actively wrong.\n\nAh, didn't think of that.\n\n>  * There is no point in catting a single file and piping it into grep.\n\nRight, right, I've been trying to get out of that habit.\n\n> diff --git i/git-rebase--interactive.sh w/git-rebase--interactive.sh\n> index 848fbe7..a563dea 100755\n> --- i/git-rebase--interactive.sh\n> +++ w/git-rebase--interactive.sh\n> @@ -635,8 +635,8 @@ first and then run 'git rebase --continue' again.\"\n>  \t\t\t\tsed -n \"s/^>//p\" > \"$DOTEST\"/not-cherry-picks\n>  \t\t\t# Now all commits and note which ones are missing in\n>  \t\t\t# not-cherry-picks and hence being dropped\n> -\t\t\tgit rev-list $UPSTREAM...$HEAD --left-right | \\\n> -\t\t\t\tsed -n \"s/^>//p\" | while read rev\n> +\t\t\tgit rev-list $UPSTREAM..$HEAD |\n> +\t\t\twhile read rev\n>  \t\t\tdo\n>  \t\t\t\tif test -f \"$REWRITTEN\"/$rev -a \"$(grep \"$rev\" \"$DOTEST\"/not-cherry-picks)\" = \"\"\n>  \t\t\t\tthen\n> @@ -645,7 +645,8 @@ first and then run 'git rebase --continue' again.\"\n>  \t\t\t\t\t# just the history of its first-parent for others that will\n>  \t\t\t\t\t# be rebasing on top of it\n>  \t\t\t\t\tgit rev-list --parents -1 $rev | cut -d' ' -f2 > \"$DROPPED\"/$rev\n> -\t\t\t\t\tcat \"$TODO\" | grep -v \"${rev:0:7}\" > \"${TODO}2\" ; mv \"${TODO}2\" \"$TODO\"\n> +\t\t\t\t\tshort=$(git rev-list -1 --abbrev-commit --abbrev=7 $rev)\n> +\t\t\t\t\tgrep -v \"^[a-z][a-z]* $short\" <\"$TODO\" > \"${TODO}2\" ; mv \"${TODO}2\" \"$TODO\"\n>  \t\t\t\t\trm \"$REWRITTEN\"/$rev\n>  \t\t\t\tfi\n>  \t\t\tdone\n\nLooks good--I applied this locally and it passes t3404, t3410, and\nt3411. Do I need to do anything else with this, e.g. resubmit/append on\ntop of the previous series, or do you have it taken care of?\n\nThanks for reviewing this, and Jeff too. I appreciate the feedback.\n\nI will be bullish about the use cases I'd like to see work (these\npreserve merges tweaks and the config setting for `git pull`), but\nhumble about my patches. This one especially is not elegant, it just\npasses the tests. I've been re-reading it looking for a better way to\ndo it and nothing is jumping out at me. Let me know if you know of a\nbetter approach or would like me to try something else.\n\nThanks,\nStephen\n"},{"id":"93647","messageId":"7vwsg1uqn1.fsf@gitster.siamese.dyndns.org","threadId":"15907","inReplyTo":"20081022000113.bacc1923.stephen@exigencecorp.com","subject":"Re: [PATCH] rebase-i-p: only list commits that require rewriting in todo","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-10-22T05:48:18Z","receivedAt":"2008-10-22T05:48:18Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Stephen Haberman <stephen@exigencecorp.com> writes:\n\n> Looks good--I applied this locally and it passes t3404, t3410, and\n> t3411. Do I need to do anything else with this, e.g. resubmit/append on\n> top of the previous series, or do you have it taken care of?\n\nI've queued it on top of your series and merged the result in 'next'.\nFurther improvements should be done the same way.\n\n> I will be bullish about the use cases I'd like to see work (these\n> preserve merges tweaks and the config setting for `git pull`), but\n> humble about my patches. This one especially is not elegant, it just\n> passes the tests.\n\nThat's perfectly fine.  We can start from sound ideas (the behaviour we would want\nto see) and incrementally improve the implementation.\n\nThanks.\n"},{"id":"93680","messageId":"20081022125149.GA17092@coredump.intra.peff.net","threadId":"15907","inReplyTo":"759654ef1f1781cd2b102e21c6f972b065560398.1224055978.git.stephen@exigencecorp.com","subject":"Re: [PATCH] rebase-i-p: delay saving current-commit to REWRITTEN if squashing","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2008-10-22T12:51:49Z","receivedAt":"2008-10-22T12:51:49Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, Oct 15, 2008 at 02:44:36AM -0500, Stephen Haberman wrote:\n\n> +\t\tif [ \"$fast_forward\" == \"t\" ]\n\nThis one even fails on my Linux box. :) \"==\" is a bash-ism.\n\n-Peff\n"},{"id":"93695","messageId":"alpine.DEB.1.00.0810221721370.22125@pacific.mpi-cbg.de.mpi-cbg.de","threadId":"15907","inReplyTo":"20081022125149.GA17092@coredump.intra.peff.net","subject":"Re: [PATCH] rebase-i-p: delay saving current-commit to REWRITTEN if squashing","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-10-22T15:21:53Z","receivedAt":"2008-10-22T15:21:53Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 22 Oct 2008, Jeff King wrote:\n\n> On Wed, Oct 15, 2008 at 02:44:36AM -0500, Stephen Haberman wrote:\n> \n> > +\t\tif [ \"$fast_forward\" == \"t\" ]\n> \n> This one even fails on my Linux box. :) \"==\" is a bash-ism.\n\nDid we not also prefer \"test\" to \"[\"?\n\nCiao,\nDscho\n"},{"id":"93698","messageId":"20081022155014.GD20967@frsk.net","threadId":"15907","inReplyTo":"alpine.DEB.1.00.0810221721370.22125@pacific.mpi-cbg.de.mpi-cbg.de","subject":"Re: [PATCH] rebase-i-p: delay saving current-commit to REWRITTEN if squashing","fromName":"Fredrik Skolmli","fromEmail":"fredrik@frsk.net","sentAt":"2008-10-22T15:50:14Z","receivedAt":"2008-10-22T15:50:14Z","isPatch":true,"sender":{"key":"fredrik@frsk.net","avatar":"https://avatars.githubusercontent.com/u/40261?v=4"},"body":"On Wed, Oct 22, 2008 at 05:21:53PM +0200, Johannes Schindelin wrote:\n> Hi,\n> \n> On Wed, 22 Oct 2008, Jeff King wrote:\n> \n> > On Wed, Oct 15, 2008 at 02:44:36AM -0500, Stephen Haberman wrote:\n> > \n> > > +\t\tif [ \"$fast_forward\" == \"t\" ]\n> > \n> > This one even fails on my Linux box. :) \"==\" is a bash-ism.\n> \n> Did we not also prefer \"test\" to \"[\"?\n\nWe did.\n\nDocumentation/CodingGuidelines, line 51:\n    - We prefer \"test\" over \"[ ... ]\".\n\n-- \nKind regards,\nFredrik Skolmli\n"},{"id":"93707","messageId":"7v4p34v42e.fsf@gitster.siamese.dyndns.org","threadId":"15907","inReplyTo":"20081022125149.GA17092@coredump.intra.peff.net","subject":"Re: [PATCH] rebase-i-p: delay saving current-commit to REWRITTEN if squashing","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-10-22T19:10:33Z","receivedAt":"2008-10-22T19:10:33Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> On Wed, Oct 15, 2008 at 02:44:36AM -0500, Stephen Haberman wrote:\n>\n>> +\t\tif [ \"$fast_forward\" == \"t\" ]\n>\n> This one even fails on my Linux box. :) \"==\" is a bash-ism.\n\nThanks.\n\n-- >8 --\nSubject: [PATCH] git-rebase--interactive.sh: comparision with == is bashism\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n git-rebase--interactive.sh |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh\nindex a563dea..0cae3be 100755\n--- a/git-rebase--interactive.sh\n+++ b/git-rebase--interactive.sh\n@@ -170,7 +170,7 @@ pick_one_preserving_merges () {\n \n \tif test -f \"$DOTEST\"/current-commit\n \tthen\n-\t\tif [ \"$fast_forward\" == \"t\" ]\n+\t\tif test \"$fast_forward\" = t\n \t\tthen\n \t\t\tcat \"$DOTEST\"/current-commit | while read current_commit\n \t\t\tdo\n-- \n1.6.0.3.723.g757e\n"},{"id":"93710","messageId":"20081022191517.GB31568@coredump.intra.peff.net","threadId":"15907","inReplyTo":"7v4p34v42e.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] rebase-i-p: delay saving current-commit to REWRITTEN if squashing","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2008-10-22T19:15:17Z","receivedAt":"2008-10-22T19:15:17Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, Oct 22, 2008 at 12:10:33PM -0700, Junio C Hamano wrote:\n\n> >> +\t\tif [ \"$fast_forward\" == \"t\" ]\n> > This one even fails on my Linux box. :) \"==\" is a bash-ism.\n> \n> Thanks.\n\nYou're very welcome, and sorry for not saving you a little time by\nwriting my complaint in patch form in the first place.\n\n-Peff\n"}]}