{"thread":{"id":"4610","subject":"[PATCH] rebase --merge: fix for rebasing more than 7 commits.","startedAt":"2006-06-22T08:44:54Z","lastAt":"2006-06-25T04:59:12Z","messageCount":10,"participants":["Junio C Hamano","Eric Wong","Johannes Schindelin"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"22247","messageId":"7vy7vptw8p.fsf@assigned-by-dhcp.cox.net","threadId":"4610","inReplyTo":null,"subject":"[PATCH] rebase --merge: fix for rebasing more than 7 commits.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-06-22T08:44:54Z","receivedAt":"2006-06-22T08:44:54Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Instead of using 4-digit numbers to name commits being rebased,\njust use \"cmt.$msgnum\" string, with $msgnum as a decimal number\nwithout leading zero padding.  This makes it possible to rebase\nmore than 9999 commits, but of more practical importance is that\nthe earlier code used \"printf\" to format already formatted\n$msgnum and barfed when it counted up to 0008.  In other words,\nthe old code was incapable of rebasing more than 7 commits, and\nthis fixes that problem.\n\nSigned-off-by: Junio C Hamano <junkio@cox.net>\n---\n\n * I wanted to raise my confidence level in the new rebase --merge\n   code, so I did a little exercise which resulted in finding this\n   buglet.\n\n   I did not have \"read/write-tree --prefix\" on the \"master\"\n   branch, when I received the patch series that begins with\n   \"Make git-write-tree a builtin\" from Lukas.  Now, my policy\n   is to avoid starting a new topic based on \"next\" (because it\n   would make later pulling in the topic into \"master\" without\n   all the other uncooked stuff in \"next\" impossible), but the\n   series was based on \"next\" (which was actually nice, since\n   write-tree between \"master\" and \"next\" were somewhat diverged\n   back then), and I couldn't easily rebase Lukas's patch series\n   on top of \"master\" because we did not have \"rebase --merge\"\n   option.  Now I can with the updated \"rebase\".\n\n   So the exercise went like this:\n\n   (1) Start from a clone of git.git, with \"master\" at 8c278ab\n       (where the \"master\" was before \"read/write-tree --prefix\"\n       was merged), and \"ls/am\" at ab195e1 (what applying\n       Lukas's series on top of \"next\" would have produced).\n       Use \"reset --hard\" as needed.\n\n   (2) \"git rebase --merge --onto master ls/am~9\" (ls/am~8 being\n       the first one of the series).  This fails with a merge\n       conflict on builtin-write-tree.c (the \"rebase --merge\"\n       code did the right thing with the renamed path).  Fix it\n       up and also fix builtin.h (signature of write_tree()\n       needs to be changed to drop prefix).\n\n       It was very helpful to view:\n\n           git diff :3:builtin-write-tree.c builtin-write-tree.c\t\n\n       during the hand resolution of the conflicts; it lets me\n       see what Lukas did, so I can adjust the patch by removing\n       parts that are specific to \"next\" and not applicable to\n       \"master\".  \n\n  (3) \"git update-index builtin-write-tree.c builtin.h\" and then\n      \"git rebase --continue\".  The bug manifests itself during\n      the finalization step, which this commit fixes.\n\n  With this fix, the above works beautifully.  I am reasonably\n  happy with this shiny new toy.  Good job, Eric! and thanks.\n\n git-rebase.sh |   23 ++++++++++-------------\n 1 files changed, 10 insertions(+), 13 deletions(-)\n\ndiff --git a/git-rebase.sh b/git-rebase.sh\nindex b9ce112..9159477 100755\n--- a/git-rebase.sh\n+++ b/git-rebase.sh\n@@ -67,16 +67,16 @@ continue_merge () {\n \tprev_head=`git-rev-parse HEAD^0`\n \n \t# save the resulting commit so we can read-tree on it later\n-\techo \"$prev_head\" > \"$dotest/`printf %0${prec}d $msgnum`.result\"\n+\techo \"$prev_head\" > \"$dotest/cmt.$msgnum.result\"\n \techo \"$prev_head\" > \"$dotest/prev_head\"\n \n \t# onto the next patch:\n \tmsgnum=$(($msgnum + 1))\n-\tprintf \"%0${prec}d\" \"$msgnum\" > \"$dotest/msgnum\"\n+\techo \"$msgnum\" >\"$dotest/msgnum\"\n }\n \n call_merge () {\n-\tcmt=\"$(cat $dotest/`printf %0${prec}d $1`)\"\n+\tcmt=\"$(cat $dotest/cmt.$1)\"\n \techo \"$cmt\" > \"$dotest/current\"\n \tgit-merge-$strategy \"$cmt^\" -- HEAD \"$cmt\"\n \trv=$?\n@@ -108,15 +108,12 @@ finish_rb_merge () {\n \tend=\"`cat $dotest/end`\"\n \twhile test \"$msgnum\" -le \"$end\"\n \tdo\n-\t\tmsgnum=`printf \"%0${prec}d\" \"$msgnum\"`\n-\t\tprintf \"%0${prec}d\" \"$msgnum\" > \"$dotest/msgnum\"\n-\n-\t\tgit-read-tree `cat \"$dotest/$msgnum.result\"`\n+\t\tgit-read-tree `cat \"$dotest/cmt.$msgnum.result\"`\n \t\tgit-checkout-index -q -f -u -a\n-\t\tgit-commit -C \"`cat $dotest/$msgnum`\"\n+\t\tgit-commit -C \"`cat $dotest/cmt.$msgnum`\"\n \n-\t\techo \"Committed $msgnum\"\n-\t\techo '    '`git-rev-list --pretty=oneline -1 HEAD | \\\n+\t\tprintf \"Committed %0${prec}d\" $msgnum\n+\t\techo ' '`git-rev-list --pretty=oneline -1 HEAD | \\\n \t\t\t\t\tsed 's/^[a-f0-9]\\+ //'`\n \t\tmsgnum=$(($msgnum + 1))\n \tdone\n@@ -322,11 +319,11 @@ for cmt in `git-rev-list --no-merges \"$u\n \t\t\t| perl -e 'print reverse <>'`\n do\n \tmsgnum=$(($msgnum + 1))\n-\techo \"$cmt\" > \"$dotest/`printf \"%0${prec}d\" $msgnum`\"\n+\techo \"$cmt\" > \"$dotest/cmt.$msgnum\"\n done\n \n-printf \"%0${prec}d\" 1 > \"$dotest/msgnum\"\n-printf \"%0${prec}d\" \"$msgnum\" > \"$dotest/end\"\n+echo 1 >\"$dotest/msgnum\"\n+echo $msgnum >\"$dotest/end\"\n \n end=$msgnum\n msgnum=1\n-- \n1.4.0.gfba6\n"},{"id":"22248","messageId":"7vpsh1tvt1.fsf@assigned-by-dhcp.cox.net","threadId":"4610","inReplyTo":"7vy7vptw8p.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] rebase --merge: fix for rebasing more than 7 commits.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-06-22T08:54:18Z","receivedAt":"2006-06-22T08:54:18Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <junkio@cox.net> writes:\n\n>  * I wanted to raise my confidence level in the new rebase --merge\n>    code, so I did a little exercise which resulted in finding this\n>    buglet.\n>...\n>    So the exercise went like this:\n>...\n>   With this fix, the above works beautifully.  I am reasonably\n>   happy with this shiny new toy.  Good job, Eric! and thanks.\n\nBy the way, I do not quite understand the reasoning behind not\nmoving the head being rebased until the finalization phase.\n\nAlso I think --skip would be straightforward.  What you look at\nin call_merge() is the current HEAD, the commit being rebased\nand its direct parent (actually what you are interested in are\ntrees of these commits and not ancestry chains among them -- if\nwe can tell git-merge-recursive not to try its own \"recursive\"\nmerge base finding but just use what we give it as the base, I\ncould sleep better.  I think the current code could misbehave in\nfunnier ancestry graph if we allow it to pick merge base on its\nown), so skipping is just a matter of, eh, skipping the commit.\n"},{"id":"22259","messageId":"20060622110941.GA32261@hand.yhbt.net","threadId":"4610","inReplyTo":"7vpsh1tvt1.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] rebase --merge: fix for rebasing more than 7 commits.","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2006-06-22T11:09:41Z","receivedAt":"2006-06-22T11:09:41Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"Junio C Hamano <junkio@cox.net> wrote:\n> Junio C Hamano <junkio@cox.net> writes:\n> \n> >  * I wanted to raise my confidence level in the new rebase --merge\n> >    code, so I did a little exercise which resulted in finding this\n> >    buglet.\n> >...\n> >    So the exercise went like this:\n> >...\n> >   With this fix, the above works beautifully.  I am reasonably\n> >   happy with this shiny new toy.  Good job, Eric! and thanks.\n\n:)  Thanks for the extra QA and fix.\n\n> By the way, I do not quite understand the reasoning behind not\n> moving the head being rebased until the finalization phase.\n\nThat's because my original patch that only used git-merge, which didn't\nlet me manually commit with all the information from a previous commit.\n\n> Also I think --skip would be straightforward.  What you look at\n> in call_merge() is the current HEAD, the commit being rebased\n> and its direct parent (actually what you are interested in are\n> trees of these commits and not ancestry chains among them -- if\n> we can tell git-merge-recursive not to try its own \"recursive\"\n> merge base finding but just use what we give it as the base, I\n> could sleep better.  I think the current code could misbehave in\n> funnier ancestry graph if we allow it to pick merge base on its\n> own), so skipping is just a matter of, eh, skipping the commit.\n\nAnother consequence of relying on plain git-merge in my original\npatch.  --skip should be very doable now that we can specify\nthe correct base.  I'll look into it more when I'm more awake.\n\n-- \nEric Wong\n"},{"id":"22424","messageId":"7vac83114g.fsf@assigned-by-dhcp.cox.net","threadId":"4610","inReplyTo":"20060622110941.GA32261@hand.yhbt.net","subject":"Re: [PATCH] rebase --merge: fix for rebasing more than 7 commits.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-06-24T07:09:03Z","receivedAt":"2006-06-24T07:09:03Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Eric Wong <normalperson@yhbt.net> writes:\n\n> Junio C Hamano <junkio@cox.net> wrote:\n>> Junio C Hamano <junkio@cox.net> writes:\n>> \n>> >  * I wanted to raise my confidence level in the new rebase --merge\n>> >    code, so I did a little exercise which resulted in finding this\n>> >    buglet.\n>> >...\n>> >    So the exercise went like this:\n>> >...\n>> >   With this fix, the above works beautifully.  I am reasonably\n>> >   happy with this shiny new toy.  Good job, Eric! and thanks.\n>\n> :)  Thanks for the extra QA and fix.\n\nAnother thing I noticed is while rebasing onto the mainline that\nhas accepted a few of the patches from the topic.  The original\nrebase with \"git am -3\" logic notices that the patch has already\nbeen applied and drops that commit, which is rather nice, but\nthe new \"rebase --merge\" logic barfs when git-commit notices\nthere is nothing to commit.  I think you could before calling\ngit-commit check if the git-merge-$strategy gave you the tree\nidentical to the HEAD tree, and simply skip it (maybe after\ngiving the user \"patch already applied\"message).\n"},{"id":"22493","messageId":"11511989892359-git-send-email-normalperson@yhbt.net","threadId":"4610","inReplyTo":"20060622110941.GA32261@hand.yhbt.net","subject":"[PATCH 0/3] rebase --merge improvements and fixes","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2006-06-25T01:29:46Z","receivedAt":"2006-06-25T01:29:46Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"These patches should address the current issues with rebase --merge\nusage.  It can now do everything the original format-patch | am -3\nstrategy including --skip and detection of merged commits by upstream.\n\n-- \nEric Wong\n"},{"id":"22492","messageId":"11511989902239-git-send-email-normalperson@yhbt.net","threadId":"4610","inReplyTo":"20060622110941.GA32261@hand.yhbt.net","subject":"[PATCH 1/3] rebase: allow --merge option to handle patches merged upstream","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2006-06-25T01:29:47Z","receivedAt":"2006-06-25T01:29:47Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"Enhance t3401-rebase-partial to test with --merge as well as\nthe standard am -3 strategy.\n\nSigned-off-by: Eric Wong <normalperson@yhbt.net>\n---\n git-rebase.sh             |   15 +++++++++++----\n t/t3401-rebase-partial.sh |   13 ++++++++++++-\n 2 files changed, 23 insertions(+), 5 deletions(-)\n\ndiff --git a/git-rebase.sh b/git-rebase.sh\nindex 9159477..53fb14e 100755\n--- a/git-rebase.sh\n+++ b/git-rebase.sh\n@@ -82,7 +82,10 @@ call_merge () {\n \trv=$?\n \tcase \"$rv\" in\n \t0)\n-\t\tgit-commit -C \"$cmt\" || die \"commit failed: $MRESOLVEMSG\"\n+\t\tif test -n \"`git-diff-index HEAD`\"\n+\t\tthen\n+\t\t\tgit-commit -C \"$cmt\" || die \"commit failed: $MRESOLVEMSG\"\n+\t\tfi\n \t\t;;\n \t1)\n \t\ttest -d \"$GIT_DIR/rr-cache\" && git-rerere\n@@ -110,9 +113,13 @@ finish_rb_merge () {\n \tdo\n \t\tgit-read-tree `cat \"$dotest/cmt.$msgnum.result\"`\n \t\tgit-checkout-index -q -f -u -a\n-\t\tgit-commit -C \"`cat $dotest/cmt.$msgnum`\"\n-\n-\t\tprintf \"Committed %0${prec}d\" $msgnum\n+\t\tif test -n \"`git-diff-index HEAD`\"\n+\t\tthen\n+\t\t\tgit-commit -C \"`cat $dotest/cmt.$msgnum`\"\n+\t\t\tprintf \"Committed %0${prec}d\" $msgnum\n+\t\telse\n+\t\t\tprintf \"Already applied: %0${prec}d\" $msgnum\n+\t\tfi\n \t\techo ' '`git-rev-list --pretty=oneline -1 HEAD | \\\n \t\t\t\t\tsed 's/^[a-f0-9]\\+ //'`\n \t\tmsgnum=$(($msgnum + 1))\ndiff --git a/t/t3401-rebase-partial.sh b/t/t3401-rebase-partial.sh\nindex 32dc9c5..360a670 100755\n--- a/t/t3401-rebase-partial.sh\n+++ b/t/t3401-rebase-partial.sh\n@@ -37,7 +37,9 @@ test_expect_success \\\n test_expect_success \\\n     'pick top patch from topic branch into master' \\\n     'git-cherry-pick my-topic-branch^0 &&\n-     git-checkout -f my-topic-branch\n+     git-checkout -f my-topic-branch &&\n+     git-branch master-merge master &&\n+     git-branch my-topic-branch-merge my-topic-branch\n '\n \n test_debug \\\n@@ -50,4 +52,13 @@ test_expect_success \\\n     'rebase topic branch against new master and check git-am did not get halted' \\\n     'git-rebase master && test ! -d .dotest'\n \n+if test -z \"$no_python\"\n+then\n+    test_expect_success \\\n+\t'rebase --merge topic branch that was partially merged upstream' \\\n+\t'git-checkout -f my-topic-branch-merge &&\n+\t git-rebase --merge master-merge &&\n+\t test ! -d .git/.dotest-merge'\n+fi\n+\n test_done\n-- \n1.4.0.g937a\n"},{"id":"22494","messageId":"11511989922423-git-send-email-normalperson@yhbt.net","threadId":"4610","inReplyTo":"20060622110941.GA32261@hand.yhbt.net","subject":"[PATCH 2/3] rebase: cleanup rebasing with --merge","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2006-06-25T01:29:48Z","receivedAt":"2006-06-25T01:29:48Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"We no longer have to recommit each patch to remove the parent\ninformation we're rebasing since we're using the low-level merge\nstrategies directly instead of git-merge.\n\nSigned-off-by: Eric Wong <normalperson@yhbt.net>\n---\n git-rebase.sh |   33 +++++----------------------------\n 1 files changed, 5 insertions(+), 28 deletions(-)\n\ndiff --git a/git-rebase.sh b/git-rebase.sh\nindex 53fb14e..a95ada6 100755\n--- a/git-rebase.sh\n+++ b/git-rebase.sh\n@@ -59,15 +59,16 @@ continue_merge () {\n \n \tif test -n \"`git-diff-index HEAD`\"\n \tthen\n+\t\tprintf \"Committed: %0${prec}d\" $msgnum\n \t\tgit-commit -C \"`cat $dotest/current`\"\n \telse\n-\t\techo \"Previous merge succeeded automatically\"\n+\t\tprintf \"Already applied: %0${prec}d\" $msgnum\n \tfi\n+\techo ' '`git-rev-list --pretty=oneline -1 HEAD | \\\n+\t\t\t\tsed 's/^[a-f0-9]\\+ //'`\n \n \tprev_head=`git-rev-parse HEAD^0`\n-\n \t# save the resulting commit so we can read-tree on it later\n-\techo \"$prev_head\" > \"$dotest/cmt.$msgnum.result\"\n \techo \"$prev_head\" > \"$dotest/prev_head\"\n \n \t# onto the next patch:\n@@ -82,10 +83,7 @@ call_merge () {\n \trv=$?\n \tcase \"$rv\" in\n \t0)\n-\t\tif test -n \"`git-diff-index HEAD`\"\n-\t\tthen\n-\t\t\tgit-commit -C \"$cmt\" || die \"commit failed: $MRESOLVEMSG\"\n-\t\tfi\n+\t\treturn\n \t\t;;\n \t1)\n \t\ttest -d \"$GIT_DIR/rr-cache\" && git-rerere\n@@ -103,27 +101,6 @@ call_merge () {\n }\n \n finish_rb_merge () {\n-\tset -e\n-\n-\tmsgnum=1\n-\techo \"Finalizing rebased commits...\"\n-\tgit-reset --hard \"`cat $dotest/onto`\"\n-\tend=\"`cat $dotest/end`\"\n-\twhile test \"$msgnum\" -le \"$end\"\n-\tdo\n-\t\tgit-read-tree `cat \"$dotest/cmt.$msgnum.result\"`\n-\t\tgit-checkout-index -q -f -u -a\n-\t\tif test -n \"`git-diff-index HEAD`\"\n-\t\tthen\n-\t\t\tgit-commit -C \"`cat $dotest/cmt.$msgnum`\"\n-\t\t\tprintf \"Committed %0${prec}d\" $msgnum\n-\t\telse\n-\t\t\tprintf \"Already applied: %0${prec}d\" $msgnum\n-\t\tfi\n-\t\techo ' '`git-rev-list --pretty=oneline -1 HEAD | \\\n-\t\t\t\t\tsed 's/^[a-f0-9]\\+ //'`\n-\t\tmsgnum=$(($msgnum + 1))\n-\tdone\n \trm -r \"$dotest\"\n \techo \"All done.\"\n }\n-- \n1.4.0.g937a\n"},{"id":"22495","messageId":"11511989931962-git-send-email-normalperson@yhbt.net","threadId":"4610","inReplyTo":"20060622110941.GA32261@hand.yhbt.net","subject":"[PATCH 3/3] rebase: allow --skip to work with --merge","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2006-06-25T01:29:49Z","receivedAt":"2006-06-25T01:29:49Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"Now that we control the merge base selection, we won't be forced\ninto rolling things in that we wanted to skip beforehand.\n\nAlso, add a test to ensure this all works as intended.\n\nSigned-off-by: Eric Wong <normalperson@yhbt.net>\n---\n Documentation/git-rebase.txt |    1 -\n git-rebase.sh                |   13 ++++++++-\n t/t3403-rebase-skip.sh       |   61 ++++++++++++++++++++++++++++++++++++++++++\n 3 files changed, 73 insertions(+), 2 deletions(-)\n\ndiff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt\nindex c339c45..9d7bcaa 100644\n--- a/Documentation/git-rebase.txt\n+++ b/Documentation/git-rebase.txt\n@@ -108,7 +108,6 @@ OPTIONS\n \n --skip::\n \tRestart the rebasing process by skipping the current patch.\n-\tThis does not work with the --merge option.\n \n --merge::\n \tUse merging strategies to rebase.  When the recursive (default) merge\ndiff --git a/git-rebase.sh b/git-rebase.sh\nindex a95ada6..9ad1c44 100755\n--- a/git-rebase.sh\n+++ b/git-rebase.sh\n@@ -137,7 +137,18 @@ do\n \t--skip)\n \t\tif test -d \"$dotest\"\n \t\tthen\n-\t\t\tdie \"--skip is not supported when using --merge\"\n+\t\t\tprev_head=\"`cat $dotest/prev_head`\"\n+\t\t\tend=\"`cat $dotest/end`\"\n+\t\t\tmsgnum=\"`cat $dotest/msgnum`\"\n+\t\t\tmsgnum=$(($msgnum + 1))\n+\t\t\tonto=\"`cat $dotest/onto`\"\n+\t\t\twhile test \"$msgnum\" -le \"$end\"\n+\t\t\tdo\n+\t\t\t\tcall_merge \"$msgnum\"\n+\t\t\t\tcontinue_merge\n+\t\t\tdone\n+\t\t\tfinish_rb_merge\n+\t\t\texit\n \t\tfi\n \t\tgit am -3 --skip --resolvemsg=\"$RESOLVEMSG\"\n \t\texit\ndiff --git a/t/t3403-rebase-skip.sh b/t/t3403-rebase-skip.sh\nnew file mode 100755\nindex 0000000..8ab63c5\n--- /dev/null\n+++ b/t/t3403-rebase-skip.sh\n@@ -0,0 +1,61 @@\n+#!/bin/sh\n+#\n+# Copyright (c) 2006 Eric Wong\n+#\n+\n+test_description='git rebase --merge --skip tests'\n+\n+. ./test-lib.sh\n+\n+# we assume the default git-am -3 --skip strategy is tested independently\n+# and always works :)\n+\n+if test \"$no_python\"; then\n+\techo \"Skipping: no python => no recursive merge\"\n+\ttest_done\n+\texit 0\n+fi\n+\n+test_expect_success setup '\n+\techo hello > hello &&\n+\tgit add hello &&\n+\tgit commit -m \"hello\" &&\n+\tgit branch skip-reference &&\n+\n+\techo world >> hello &&\n+\tgit commit -a -m \"hello world\" &&\n+\techo goodbye >> hello &&\n+\tgit commit -a -m \"goodbye\" &&\n+\n+\tgit checkout -f skip-reference &&\n+\techo moo > hello &&\n+\tgit commit -a -m \"we should skip this\" &&\n+\techo moo > cow &&\n+\tgit add cow &&\n+\tgit commit -m \"this should not be skipped\" &&\n+\tgit branch pre-rebase skip-reference &&\n+\tgit branch skip-merge skip-reference\n+\t'\n+\n+test_expect_failure 'rebase with git am -3 (default)' 'git rebase master'\n+\n+test_expect_success 'rebase --skip with am -3' '\n+\tgit reset --hard HEAD &&\n+\tgit rebase --skip\n+\t'\n+test_expect_success 'checkout skip-merge' 'git checkout -f skip-merge'\n+\n+test_expect_failure 'rebase with --merge' 'git rebase --merge master'\n+\n+test_expect_success 'rebase --skip with --merge' '\n+\tgit reset --hard HEAD &&\n+\tgit rebase --skip\n+\t'\n+\n+test_expect_success 'merge and reference trees equal' \\\n+\t'test -z \"`git-diff-tree skip-merge skip-reference`\"'\n+\n+test_debug 'gitk --all & sleep 1'\n+\n+test_done\n+\n-- \n1.4.0.g937a\n"},{"id":"22511","messageId":"Pine.LNX.4.63.0606250401490.29667@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"4610","inReplyTo":"11511989902239-git-send-email-normalperson@yhbt.net","subject":"Re: [PATCH 1/3] rebase: allow --merge option to handle patches merged upstream","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2006-06-25T02:04:48Z","receivedAt":"2006-06-25T02:04:48Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Sat, 24 Jun 2006, Eric Wong wrote:\n\n> +\t\tif test -n \"`git-diff-index HEAD`\"\n\nThis is not a sufficient test if the patch was already merged to upstream. \nFor example, you can have two patches which touched the same file, and one \nof them was applied to upstream, the other not. The test fails to see \nthat. Or am I missing something?\n\nCiao,\nDscho\n"},{"id":"22521","messageId":"20060625045912.GB17674@hand.yhbt.net","threadId":"4610","inReplyTo":"Pine.LNX.4.63.0606250401490.29667@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: [PATCH 1/3] rebase: allow --merge option to handle patches merged upstream","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2006-06-25T04:59:12Z","receivedAt":"2006-06-25T04:59:12Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:\n> Hi,\n> \n> On Sat, 24 Jun 2006, Eric Wong wrote:\n> \n> > +\t\tif test -n \"`git-diff-index HEAD`\"\n> \n> This is not a sufficient test if the patch was already merged to upstream. \n> For example, you can have two patches which touched the same file, and one \n> of them was applied to upstream, the other not. The test fails to see \n> that. Or am I missing something?\n\nThis is just to tell if there's anything worth committing after a merge\nis complete.  If not, then it assumes it's been a) merged upstream or b)\nempty in the first place (very unlikely).\n\n-- \nEric Wong\n"}]}