(CommandList children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:test_description) op: Equal rhs: {(SQ <"test cherry-picking many commits">)} spids: [4] ) ] spids: [4] ) (C {(.)} {(./test-lib.sh)}) (FuncDef name: check_head_differs_from body: (BraceGroup children: [ (Pipeline children: [(C {(test_cmp_rev)} {(HEAD)} {(DQ ($ VSub_Number "$1"))})] negated: True ) ] spids: [19] ) spids: [15 18] ) (FuncDef name: check_head_equals body: (BraceGroup children: [(C {(test_cmp_rev)} {(HEAD)} {(DQ ($ VSub_Number "$1"))})] spids: [39] ) spids: [35 38] ) (C {(test_expect_success)} {(setup)} { (SQ <"\n"> <"\techo first > file1 &&\n"> <"\tgit add file1 &&\n"> <"\ttest_tick &&\n"> <"\tgit commit -m \"first\" &&\n"> <"\tgit tag first &&\n"> <"\n"> <"\tgit checkout -b other &&\n"> <"\tfor val in second third fourth\n"> <"\tdo\n"> <"\t\techo $val >> file1 &&\n"> <"\t\tgit add file1 &&\n"> <"\t\ttest_tick &&\n"> <"\t\tgit commit -m \"$val\" &&\n"> <"\t\tgit tag $val\n"> <"\tdone\n"> ) } ) (C {(test_expect_success)} {(SQ <"cherry-pick first..fourth works">)} { (SQ <"\n"> <"\tgit checkout -f master &&\n"> <"\tgit reset --hard first &&\n"> <"\ttest_tick &&\n"> <"\tgit cherry-pick first..fourth &&\n"> <"\tgit diff --quiet other &&\n"> <"\tgit diff --quiet HEAD other &&\n"> <"\tcheck_head_differs_from fourth\n"> ) } ) (C {(test_expect_success)} {(SQ <"cherry-pick three one two works">)} { (SQ <"\n"> <"\tgit checkout -f first &&\n"> <"\ttest_commit one &&\n"> <"\ttest_commit two &&\n"> <"\ttest_commit three &&\n"> <"\tgit checkout -f master &&\n"> <"\tgit reset --hard first &&\n"> <"\tgit cherry-pick three one two &&\n"> <"\tgit diff --quiet three &&\n"> <"\tgit diff --quiet HEAD three &&\n"> <"\ttest \"$(git log --reverse --format=%s first..)\" = \"three\n"> <"one\n"> <"two\"\n"> ) } ) (C {(test_expect_success)} {(SQ <"cherry-pick three one two: fails">)} { (SQ <"\n"> <"\tgit checkout -f master &&\n"> <"\tgit reset --hard first &&\n"> <"\ttest_must_fail git cherry-pick three one two:\n"> ) } ) (C {(test_expect_success)} {(SQ <"output to keep user entertained during multi-pick">)} { (SQ <"\n"> <"\tcat <<-\\EOF >expected &&\n"> <"\t[master OBJID] second\n"> <"\t Author: A U Thor <author@example.com>\n"> <"\t Date: Thu Apr 7 15:14:13 2005 -0700\n"> <"\t 1 file changed, 1 insertion(+)\n"> <"\t[master OBJID] third\n"> <"\t Author: A U Thor <author@example.com>\n"> <"\t Date: Thu Apr 7 15:15:13 2005 -0700\n"> <"\t 1 file changed, 1 insertion(+)\n"> <"\t[master OBJID] fourth\n"> <"\t Author: A U Thor <author@example.com>\n"> <"\t Date: Thu Apr 7 15:16:13 2005 -0700\n"> <"\t 1 file changed, 1 insertion(+)\n"> <"\tEOF\n"> <"\n"> <"\tgit checkout -f master &&\n"> <"\tgit reset --hard first &&\n"> <"\ttest_tick &&\n"> <"\tgit cherry-pick first..fourth >actual &&\n"> <"\tsed -e \"s/$_x05[0-9a-f][0-9a-f]/OBJID/\" <actual >actual.fuzzy &&\n"> <"\ttest_line_count -ge 3 actual.fuzzy &&\n"> <"\ttest_i18ncmp expected actual.fuzzy\n"> ) } ) (C {(test_expect_success)} {(SQ <"cherry-pick --strategy resolve first..fourth works">)} { (SQ <"\n"> <"\tgit checkout -f master &&\n"> <"\tgit reset --hard first &&\n"> <"\ttest_tick &&\n"> <"\tgit cherry-pick --strategy resolve first..fourth &&\n"> <"\tgit diff --quiet other &&\n"> <"\tgit diff --quiet HEAD other &&\n"> <"\tcheck_head_differs_from fourth\n"> ) } ) (C {(test_expect_success)} {(SQ <"output during multi-pick indicates merge strategy">)} { (SQ <"\n"> <"\tcat <<-\\EOF >expected &&\n"> <"\tTrying simple merge.\n"> <"\t[master OBJID] second\n"> <"\t Author: A U Thor <author@example.com>\n"> <"\t Date: Thu Apr 7 15:14:13 2005 -0700\n"> <"\t 1 file changed, 1 insertion(+)\n"> <"\tTrying simple merge.\n"> <"\t[master OBJID] third\n"> <"\t Author: A U Thor <author@example.com>\n"> <"\t Date: Thu Apr 7 15:15:13 2005 -0700\n"> <"\t 1 file changed, 1 insertion(+)\n"> <"\tTrying simple merge.\n"> <"\t[master OBJID] fourth\n"> <"\t Author: A U Thor <author@example.com>\n"> <"\t Date: Thu Apr 7 15:16:13 2005 -0700\n"> <"\t 1 file changed, 1 insertion(+)\n"> <"\tEOF\n"> <"\n"> <"\tgit checkout -f master &&\n"> <"\tgit reset --hard first &&\n"> <"\ttest_tick &&\n"> <"\tgit cherry-pick --strategy resolve first..fourth >actual &&\n"> <"\tsed -e \"s/$_x05[0-9a-f][0-9a-f]/OBJID/\" <actual >actual.fuzzy &&\n"> <"\ttest_i18ncmp expected actual.fuzzy\n"> ) } ) (C {(test_expect_success)} {(SQ <"cherry-pick --ff first..fourth works">)} { (SQ <"\n"> <"\tgit checkout -f master &&\n"> <"\tgit reset --hard first &&\n"> <"\ttest_tick &&\n"> <"\tgit cherry-pick --ff first..fourth &&\n"> <"\tgit diff --quiet other &&\n"> <"\tgit diff --quiet HEAD other &&\n"> <"\tcheck_head_equals fourth\n"> ) } ) (C {(test_expect_success)} {(SQ <"cherry-pick -n first..fourth works">)} { (SQ <"\n"> <"\tgit checkout -f master &&\n"> <"\tgit reset --hard first &&\n"> <"\ttest_tick &&\n"> <"\tgit cherry-pick -n first..fourth &&\n"> <"\tgit diff --quiet other &&\n"> <"\tgit diff --cached --quiet other &&\n"> <"\tgit diff --quiet HEAD first\n"> ) } ) (C {(test_expect_success)} {(SQ <"revert first..fourth works">)} { (SQ <"\n"> <"\tgit checkout -f master &&\n"> <"\tgit reset --hard fourth &&\n"> <"\ttest_tick &&\n"> <"\tgit revert first..fourth &&\n"> <"\tgit diff --quiet first &&\n"> <"\tgit diff --cached --quiet first &&\n"> <"\tgit diff --quiet HEAD first\n"> ) } ) (C {(test_expect_success)} {(SQ <"revert ^first fourth works">)} { (SQ <"\n"> <"\tgit checkout -f master &&\n"> <"\tgit reset --hard fourth &&\n"> <"\ttest_tick &&\n"> <"\tgit revert ^first fourth &&\n"> <"\tgit diff --quiet first &&\n"> <"\tgit diff --cached --quiet first &&\n"> <"\tgit diff --quiet HEAD first\n"> ) } ) (C {(test_expect_success)} {(SQ <"revert fourth fourth~1 fourth~2 works">)} { (SQ <"\n"> <"\tgit checkout -f master &&\n"> <"\tgit reset --hard fourth &&\n"> <"\ttest_tick &&\n"> <"\tgit revert fourth fourth~1 fourth~2 &&\n"> <"\tgit diff --quiet first &&\n"> <"\tgit diff --cached --quiet first &&\n"> <"\tgit diff --quiet HEAD first\n"> ) } ) (C {(test_expect_success)} {(SQ <"cherry-pick -3 fourth works">)} { (SQ <"\n"> <"\tgit checkout -f master &&\n"> <"\tgit reset --hard first &&\n"> <"\ttest_tick &&\n"> <"\tgit cherry-pick -3 fourth &&\n"> <"\tgit diff --quiet other &&\n"> <"\tgit diff --quiet HEAD other &&\n"> <"\tcheck_head_differs_from fourth\n"> ) } ) (C {(test_expect_success)} {(SQ <"cherry-pick --stdin works">)} { (SQ <"\n"> <"\tgit checkout -f master &&\n"> <"\tgit reset --hard first &&\n"> <"\ttest_tick &&\n"> <"\tgit rev-list --reverse first..fourth | git cherry-pick --stdin &&\n"> <"\tgit diff --quiet other &&\n"> <"\tgit diff --quiet HEAD other &&\n"> <"\tcheck_head_differs_from fourth\n"> ) } ) (C {(test_done)}) ] )