{"thread":{"id":"25531","subject":"[PATCH] rebase-autosquash: add testcase for fixup occuring before its fixed commit.","startedAt":"2010-10-23T13:33:33Z","lastAt":"2010-10-23T13:33:33Z","messageCount":1,"participants":["Yann Dirson"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"154239","messageId":"1287840813-6454-1-git-send-email-ydirson@altern.org","threadId":"25531","inReplyTo":null,"subject":"[PATCH] rebase-autosquash: add testcase for fixup occuring before its fixed commit.","fromName":"Yann Dirson","fromEmail":"ydirson@altern.org","sentAt":"2010-10-23T13:33:33Z","receivedAt":"2010-10-23T13:33:33Z","isPatch":true,"sender":{"key":"ydirson@altern.org","avatar":"https://avatars.githubusercontent.com/u/1190950?v=4"},"body":"Can easily occur when one has started splitting a patch in two, and\nsubsequently wants to migrate more contents from the bottom patch to the\ntop one: extracting a fixup using an interactive rebase, committing it\nbetween the two.\n\nCurrently, the generated instructions do add the \"fixup\" directive at the\ncorrect place, but the \"pick\" is also left where it was, making the \"fixup\"\na noop.\n\nSigned-off-by: Yann Dirson <ydirson@altern.org>\n---\n t/t3415-rebase-autosquash.sh |   25 +++++++++++++++++++++++++\n 1 files changed, 25 insertions(+), 0 deletions(-)\n\ndiff --git a/t/t3415-rebase-autosquash.sh b/t/t3415-rebase-autosquash.sh\nindex fd2184c..226394d 100755\n--- a/t/t3415-rebase-autosquash.sh\n+++ b/t/t3415-rebase-autosquash.sh\n@@ -50,6 +50,31 @@ test_expect_success 'auto fixup (config)' '\n \ttest_must_fail test_auto_fixup final-fixup-config-false\n '\n \n+test_auto_fixup_reversed() {\n+\tgit reset --hard base &&\n+\n+\techo 3 >file1 &&\n+\tgit add -u &&\n+\ttest_tick &&\n+\tgit commit -m \"fixup! first\" &&\n+\n+\techo 3 >file2 &&\n+\tgit add -u &&\n+\ttest_tick &&\n+\tgit commit -m \"first\" &&\n+\n+\tgit tag $1 &&\n+\ttest_tick &&\n+\tgit rebase --autosquash -i base &&\n+\tgit log --oneline base..HEAD >actual &&\n+\ttest 1 = $(wc -l <actual) &&\n+\tgit diff --exit-code $1\n+}\n+\n+test_expect_failure 'auto reversed fixup (option)' '\n+\ttest_auto_fixup_reversed final-revfixup-option\n+'\n+\n test_auto_squash() {\n \tgit reset --hard base &&\n \techo 1 >file1 &&\n-- \n1.7.2.3\n"}]}