{"thread":{"id":"9186","subject":"when git-rebase -i fails to cherry-pick","startedAt":"2007-07-23T22:54:02Z","lastAt":"2007-07-27T19:35:40Z","messageCount":7,"participants":["Uwe Kleine-König","Johannes Schindelin","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"48370","messageId":"20070723225402.GB22513@informatik.uni-freiburg.de","threadId":"9186","inReplyTo":null,"subject":"when git-rebase -i fails to cherry-pick","fromName":"Uwe Kleine-König","fromEmail":"ukleinek@informatik.uni-freiburg.de","sentAt":"2007-07-23T22:54:02Z","receivedAt":"2007-07-23T22:54:02Z","isPatch":false,"sender":{"key":"u.kleine-koenig@pengutronix.de","avatar":"https://gravatar.com/avatar/354b5e3ceb2806a2f1e1e382ac29ddbdad18288654da62b61eb13583a857eee7?d=mp&s=160"},"body":"Hello,\n\neven though git-rebase -i is still young, I'm already a big fan of it.\n\nI just want to suggest two minor things:\n\n- If a cherry-pick fails, it tells me to resolve my conflicts, 'git add\n  <paths>' and to do 'git commit -c $sha1id'.\n\n  But it doesn't tell me, how I continue to rebase after that.\n\n  'git rebase -i --continue' works.\n\n- If a cherry-pick of a commit to be squashed fails, the instruction to\n  do 'git commit -c $sha1id' is wrong, because then I don't get both\n  message to squash.\n\nBest regards\nUwe\n\n-- \nUwe Kleine-König\n\nhttp://www.google.com/search?q=12+mol+in+dozen\n"},{"id":"48372","messageId":"Pine.LNX.4.64.0707240005240.14781@racer.site","threadId":"9186","inReplyTo":"20070723225402.GB22513@informatik.uni-freiburg.de","subject":"Re: when git-rebase -i fails to cherry-pick","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-07-23T23:08:48Z","receivedAt":"2007-07-23T23:08:48Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 24 Jul 2007, Uwe Kleine-K?nig wrote:\n\n> even though git-rebase -i is still young, I'm already a big fan of it.\n\nNice!\n\n> I just want to suggest two minor things:\n> \n> - If a cherry-pick fails, it tells me to resolve my conflicts, 'git add\n>   <paths>' and to do 'git commit -c $sha1id'.\n> \n>   But it doesn't tell me, how I continue to rebase after that.\n> \n>   'git rebase -i --continue' works.\n\nActually, even \"git rebase --continue\" works.  And you do not really have \nto commit, either, just updating your index is fine.  In fact, if you say \n\"git reset --hard\", it will skip the commit.\n\n> - If a cherry-pick of a commit to be squashed fails, the instruction to\n>   do 'git commit -c $sha1id' is wrong, because then I don't get both\n>   message to squash.\n\nYes, it is a leftover from the bad old days, when this script was called \nedit-patch-series, and I was a rebase hater.\n\nIn the meantime, somebody on IRC explained to me how rebase works, and \nthat rebase lovers were quite annoyed not to be able to just resolve the \nconflicts and \"git rebase --continue\".\n\nI'd appreciate if you prepared a patch with better explanations, and also \nreviewed the man page, if it is in good shape (and does not lie about the \ncurrent behaviour).\n\nThanks,\nDscho\n"},{"id":"48507","messageId":"20070724200510.GA27610@informatik.uni-freiburg.de","threadId":"9186","inReplyTo":"Pine.LNX.4.64.0707240005240.14781@racer.site","subject":"Re: when git-rebase -i fails to cherry-pick","fromName":"Uwe Kleine-König","fromEmail":"ukleinek@informatik.uni-freiburg.de","sentAt":"2007-07-24T20:05:10Z","receivedAt":"2007-07-24T20:05:10Z","isPatch":false,"sender":{"key":"u.kleine-koenig@pengutronix.de","avatar":"https://gravatar.com/avatar/354b5e3ceb2806a2f1e1e382ac29ddbdad18288654da62b61eb13583a857eee7?d=mp&s=160"},"body":"Hello Johannes,\n\nJohannes Schindelin wrote:\n> > - If a cherry-pick fails, it tells me to resolve my conflicts, 'git add\n> >   <paths>' and to do 'git commit -c $sha1id'.\n> > \n> >   But it doesn't tell me, how I continue to rebase after that.\n> > \n> >   'git rebase -i --continue' works.\n> \n> Actually, even \"git rebase --continue\" works.  And you do not really have \n> to commit, either, just updating your index is fine.  In fact, if you say \n> \"git reset --hard\", it will skip the commit.\nOK, thanks.\n\n> > - If a cherry-pick of a commit to be squashed fails, the instruction to\n> >   do 'git commit -c $sha1id' is wrong, because then I don't get both\n> >   message to squash.\n> \n> Yes, it is a leftover from the bad old days, when this script was called \n> edit-patch-series, and I was a rebase hater.\n> \n> In the meantime, somebody on IRC explained to me how rebase works, and \n> that rebase lovers were quite annoyed not to be able to just resolve the \n> conflicts and \"git rebase --continue\".\n> \n> I'd appreciate if you prepared a patch with better explanations, and also \n> reviewed the man page, if it is in good shape (and does not lie about the \n> current behaviour).\nIt's on my todo list, but not the top item for git.\n\nIn the mean-time I found another nuisance:\n\nAfter doing:\n\n\ttmpdir=/tmp/repo\n\tmkdir $tmpdir\n\tcd $tmpdir\n\tgit init\n\tfor n in one two three four; do echo $n >> file; git add file;\n\tgit commit -m $n; done\n\tgit rebase -i HEAD~3 #squash four onto two\n\ngit rebase stops (as expected) when trying to apply four, at this stage\ntwo is already commited.\n\nThe conflicting file looks as follows:\n\n\tone\n\ttwo\n\t<<<<<<< HEAD:file\n\t=======\n\tthree\n\tfour\n\t>>>>>>> e7fbd8f... four:file\n\nI currently have no idea how to improve this, but I miss the information\nthat the commit *adds* \"four\" and \"three\" is only context.\n\nResolving with:\n\n\techo one > file; echo two >> file; echo four >> file;\n\tgit add file; git rebase --continue\n\nand typing a new log (e.g. two + four) git rebase stops once more (again\nas expected) when trying to apply three, OK, resolving the conflict is\neasy (one, two, three, four), git add file, git rebase --continue.\n\nLooking at the resulting log, I have the following:\n\n        zeisberg@cassiopeia:/tmp/repo$ git log --pretty=oneline\n\t145ce01e1cf3f4cb86cd0065c0d0d5b62b399ad4 three\n\tcd082bca636efca17409be4d871d0971237df06c two + four\n\tb6b985977db45e314509d94282597c2ff8029d3d two\n\t15f8cbbb5a452b075b49f3dedbeaeb66668b8025 one\n\nSo the request to squash two + four was lost.\n\nI will look at it when I'm done with git-sendemail ...\n\nBest regards\nUwe\n\n-- \nUwe Kleine-König\n\nmain(){char*a=\"main(){char*a=%c%s%c;printf(a,34,a,34%c\";printf(a,34,a,34\n,10);a=\",10);a=%c%s%c;printf(a,34,a,34,10);}%c\";printf(a,34,a,34,10);}\n"},{"id":"48513","messageId":"Pine.LNX.4.64.0707242139370.14781@racer.site","threadId":"9186","inReplyTo":"20070724200510.GA27610@informatik.uni-freiburg.de","subject":"[PATCH] rebase -i: fix interrupted squashing","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-07-24T20:43:09Z","receivedAt":"2007-07-24T20:43:09Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"\nWhen a squashing merge failed, the first commit would not be replaced,\ndue to \"git reset --soft\" being called with an unmerged index.\n\nNoticed by Uwe Kleine-König.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n\n\tOn Tue, 24 Jul 2007, Uwe Kleine-K?nig wrote:\n\n\t> Johannes Schindelin wrote:\n\t>\n\t> > I'd appreciate if you prepared a patch with better \n\t> > explanations, and also reviewed the man page, if it is in good \n\t> > shape (and does not lie about the current behaviour).\n\t>\n\t> It's on my todo list, but not the top item for git.\n\n\tPlease come around to do it.\n\n\t> In the mean-time I found another nuisance:\n\t> \n\t> [outlines the test case provided in this patch]\n\n\tIt would have been a bit less work for me, if you would have used \n\tt/trash/ instead of /tmp/, and provided a patch for t3404 for me \n\tto work with.\n\n\tAlas, the bug was squashed in 5 minutes.  It took me 15 minutes to \n\twrite (and test) the test.\n\n\tWhat a difference order can make...\n\n git-rebase--interactive.sh    |    2 +-\n t/t3404-rebase-interactive.sh |   30 ++++++++++++++++++++++++++++++\n 2 files changed, 31 insertions(+), 1 deletions(-)\n\ndiff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh\nindex 93289c0..78ae51e 100755\n--- a/git-rebase--interactive.sh\n+++ b/git-rebase--interactive.sh\n@@ -258,8 +258,8 @@ do_next () {\n \t\tesac\n \n \t\tfailed=f\n-\t\tpick_one -n $sha1 || failed=t\n \t\toutput git reset --soft HEAD^\n+\t\tpick_one -n $sha1 || failed=t\n \t\tauthor_script=$(get_author_ident_from_commit $sha1)\n \t\techo \"$author_script\" > \"$DOTEST\"/author-script\n \t\tcase $failed in\ndiff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh\nindex 8206436..817f614 100755\n--- a/t/t3404-rebase-interactive.sh\n+++ b/t/t3404-rebase-interactive.sh\n@@ -221,4 +221,34 @@ test_expect_success 'multi-squash only fires up editor once' '\n \ttest 1 = $(git show | grep ONCE | wc -l)\n '\n \n+test_expect_success 'squash works as expected' '\n+\tfor n in one two three four\n+\tdo\n+\t\techo $n >> file$n &&\n+\t\tgit add file$n &&\n+\t\tgit commit -m $n\n+\tdone &&\n+\tone=$(git rev-parse HEAD~3) &&\n+\tFAKE_LINES=\"1 squash 3 2\" git rebase -i HEAD~3 &&\n+\ttest $one = $(git rev-parse HEAD~2)\n+'\n+\n+test_expect_success 'interrupted squash works as expected' '\n+\tfor n in one two three four\n+\tdo\n+\t\techo $n >> conflict &&\n+\t\tgit add conflict &&\n+\t\tgit commit -m $n\n+\tdone &&\n+\tone=$(git rev-parse HEAD~3) &&\n+\t! FAKE_LINES=\"1 squash 3 2\" git rebase -i HEAD~3 &&\n+\t(echo one; echo two; echo four) > conflict &&\n+\tgit add conflict &&\n+\t! git rebase --continue &&\n+\techo resolved > conflict &&\n+\tgit add conflict &&\n+\tgit rebase --continue &&\n+\ttest $one = $(git rev-parse HEAD~2)\n+'\n+\n test_done\n-- \n1.5.3.rc2.42.gda8d\n"},{"id":"48807","messageId":"Pine.LNX.4.64.0707271817100.14781@racer.site","threadId":"9186","inReplyTo":"Pine.LNX.4.64.0707242139370.14781@racer.site","subject":"Re: [PATCH] rebase -i: fix interrupted squashing","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-07-27T17:18:32Z","receivedAt":"2007-07-27T17:18:32Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 24 Jul 2007, Johannes Schindelin wrote:\n\n> \n> When a squashing merge failed, the first commit would not be replaced,\n> due to \"git reset --soft\" being called with an unmerged index.\n> \n> Noticed by Uwe Kleine-König.\n\nUnfortunately, no Ack from him.\n\nHowever, I have tested it myself (even unwantedly, when working on the \nwork-tree sanitising, and it bit me again; I run \n\"master\"+branch--new-workdir ATM).\n\nJunio, please apply...\n\nCiao,\nDscho\n"},{"id":"48825","messageId":"7v1wet1wmw.fsf@assigned-by-dhcp.cox.net","threadId":"9186","inReplyTo":"Pine.LNX.4.64.0707271817100.14781@racer.site","subject":"Re: [PATCH] rebase -i: fix interrupted squashing","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-07-27T19:20:39Z","receivedAt":"2007-07-27T19:20:39Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Thanks for reminding.\n\nI thought I read the patch, felt satisfied and already applied,\nbut obviously I forgot the last step.  Anything else that should\nbe in 1.5.3 I forgot?\n\nBTW, I _think_ somebody between your brain and my mbox mangled\numlaut in Uwe's name.  I'll fix it up.\n"},{"id":"48828","messageId":"Pine.LNX.4.64.0707272032480.14781@racer.site","threadId":"9186","inReplyTo":"7v1wet1wmw.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] rebase -i: fix interrupted squashing","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-07-27T19:35:40Z","receivedAt":"2007-07-27T19:35:40Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Fri, 27 Jul 2007, Junio C Hamano wrote:\n\n> Thanks for reminding.\n> \n> I thought I read the patch, felt satisfied and already applied,\n> but obviously I forgot the last step.  Anything else that should\n> be in 1.5.3 I forgot?\n\nI'll try to fix that unpack bug I talked about lately, and I'd like to get \nin a little bit saner filter-branch.  One where you can read in the \ndocumentation \"pruning paths without --subdirectory-filter is not yet \nsupported, and likewise pruning by --grep\".\n\nI guess the proper fix would be to build a rev-list command line leaving \nout all the parameters which can prune the commits that the passed refs \npoint to, but that is probably a little painful, to say the least.\n\n> BTW, I _think_ somebody between your brain and my mbox mangled\n> umlaut in Uwe's name.  I'll fix it up.\n\nThanks.\n\nCiao,\nDscho\n"}]}