{"thread":{"id":"25313","subject":"[PATCH 2/2] rebase-autosquash: add testcase for fixup occuring before its fixed commit.","startedAt":"2010-10-01T21:19:18Z","lastAt":"2010-10-01T21:19:20Z","messageCount":3,"participants":["Yann Dirson"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"152268","messageId":"1285967960-17691-1-git-send-email-ydirson@altern.org","threadId":"25313","inReplyTo":null,"subject":"[PATCH 0/2] Testcase for a rebase-autosquash bug","fromName":"Yann Dirson","fromEmail":"ydirson@altern.org","sentAt":"2010-10-01T21:19:18Z","receivedAt":"2010-10-01T21:19:18Z","isPatch":true,"sender":{"key":"ydirson@altern.org","avatar":"https://avatars.githubusercontent.com/u/1190950?v=4"},"body":"While using --autosquash with a \"fixup\" commit intended to fixup one\nof its descendants, I noticed it just did not work, so here is a\ntestcase for the failure.\n\nWhile I was at it, it looked to me like a couple of \"&&\" were missing.\nWe surely want commit failures to fail at those places - although\nfailures there would probably induce failures later on which would be\ndetected, it is always better to fail early.\n\nYann Dirson (2):\n  t/t3415: use && where applicable.\n  rebase-autosquash: add testcase for fixup occuring before its fixed\n    commit.\n\n t/t3415-rebase-autosquash.sh |   31 ++++++++++++++++++++++++++++---\n 1 files changed, 28 insertions(+), 3 deletions(-)\n\n-- \n1.7.2.3\n"},{"id":"152267","messageId":"1285967960-17691-2-git-send-email-ydirson@altern.org","threadId":"25313","inReplyTo":"1285967960-17691-1-git-send-email-ydirson@altern.org","subject":"[PATCH 1/2] t/t3415: use && where applicable.","fromName":"Yann Dirson","fromEmail":"ydirson@altern.org","sentAt":"2010-10-01T21:19:19Z","receivedAt":"2010-10-01T21:19:19Z","isPatch":true,"sender":{"key":"ydirson@altern.org","avatar":"https://avatars.githubusercontent.com/u/1190950?v=4"},"body":"Signed-off-by: Yann Dirson <ydirson@altern.org>\n---\n t/t3415-rebase-autosquash.sh |    6 +++---\n 1 files changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/t/t3415-rebase-autosquash.sh b/t/t3415-rebase-autosquash.sh\nindex 37cb89a..fd2184c 100755\n--- a/t/t3415-rebase-autosquash.sh\n+++ b/t/t3415-rebase-autosquash.sh\n@@ -26,7 +26,7 @@ test_auto_fixup() {\n \techo 1 >file1 &&\n \tgit add -u &&\n \ttest_tick &&\n-\tgit commit -m \"fixup! first\"\n+\tgit commit -m \"fixup! first\" &&\n \n \tgit tag $1 &&\n \ttest_tick &&\n@@ -55,7 +55,7 @@ test_auto_squash() {\n \techo 1 >file1 &&\n \tgit add -u &&\n \ttest_tick &&\n-\tgit commit -m \"squash! first\"\n+\tgit commit -m \"squash! first\" &&\n \n \tgit tag $1 &&\n \ttest_tick &&\n@@ -84,7 +84,7 @@ test_expect_success 'misspelled auto squash' '\n \techo 1 >file1 &&\n \tgit add -u &&\n \ttest_tick &&\n-\tgit commit -m \"squash! forst\"\n+\tgit commit -m \"squash! forst\" &&\n \tgit tag final-missquash &&\n \ttest_tick &&\n \tgit rebase --autosquash -i HEAD^^^ &&\n-- \n1.7.2.3\n"},{"id":"152266","messageId":"1285967960-17691-3-git-send-email-ydirson@altern.org","threadId":"25313","inReplyTo":"1285967960-17691-2-git-send-email-ydirson@altern.org","subject":"[PATCH 2/2] rebase-autosquash: add testcase for fixup occuring before its fixed commit.","fromName":"Yann Dirson","fromEmail":"ydirson@altern.org","sentAt":"2010-10-01T21:19:20Z","receivedAt":"2010-10-01T21:19:20Z","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"}]}