(command.CommandList children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:test_description) op: assign_op.Equal rhs: {(SQ (Token id:Id.Lit_Chars val:'test cherry-picking many commits' span_id:6))} spids: [4] ) ] ) (C {(.)} {(./test-lib.sh)}) (command.ShFunction name: check_head_differs_from body: (command.BraceGroup children: [ (command.Pipeline children: [(C {(test_cmp_rev)} {(HEAD)} {(DQ ($ Id.VSub_Number '$1'))})] negated: T ) ] ) ) (command.ShFunction name: check_head_equals body: (command.BraceGroup children: [(C {(test_cmp_rev)} {(HEAD)} {(DQ ($ Id.VSub_Number '$1'))})] ) ) (C {(test_expect_success)} {(setup)} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:58) (Token id:Id.Lit_Chars val:'\techo first > file1 &&\n' span_id:59) (Token id:Id.Lit_Chars val:'\tgit add file1 &&\n' span_id:60) (Token id:Id.Lit_Chars val:'\ttest_tick &&\n' span_id:61) (Token id:Id.Lit_Chars val:'\tgit commit -m "first" &&\n' span_id:62) (Token id:Id.Lit_Chars val:'\tgit tag first &&\n' span_id:63) (Token id:Id.Lit_Chars val:'\n' span_id:64) (Token id:Id.Lit_Chars val:'\tgit checkout -b other &&\n' span_id:65) (Token id:Id.Lit_Chars val:'\tfor val in second third fourth\n' span_id:66) (Token id:Id.Lit_Chars val:'\tdo\n' span_id:67) (Token id:Id.Lit_Chars val:'\t\techo $val >> file1 &&\n' span_id:68) (Token id:Id.Lit_Chars val:'\t\tgit add file1 &&\n' span_id:69) (Token id:Id.Lit_Chars val:'\t\ttest_tick &&\n' span_id:70) (Token id:Id.Lit_Chars val:'\t\tgit commit -m "$val" &&\n' span_id:71) (Token id:Id.Lit_Chars val:'\t\tgit tag $val\n' span_id:72) (Token id:Id.Lit_Chars val:'\tdone\n' span_id:73) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'cherry-pick first..fourth works' span_id:80))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:84) (Token id:Id.Lit_Chars val:'\tgit checkout -f master &&\n' span_id:85) (Token id:Id.Lit_Chars val:'\tgit reset --hard first &&\n' span_id:86) (Token id:Id.Lit_Chars val:'\ttest_tick &&\n' span_id:87) (Token id:Id.Lit_Chars val:'\tgit cherry-pick first..fourth &&\n' span_id:88) (Token id:Id.Lit_Chars val:'\tgit diff --quiet other &&\n' span_id:89) (Token id:Id.Lit_Chars val:'\tgit diff --quiet HEAD other &&\n' span_id:90) (Token id:Id.Lit_Chars val:'\tcheck_head_differs_from fourth\n' span_id:91) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'cherry-pick three one two works' span_id:98))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:102) (Token id:Id.Lit_Chars val:'\tgit checkout -f first &&\n' span_id:103) (Token id:Id.Lit_Chars val:'\ttest_commit one &&\n' span_id:104) (Token id:Id.Lit_Chars val:'\ttest_commit two &&\n' span_id:105) (Token id:Id.Lit_Chars val:'\ttest_commit three &&\n' span_id:106) (Token id:Id.Lit_Chars val:'\tgit checkout -f master &&\n' span_id:107) (Token id:Id.Lit_Chars val:'\tgit reset --hard first &&\n' span_id:108) (Token id:Id.Lit_Chars val:'\tgit cherry-pick three one two &&\n' span_id:109) (Token id:Id.Lit_Chars val:'\tgit diff --quiet three &&\n' span_id:110) (Token id:Id.Lit_Chars val:'\tgit diff --quiet HEAD three &&\n' span_id:111) (Token id: Id.Lit_Chars val: '\ttest "$(git log --reverse --format=%s first..)" = "three\n' span_id: 112 ) (Token id:Id.Lit_Chars val:'one\n' span_id:113) (Token id:Id.Lit_Chars val:'two"\n' span_id:114) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'cherry-pick three one two: fails' span_id:121))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:125) (Token id:Id.Lit_Chars val:'\tgit checkout -f master &&\n' span_id:126) (Token id:Id.Lit_Chars val:'\tgit reset --hard first &&\n' span_id:127) (Token id: Id.Lit_Chars val: '\ttest_must_fail git cherry-pick three one two:\n' span_id: 128 ) ) } ) (C {(test_expect_success)} { (SQ (Token id: Id.Lit_Chars val: 'output to keep user entertained during multi-pick' span_id: 135 ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:139) (Token id:Id.Lit_Chars val:'\tcat <<-\\EOF >expected &&\n' span_id:140) (Token id:Id.Lit_Chars val:'\t[master OBJID] second\n' span_id:141) (Token id: Id.Lit_Chars val: '\t Author: A U Thor <author@example.com>\n' span_id: 142 ) (Token id:Id.Lit_Chars val:'\t Date: Thu Apr 7 15:14:13 2005 -0700\n' span_id:143) (Token id:Id.Lit_Chars val:'\t 1 file changed, 1 insertion(+)\n' span_id:144) (Token id:Id.Lit_Chars val:'\t[master OBJID] third\n' span_id:145) (Token id: Id.Lit_Chars val: '\t Author: A U Thor <author@example.com>\n' span_id: 146 ) (Token id:Id.Lit_Chars val:'\t Date: Thu Apr 7 15:15:13 2005 -0700\n' span_id:147) (Token id:Id.Lit_Chars val:'\t 1 file changed, 1 insertion(+)\n' span_id:148) (Token id:Id.Lit_Chars val:'\t[master OBJID] fourth\n' span_id:149) (Token id: Id.Lit_Chars val: '\t Author: A U Thor <author@example.com>\n' span_id: 150 ) (Token id:Id.Lit_Chars val:'\t Date: Thu Apr 7 15:16:13 2005 -0700\n' span_id:151) (Token id:Id.Lit_Chars val:'\t 1 file changed, 1 insertion(+)\n' span_id:152) (Token id:Id.Lit_Chars val:'\tEOF\n' span_id:153) (Token id:Id.Lit_Chars val:'\n' span_id:154) (Token id:Id.Lit_Chars val:'\tgit checkout -f master &&\n' span_id:155) (Token id:Id.Lit_Chars val:'\tgit reset --hard first &&\n' span_id:156) (Token id:Id.Lit_Chars val:'\ttest_tick &&\n' span_id:157) (Token id:Id.Lit_Chars val:'\tgit cherry-pick first..fourth >actual &&\n' span_id:158) (Token id: Id.Lit_Chars val: '\tsed -e "s/$_x05[0-9a-f][0-9a-f]/OBJID/" <actual >actual.fuzzy &&\n' span_id: 159 ) (Token id:Id.Lit_Chars val:'\ttest_line_count -ge 3 actual.fuzzy &&\n' span_id:160) (Token id:Id.Lit_Chars val:'\ttest_i18ncmp expected actual.fuzzy\n' span_id:161) ) } ) (C {(test_expect_success)} { (SQ (Token id: Id.Lit_Chars val: 'cherry-pick --strategy resolve first..fourth works' span_id: 168 ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:172) (Token id:Id.Lit_Chars val:'\tgit checkout -f master &&\n' span_id:173) (Token id:Id.Lit_Chars val:'\tgit reset --hard first &&\n' span_id:174) (Token id:Id.Lit_Chars val:'\ttest_tick &&\n' span_id:175) (Token id:Id.Lit_Chars val:'\tgit cherry-pick --strategy resolve first..fourth &&\n' span_id:176) (Token id:Id.Lit_Chars val:'\tgit diff --quiet other &&\n' span_id:177) (Token id:Id.Lit_Chars val:'\tgit diff --quiet HEAD other &&\n' span_id:178) (Token id:Id.Lit_Chars val:'\tcheck_head_differs_from fourth\n' span_id:179) ) } ) (C {(test_expect_success)} { (SQ (Token id: Id.Lit_Chars val: 'output during multi-pick indicates merge strategy' span_id: 186 ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:190) (Token id:Id.Lit_Chars val:'\tcat <<-\\EOF >expected &&\n' span_id:191) (Token id:Id.Lit_Chars val:'\tTrying simple merge.\n' span_id:192) (Token id:Id.Lit_Chars val:'\t[master OBJID] second\n' span_id:193) (Token id:Id.Lit_Chars val:'\t Author: A U Thor <author@example.com>\n' span_id:194) (Token id: Id.Lit_Chars val: '\t Date: Thu Apr 7 15:14:13 2005 -0700\n' span_id: 195 ) (Token id:Id.Lit_Chars val:'\t 1 file changed, 1 insertion(+)\n' span_id:196) (Token id:Id.Lit_Chars val:'\tTrying simple merge.\n' span_id:197) (Token id:Id.Lit_Chars val:'\t[master OBJID] third\n' span_id:198) (Token id: Id.Lit_Chars val: '\t Author: A U Thor <author@example.com>\n' span_id: 199 ) (Token id:Id.Lit_Chars val:'\t Date: Thu Apr 7 15:15:13 2005 -0700\n' span_id:200) (Token id:Id.Lit_Chars val:'\t 1 file changed, 1 insertion(+)\n' span_id:201) (Token id:Id.Lit_Chars val:'\tTrying simple merge.\n' span_id:202) (Token id:Id.Lit_Chars val:'\t[master OBJID] fourth\n' span_id:203) (Token id:Id.Lit_Chars val:'\t Author: A U Thor <author@example.com>\n' span_id:204) (Token id: Id.Lit_Chars val: '\t Date: Thu Apr 7 15:16:13 2005 -0700\n' span_id: 205 ) (Token id:Id.Lit_Chars val:'\t 1 file changed, 1 insertion(+)\n' span_id:206) (Token id:Id.Lit_Chars val:'\tEOF\n' span_id:207) (Token id:Id.Lit_Chars val:'\n' span_id:208) (Token id:Id.Lit_Chars val:'\tgit checkout -f master &&\n' span_id:209) (Token id:Id.Lit_Chars val:'\tgit reset --hard first &&\n' span_id:210) (Token id:Id.Lit_Chars val:'\ttest_tick &&\n' span_id:211) (Token id: Id.Lit_Chars val: '\tgit cherry-pick --strategy resolve first..fourth >actual &&\n' span_id: 212 ) (Token id: Id.Lit_Chars val: '\tsed -e "s/$_x05[0-9a-f][0-9a-f]/OBJID/" <actual >actual.fuzzy &&\n' span_id: 213 ) (Token id:Id.Lit_Chars val:'\ttest_i18ncmp expected actual.fuzzy\n' span_id:214) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'cherry-pick --ff first..fourth works' span_id:221))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:225) (Token id:Id.Lit_Chars val:'\tgit checkout -f master &&\n' span_id:226) (Token id:Id.Lit_Chars val:'\tgit reset --hard first &&\n' span_id:227) (Token id:Id.Lit_Chars val:'\ttest_tick &&\n' span_id:228) (Token id:Id.Lit_Chars val:'\tgit cherry-pick --ff first..fourth &&\n' span_id:229) (Token id:Id.Lit_Chars val:'\tgit diff --quiet other &&\n' span_id:230) (Token id:Id.Lit_Chars val:'\tgit diff --quiet HEAD other &&\n' span_id:231) (Token id:Id.Lit_Chars val:'\tcheck_head_equals fourth\n' span_id:232) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'cherry-pick -n first..fourth works' span_id:239))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:243) (Token id:Id.Lit_Chars val:'\tgit checkout -f master &&\n' span_id:244) (Token id:Id.Lit_Chars val:'\tgit reset --hard first &&\n' span_id:245) (Token id:Id.Lit_Chars val:'\ttest_tick &&\n' span_id:246) (Token id:Id.Lit_Chars val:'\tgit cherry-pick -n first..fourth &&\n' span_id:247) (Token id:Id.Lit_Chars val:'\tgit diff --quiet other &&\n' span_id:248) (Token id:Id.Lit_Chars val:'\tgit diff --cached --quiet other &&\n' span_id:249) (Token id:Id.Lit_Chars val:'\tgit diff --quiet HEAD first\n' span_id:250) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'revert first..fourth works' span_id:257))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:261) (Token id:Id.Lit_Chars val:'\tgit checkout -f master &&\n' span_id:262) (Token id:Id.Lit_Chars val:'\tgit reset --hard fourth &&\n' span_id:263) (Token id:Id.Lit_Chars val:'\ttest_tick &&\n' span_id:264) (Token id:Id.Lit_Chars val:'\tgit revert first..fourth &&\n' span_id:265) (Token id:Id.Lit_Chars val:'\tgit diff --quiet first &&\n' span_id:266) (Token id:Id.Lit_Chars val:'\tgit diff --cached --quiet first &&\n' span_id:267) (Token id:Id.Lit_Chars val:'\tgit diff --quiet HEAD first\n' span_id:268) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'revert ^first fourth works' span_id:275))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:279) (Token id:Id.Lit_Chars val:'\tgit checkout -f master &&\n' span_id:280) (Token id:Id.Lit_Chars val:'\tgit reset --hard fourth &&\n' span_id:281) (Token id:Id.Lit_Chars val:'\ttest_tick &&\n' span_id:282) (Token id:Id.Lit_Chars val:'\tgit revert ^first fourth &&\n' span_id:283) (Token id:Id.Lit_Chars val:'\tgit diff --quiet first &&\n' span_id:284) (Token id:Id.Lit_Chars val:'\tgit diff --cached --quiet first &&\n' span_id:285) (Token id:Id.Lit_Chars val:'\tgit diff --quiet HEAD first\n' span_id:286) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'revert fourth fourth~1 fourth~2 works' span_id:293))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:297) (Token id:Id.Lit_Chars val:'\tgit checkout -f master &&\n' span_id:298) (Token id:Id.Lit_Chars val:'\tgit reset --hard fourth &&\n' span_id:299) (Token id:Id.Lit_Chars val:'\ttest_tick &&\n' span_id:300) (Token id:Id.Lit_Chars val:'\tgit revert fourth fourth~1 fourth~2 &&\n' span_id:301) (Token id:Id.Lit_Chars val:'\tgit diff --quiet first &&\n' span_id:302) (Token id:Id.Lit_Chars val:'\tgit diff --cached --quiet first &&\n' span_id:303) (Token id:Id.Lit_Chars val:'\tgit diff --quiet HEAD first\n' span_id:304) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'cherry-pick -3 fourth works' span_id:311))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:315) (Token id:Id.Lit_Chars val:'\tgit checkout -f master &&\n' span_id:316) (Token id:Id.Lit_Chars val:'\tgit reset --hard first &&\n' span_id:317) (Token id:Id.Lit_Chars val:'\ttest_tick &&\n' span_id:318) (Token id:Id.Lit_Chars val:'\tgit cherry-pick -3 fourth &&\n' span_id:319) (Token id:Id.Lit_Chars val:'\tgit diff --quiet other &&\n' span_id:320) (Token id:Id.Lit_Chars val:'\tgit diff --quiet HEAD other &&\n' span_id:321) (Token id:Id.Lit_Chars val:'\tcheck_head_differs_from fourth\n' span_id:322) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'cherry-pick --stdin works' span_id:329))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:333) (Token id:Id.Lit_Chars val:'\tgit checkout -f master &&\n' span_id:334) (Token id:Id.Lit_Chars val:'\tgit reset --hard first &&\n' span_id:335) (Token id:Id.Lit_Chars val:'\ttest_tick &&\n' span_id:336) (Token id: Id.Lit_Chars val: '\tgit rev-list --reverse first..fourth | git cherry-pick --stdin &&\n' span_id: 337 ) (Token id:Id.Lit_Chars val:'\tgit diff --quiet other &&\n' span_id:338) (Token id:Id.Lit_Chars val:'\tgit diff --quiet HEAD other &&\n' span_id:339) (Token id:Id.Lit_Chars val:'\tcheck_head_differs_from fourth\n' span_id:340) ) } ) (C {(test_done)}) ] )