{"thread":{"id":"14424","subject":"[PATCH] t3404: Let \"preserve merges with -p\" check two cases","startedAt":"2008-07-12T15:47:31Z","lastAt":"2008-07-12T15:47:31Z","messageCount":1,"participants":["Stephan Beyer"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"83086","messageId":"1215877651-17008-1-git-send-email-s-beyer@gmx.net","threadId":"14424","inReplyTo":null,"subject":"[PATCH] t3404: Let \"preserve merges with -p\" check two cases","fromName":"Stephan Beyer","fromEmail":"s-beyer@gmx.net","sentAt":"2008-07-12T15:47:31Z","receivedAt":"2008-07-12T15:47:31Z","isPatch":true,"sender":{"key":"s-beyer@gmx.net","avatar":"https://avatars.githubusercontent.com/u/143889?v=4"},"body":"There are two cases for preserving merges:\n1. The merge base is outside the trunk that is to be rebased.\n   Then commits of those other parents must not be picked.\n2. The merge base is inside the trunk that is to be rebased.\n   Then all the commits related to that merge must be picked\n   and the merge must be redone.\n\nThe \"preserve merges with -p\" test case tested for case 1 only.\nThis patch adds case 2.\n\nSigned-off-by: Stephan Beyer <s-beyer@gmx.net>\n---\n t/t3404-rebase-interactive.sh |   26 +++++++++++++++++++++-----\n 1 files changed, 21 insertions(+), 5 deletions(-)\n\ndiff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh\nindex 1c80148..092aa26 100755\n--- a/t/t3404-rebase-interactive.sh\n+++ b/t/t3404-rebase-interactive.sh\n@@ -211,7 +211,7 @@ test_expect_success 'preserve merges with -p' '\n \tgit add unrelated-file &&\n \ttest_tick &&\n \tgit commit -m \"unrelated\" &&\n-\tgit checkout -b to-be-rebased master &&\n+\tgit checkout -b another-branch master &&\n \techo B > file1 &&\n \ttest_tick &&\n \tgit commit -m J file1 &&\n@@ -220,12 +220,28 @@ test_expect_success 'preserve merges with -p' '\n \techo C > file1 &&\n \ttest_tick &&\n \tgit commit -m K file1 &&\n+\techo D > file1 &&\n+\ttest_tick &&\n+\tgit commit -m L1 file1 &&\n+\tgit checkout HEAD^ &&\n+\techo 1 > unrelated-file &&\n+\ttest_tick &&\n+\tgit commit -m L2 unrelated-file &&\n+\ttest_tick &&\n+\tgit merge another-branch &&\n+\techo E > file1 &&\n+\ttest_tick &&\n+\tgit commit -m M file1 &&\n+\tgit checkout -b to-be-rebased &&\n \ttest_tick &&\n \tgit rebase -i -p --onto branch1 master &&\n-\ttest $(git rev-parse HEAD^^2) = $(git rev-parse to-be-preserved) &&\n-\ttest $(git rev-parse HEAD~3) = $(git rev-parse branch1) &&\n-\ttest $(git show HEAD:file1) = C &&\n-\ttest $(git show HEAD~2:file1) = B\n+\ttest $(git rev-parse HEAD~6) = $(git rev-parse branch1) &&\n+\ttest $(git rev-parse HEAD~4^2) = $(git rev-parse to-be-preserved) &&\n+\ttest $(git rev-parse HEAD^^2^) = $(git rev-parse HEAD^^^) &&\n+\ttest $(git show HEAD~5:file1) = B &&\n+\ttest $(git show HEAD~3:file1) = C &&\n+\ttest $(git show HEAD:file1) = E &&\n+\ttest $(git show HEAD:unrelated-file) = 1\n '\n \n test_expect_success '--continue tries to commit' '\n-- \n1.5.6.2.303.g79662\n"}]}