{"thread":{"id":"11280","subject":"[BUG?] git rebase -i","startedAt":"2007-12-14T01:21:25Z","lastAt":"2007-12-18T20:24:18Z","messageCount":7,"participants":["Pieter de Bie","Johannes Sixt","Johannes Schindelin","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"63072","messageId":"2791F15A-EB72-4FE4-8DB3-7A4B4DCB07B3@frim.nl","threadId":"11280","inReplyTo":null,"subject":"[BUG?] git rebase -i","fromName":"Pieter de Bie","fromEmail":"frim@frim.nl","sentAt":"2007-12-14T01:21:25Z","receivedAt":"2007-12-14T01:21:25Z","isPatch":false,"sender":{"key":"frim@frim.nl","avatar":null},"body":"Hi,\n\nI was just toying with git rebase -i -p, when I found the following:\n\nTirana:~/git pieter$ /opt/local/bin/git --version\ngit version 1.5.3.5\n\nTirana:~/git pieter$ time /opt/local/bin/git rebase -p -i HEAD~100\nSuccessfully rebased and updated refs/heads/master.\n\nreal    0m17.816s\nuser    0m3.927s\nsys     0m10.381s\n\nTirana:~/git pieter$ git --version\ngit version 1.5.4.rc0\nTirana:~/git pieter$ time git rebase -p -i HEAD~100\ncat: /Users/pieter/git/.git/.dotest-merge/rewritten/ \n1e8df762b38e01685f3aa3613e2d61f73346fcbe: No such file or directory\n\nreal    0m20.427s\nuser    0m4.449s\nsys     0m14.028s\n\nThe rebase in 1.5.4.rc0 exists with an error. Another thing to note  \nis that the 1.5.4.rc0 tries to apply 215 patches, while the 1.5.3.5  \ntries to apply 206 patches. This test was done on the git master  \nbranch (tagged 1.5.4.rc0). I did not change anything in the  \ninteractive rebase editor (just hit :wq in vim).\n\n- Pieter\n"},{"id":"63115","messageId":"47623129.2030303@viscovery.net","threadId":"11280","inReplyTo":"2791F15A-EB72-4FE4-8DB3-7A4B4DCB07B3@frim.nl","subject":"Re: [BUG?] git rebase -i","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2007-12-14T07:30:49Z","receivedAt":"2007-12-14T07:30:49Z","isPatch":false,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Pieter de Bie schrieb:\n> Another thing to note is\n> that the 1.5.4.rc0 tries to apply 215 patches, while the 1.5.3.5 tries\n> to apply 206 patches.\n\nThis is to be expected: 1.5.3.5 counts the comment lines at the top of the\naction file, of which there are exactly 9, 1.5.4.rc0 does not count them.\n\n-- Hannes\n"},{"id":"63433","messageId":"9CC305E7-3325-4D17-A43E-0A2072F52084@ai.rug.nl","threadId":"11280","inReplyTo":"47623129.2030303@viscovery.net","subject":"Re: [BUG?] git rebase -i","fromName":"Pieter de Bie","fromEmail":"pdebie@ai.rug.nl","sentAt":"2007-12-17T16:04:58Z","receivedAt":"2007-12-17T16:04:58Z","isPatch":false,"sender":{"key":"pdebie@ai.rug.nl","avatar":null},"body":"Hi,\n\nOn Dec 14, 2007, at 8:30 AM, Johannes Sixt wrote:\n> Pieter de Bie schrieb:\n>> Another thing to note is\n>> that the 1.5.4.rc0 tries to apply 215 patches, while the 1.5.3.5  \n>> tries\n>> to apply 206 patches.\n>\n> This is to be expected: 1.5.3.5 counts the comment lines at the top  \n> of the\n> action file, of which there are exactly 9, 1.5.4.rc0 does not count  \n> them.\n>\n\nOk, but what about the error in the rebase?\n\nOn Dec 14, 2007, at 2:21 AM, Pieter de Bie wrote:\n> Tirana:~/git pieter$ time git rebase -p -i HEAD~100\n> cat: /Users/pieter/git/.git/.dotest-merge/rewritten/ \n> 1e8df762b38e01685f3aa3613e2d61f73346fcbe: No such file or directory\n\n\n- Pieter\n"},{"id":"63440","messageId":"Pine.LNX.4.64.0712171649420.9446@racer.site","threadId":"11280","inReplyTo":"9CC305E7-3325-4D17-A43E-0A2072F52084@ai.rug.nl","subject":"[PATCH] rebase -p -i: handle \"no changes\" gracefully","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-12-17T16:59:38Z","receivedAt":"2007-12-17T16:59:38Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"\nSince commit 376ccb8cbb453343998e734d8a1ce79f57a4e092, unchanged\nSHA-1s are no longer mapped via $REWRITTEN.  But the updating\nphase was not prepared for the old head not being rewritten.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n\n\tOn Mon, 17 Dec 2007, Pieter de Bie wrote:\n\n\t> Ok, but what about the error in the rebase?\n\t> \n\t> On Dec 14, 2007, at 2:21 AM, Pieter de Bie wrote:\n\t> > Tirana:~/git pieter$ time git rebase -p -i HEAD~100\n\t> > cat:\n\t> > /Users/pieter/git/.git/.dotest-merge/rewritten/1e8df762b38e01685f3aa3613e2d61f73346fcbe:\n\t> > No such file or directory\n\n\tThis buglet was not caught earlier, probably because a \n\tnon-rewriting rebase is not really interesting ;-)\n\n git-rebase--interactive.sh |    7 ++++++-\n 1 files changed, 6 insertions(+), 1 deletions(-)\n\ndiff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh\nindex f83e00f..cd7e43f 100755\n--- a/git-rebase--interactive.sh\n+++ b/git-rebase--interactive.sh\n@@ -322,7 +322,12 @@ do_next () {\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\tNEWHEAD=$(cat \"$REWRITTEN\"/$OLDHEAD)\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-- \n1.5.4.rc0.59.g1d10d\n"},{"id":"63471","messageId":"7vprx56pfn.fsf@gitster.siamese.dyndns.org","threadId":"11280","inReplyTo":"Pine.LNX.4.64.0712171649420.9446@racer.site","subject":"Re: [PATCH] rebase -p -i: handle \"no changes\" gracefully","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-12-17T20:23:24Z","receivedAt":"2007-12-17T20:23:24Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> Since commit 376ccb8cbb453343998e734d8a1ce79f57a4e092, unchanged\n> SHA-1s are no longer mapped via $REWRITTEN.  But the updating\n> phase was not prepared for the old head not being rewritten.\n>\n> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n> ---\n>\n> \tOn Mon, 17 Dec 2007, Pieter de Bie wrote:\n>\n> \t> Ok, but what about the error in the rebase?\n> \t> \n> \t> On Dec 14, 2007, at 2:21 AM, Pieter de Bie wrote:\n> \t> > Tirana:~/git pieter$ time git rebase -p -i HEAD~100\n> \t> > cat:\n> \t> > /Users/pieter/git/.git/.dotest-merge/rewritten/1e8df762b38e01685f3aa3613e2d61f73346fcbe:\n> \t> > No such file or directory\n>\n> \tThis buglet was not caught earlier, probably because a \n> \tnon-rewriting rebase is not really interesting ;-)\n\nHmph, care to add a test to t3404?\n"},{"id":"63481","messageId":"Pine.LNX.4.64.0712172100450.9446@racer.site","threadId":"11280","inReplyTo":"7vprx56pfn.fsf@gitster.siamese.dyndns.org","subject":"[PATCH w/ test] rebase -p -i: handle \"no changes\" gracefully","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-12-17T21:01:25Z","receivedAt":"2007-12-17T21:01:25Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"\nSince commit 376ccb8cbb453343998e734d8a1ce79f57a4e092, unchanged\nSHA-1s are no longer mapped via $REWRITTEN.  But the updating\nphase was not prepared for the old head not being rewritten.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n\n\tOn Mon, 17 Dec 2007, Junio C Hamano wrote:\n\n\t> Hmph, care to add a test to t3404?\n\n\tHow about this?\n\n git-rebase--interactive.sh    |    7 ++++++-\n t/t3404-rebase-interactive.sh |    6 ++++++\n 2 files changed, 12 insertions(+), 1 deletions(-)\n\ndiff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh\nindex f83e00f..cd7e43f 100755\n--- a/git-rebase--interactive.sh\n+++ b/git-rebase--interactive.sh\n@@ -322,7 +322,12 @@ do_next () {\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\tNEWHEAD=$(cat \"$REWRITTEN\"/$OLDHEAD)\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 &&\ndiff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh\nindex 907c7f9..74a7eb3 100755\n--- a/t/t3404-rebase-interactive.sh\n+++ b/t/t3404-rebase-interactive.sh\n@@ -184,6 +184,12 @@ test_expect_success 'retain authorship when squashing' '\n \tgit show HEAD | grep \"^Author: Twerp Snog\"\n '\n \n+test_expect_success '-p handles \"no changes\" gracefully' '\n+\tHEAD=$(git rev-parse HEAD) &&\n+\tgit rebase -i -p HEAD^ &&\n+\ttest $HEAD = $(git rev-parse HEAD)\n+'\n+\n test_expect_success 'preserve merges with -p' '\n \tgit checkout -b to-be-preserved master^ &&\n \t: > unrelated-file &&\n-- \n1.5.4.rc0.59.g1d10d\n"},{"id":"63664","messageId":"7vabo7zr7x.fsf@gitster.siamese.dyndns.org","threadId":"11280","inReplyTo":"Pine.LNX.4.64.0712172100450.9446@racer.site","subject":"Re: [PATCH w/ test] rebase -p -i: handle \"no changes\" gracefully","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-12-18T20:24:18Z","receivedAt":"2007-12-18T20:24:18Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> Since commit 376ccb8cbb453343998e734d8a1ce79f57a4e092, unchanged\n> SHA-1s are no longer mapped via $REWRITTEN.  But the updating\n> phase was not prepared for the old head not being rewritten.\n>\n> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n> ---\n>\n> \tOn Mon, 17 Dec 2007, Junio C Hamano wrote:\n>\n> \t> Hmph, care to add a test to t3404?\n>\n> \tHow about this?\n\nLooks good.  Thanks.\n"}]}