{"thread":{"id":"23215","subject":"[Bug?] rebase-i marking the last entry for edit gives a barf?","startedAt":"2010-03-28T17:39:07Z","lastAt":"2010-03-28T19:36:00Z","messageCount":3,"participants":["Junio C Hamano","Sverre Rabbelier","Thomas Rast"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"138022","messageId":"7vd3yo2vno.fsf@alter.siamese.dyndns.org","threadId":"23215","inReplyTo":null,"subject":"[Bug?] rebase-i marking the last entry for edit gives a barf?","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-03-28T17:39:07Z","receivedAt":"2010-03-28T17:39:07Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"I am getting this:\n\n/home/junio/g/Debian-5.0.4-x86_64/git-next/libexec/git-core/git-rebase--interactive: line 565: /git/.git/rebase-merge/rewritten-list: No such file or directory\nSuccessfully rebased and updated refs/heads/nd/setup.\n\nThis was after marking both commits in a two-patch series for \"edit\" in\nrebase -i, running \"commit --amend; rebase --continue; commit --amend\";\nsaying \"rebase --continue\" at this point gave this error.\n"},{"id":"138031","messageId":"fabb9a1e1003281114r3253cd0eg67a917fb67331af9@mail.gmail.com","threadId":"23215","inReplyTo":"7vd3yo2vno.fsf@alter.siamese.dyndns.org","subject":"Re: [Bug?] rebase-i marking the last entry for edit gives a barf?","fromName":"Sverre Rabbelier","fromEmail":"srabbelier@gmail.com","sentAt":"2010-03-28T18:14:54Z","receivedAt":"2010-03-28T18:14:54Z","isPatch":false,"sender":{"key":"srabbelier@gmail.com","avatar":"https://avatars.githubusercontent.com/u/3098?v=4"},"body":"Heya,\n\nOn Sun, Mar 28, 2010 at 11:39, Junio C Hamano <gitster@pobox.com> wrote:\n> This was after marking both commits in a two-patch series for \"edit\" in\n> rebase -i, running \"commit --amend; rebase --continue; commit --amend\";\n> saying \"rebase --continue\" at this point gave this error.\n\nI noticed the same as well, so it's not just you :).\n\n-- \nCheers,\n\nSverre Rabbelier\n"},{"id":"138034","messageId":"7f2e78b2d598b811c028be438780cb9908aa516e.1269803338.git.trast@student.ethz.ch","threadId":"23215","inReplyTo":"7vd3yo2vno.fsf@alter.siamese.dyndns.org","subject":"[PATCH] rebase -i: make post-rewrite work for 'edit'","fromName":"Thomas Rast","fromEmail":"trast@student.ethz.ch","sentAt":"2010-03-28T19:36:00Z","receivedAt":"2010-03-28T19:36:00Z","isPatch":true,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"The post-rewrite support, in the form of the call to\n'record_in_rewritten', was hidden in the arm where we have to record a\nnew commit for the user.  This meant that it was never invoked in the\ncase where the user has already amended the commit by herself.\n\n[The test is designed to exercise both arms of the 'if' in question.]\n\nFurthermore, recording the stopped-sha (the SHA1 of the commit before\nthe editing) suffered from a cut&paste error from die_with_patch and\nused the wrong variable, hence it never recorded anything.\n\nNoticed by Junio.\n\nSigned-off-by: Thomas Rast <trast@student.ethz.ch>\n---\n\nJunio C Hamano wrote:\n> I am getting this:\n> \n> /home/junio/g/Debian-5.0.4-x86_64/git-next/libexec/git-core/git-rebase--interactive: line 565: /git/.git/rebase-merge/rewritten-list: No such file or directory\n> Successfully rebased and updated refs/heads/nd/setup.\n> \n> This was after marking both commits in a two-patch series for \"edit\" in\n> rebase -i, running \"commit --amend; rebase --continue; commit --amend\";\n> saying \"rebase --continue\" at this point gave this error.\n\nNo need for question marks, this is not only a bug but also squarely\nin the wtf-was-I-smoking department ;-)\n\nI changed the test slightly from what you describe, to make it go\nthrough both code paths (as indicated in the bracketed remark).\n\n\n git-rebase--interactive.sh   |    5 +++--\n t/t5407-post-rewrite-hook.sh |   16 ++++++++++++++++\n 2 files changed, 19 insertions(+), 2 deletions(-)\n\ndiff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh\nindex a57f043..1d116bf 100755\n--- a/git-rebase--interactive.sh\n+++ b/git-rebase--interactive.sh\n@@ -475,7 +475,7 @@ do_next () {\n \t\tmark_action_done\n \t\tpick_one $sha1 ||\n \t\t\tdie_with_patch $sha1 \"Could not apply $sha1... $rest\"\n-\t\techo \"$1\" > \"$DOTEST\"/stopped-sha\n+\t\techo \"$sha1\" > \"$DOTEST\"/stopped-sha\n \t\tmake_patch $sha1\n \t\tgit rev-parse --verify HEAD > \"$AMEND\"\n \t\twarn \"Stopped at $sha1... $rest\"\n@@ -723,9 +723,10 @@ first and then run 'git rebase --continue' again.\"\n \t\t\t\ttest -n \"$amend\" && git reset --soft $amend\n \t\t\t\tdie \"Could not commit staged changes.\"\n \t\t\t}\n-\t\t\trecord_in_rewritten \"$(cat \"$DOTEST\"/stopped-sha)\"\n \t\tfi\n \n+\t\trecord_in_rewritten \"$(cat \"$DOTEST\"/stopped-sha)\"\n+\n \t\trequire_clean_work_tree\n \t\tdo_rest\n \t\t;;\ndiff --git a/t/t5407-post-rewrite-hook.sh b/t/t5407-post-rewrite-hook.sh\nindex f0f91f1..552da65 100755\n--- a/t/t5407-post-rewrite-hook.sh\n+++ b/t/t5407-post-rewrite-hook.sh\n@@ -180,4 +180,20 @@ EOF\n \tverify_hook_input\n '\n \n+test_expect_success 'git rebase -i (double edit)' '\n+\tgit reset --hard D &&\n+\tclear_hook_input &&\n+\tFAKE_LINES=\"edit 1 edit 2\" git rebase -i B &&\n+\tgit rebase --continue &&\n+\techo something > foo &&\n+\tgit add foo &&\n+\tgit rebase --continue &&\n+\techo rebase >expected.args &&\n+\tcat >expected.data <<EOF &&\n+$(git rev-parse C) $(git rev-parse HEAD^)\n+$(git rev-parse D) $(git rev-parse HEAD)\n+EOF\n+\tverify_hook_input\n+'\n+\n test_done\n-- \n1.7.0.3.461.ga69fc\n"}]}