(command.CommandList children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:test_description spids:[12]) op: Equal rhs: {(SQ <'test git rev-list --cherry-pick -- file'>)} spids: [12] ) ] spids: [12] ) (C {(.)} {(./test-lib.sh)}) (C {(test_expect_success)} {(setup)} { (SQ <'\n'> <'\techo Hallo > foo &&\n'> <'\tgit add foo &&\n'> <'\ttest_tick &&\n'> <'\tgit commit -m "A" &&\n'> <'\tgit tag A &&\n'> <'\tgit checkout -b branch &&\n'> <'\techo Bello > foo &&\n'> <'\techo Cello > bar &&\n'> <'\tgit add foo bar &&\n'> <'\ttest_tick &&\n'> <'\tgit commit -m "C" &&\n'> <'\tgit tag C &&\n'> <'\techo Dello > bar &&\n'> <'\tgit add bar &&\n'> <'\ttest_tick &&\n'> <'\tgit commit -m "E" &&\n'> <'\tgit tag E &&\n'> <'\tgit checkout master &&\n'> <'\tgit checkout branch foo &&\n'> <'\ttest_tick &&\n'> <'\tgit commit -m "B" &&\n'> <'\tgit tag B &&\n'> <'\techo Cello > bar &&\n'> <'\tgit add bar &&\n'> <'\ttest_tick &&\n'> <'\tgit commit -m "D" &&\n'> <'\tgit tag D &&\n'> <'\techo Nello > bar &&\n'> <'\tgit add bar &&\n'> <'\ttest_tick &&\n'> <'\tgit commit -m "F" &&\n'> <'\tgit tag F\n'> ) } ) (command.SimpleCommand words: [{(cat)}] redirects: [ (redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(expect)}) (redir.HereDoc op: <Redir_DLess '<<'> fd: 16777215 here_begin: {(EOF)} here_end_span_id: 100 stdin_parts: [('<tags/B\n') ('>tags/C\n')] ) ] ) (C {(test_expect_success)} {(SQ <--left-right>)} { (SQ <'\n'> <'\tgit rev-list --left-right B...C > actual &&\n'> <'\tgit name-rev --stdin --name-only --refs="*tags/*" \\\n'> <'\t\t< actual > actual.named &&\n'> <'\ttest_cmp actual.named expect\n'> ) } ) (C {(test_expect_success)} {(SQ <--count>)} {(SQ <'\n'> <'\tgit rev-list --count B...C > actual &&\n'> <'\ttest "$(cat actual)" = 2\n'>)} ) (C {(test_expect_success)} {(SQ <'--cherry-pick foo comes up empty'>)} {(SQ <'\n'> <'\ttest -z "$(git rev-list --left-right --cherry-pick B...C -- foo)"\n'>)} ) (command.SimpleCommand words: [{(cat)}] redirects: [ (redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(expect)}) (redir.HereDoc op: <Redir_DLess '<<'> fd: 16777215 here_begin: {(EOF)} here_end_span_id: 152 stdin_parts: [('>tags/C\n')] ) ] ) (C {(test_expect_success)} {(SQ <'--cherry-pick bar does not come up empty'>)} { (SQ <'\n'> <'\tgit rev-list --left-right --cherry-pick B...C -- bar > actual &&\n'> <'\tgit name-rev --stdin --name-only --refs="*tags/*" \\\n'> <'\t\t< actual > actual.named &&\n'> <'\ttest_cmp actual.named expect\n'> ) } ) (C {(test_expect_success)} {(SQ <'bar does not come up empty'>)} { (SQ <'\n'> <'\tgit rev-list --left-right B...C -- bar > actual &&\n'> <'\tgit name-rev --stdin --name-only --refs="*tags/*" \\\n'> <'\t\t< actual > actual.named &&\n'> <'\ttest_cmp actual.named expect\n'> ) } ) (command.SimpleCommand words: [{(cat)}] redirects: [ (redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(expect)}) (redir.HereDoc op: <Redir_DLess '<<'> fd: 16777215 here_begin: {(EOF)} here_end_span_id: 195 stdin_parts: [('<tags/F\n') ('>tags/E\n')] ) ] ) (C {(test_expect_success)} {(SQ <'--cherry-pick bar does not come up empty (II)'>)} { (SQ <'\n'> <'\tgit rev-list --left-right --cherry-pick F...E -- bar > actual &&\n'> <'\tgit name-rev --stdin --name-only --refs="*tags/*" \\\n'> <'\t\t< actual > actual.named &&\n'> <'\ttest_cmp actual.named expect\n'> ) } ) (command.SimpleCommand words: [{(cat)}] redirects: [ (redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(expect)}) (redir.HereDoc op: <Redir_DLess '<<'> fd: 16777215 here_begin: {(EOF)} here_end_span_id: 225 stdin_parts: [('+tags/F\n') ('=tags/D\n') ('+tags/E\n') ('=tags/C\n')] ) ] ) (C {(test_expect_success)} {(SQ <--cherry-mark>)} { (SQ <'\n'> <'\tgit rev-list --cherry-mark F...E -- bar > actual &&\n'> <'\tgit name-rev --stdin --name-only --refs="*tags/*" \\\n'> <'\t\t< actual > actual.named &&\n'> <'\ttest_cmp actual.named expect\n'> ) } ) (command.SimpleCommand words: [{(cat)}] redirects: [ (redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(expect)}) (redir.HereDoc op: <Redir_DLess '<<'> fd: 16777215 here_begin: {(EOF)} here_end_span_id: 255 stdin_parts: [('<tags/F\n') ('=tags/D\n') ('>tags/E\n') ('=tags/C\n')] ) ] ) (C {(test_expect_success)} {(SQ <'--cherry-mark --left-right'>)} { (SQ <'\n'> <'\tgit rev-list --cherry-mark --left-right F...E -- bar > actual &&\n'> <'\tgit name-rev --stdin --name-only --refs="*tags/*" \\\n'> <'\t\t< actual > actual.named &&\n'> <'\ttest_cmp actual.named expect\n'> ) } ) (command.SimpleCommand words: [{(cat)}] redirects: [ (redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(expect)}) (redir.HereDoc op: <Redir_DLess '<<'> fd: 16777215 here_begin: {(EOF)} here_end_span_id: 282 stdin_parts: [('tags/E\n')] ) ] ) (C {(test_expect_success)} {(SQ <'--cherry-pick --right-only'>)} { (SQ <'\n'> <'\tgit rev-list --cherry-pick --right-only F...E -- bar > actual &&\n'> <'\tgit name-rev --stdin --name-only --refs="*tags/*" \\\n'> <'\t\t< actual > actual.named &&\n'> <'\ttest_cmp actual.named expect\n'> ) } ) (C {(test_expect_success)} {(SQ <'--cherry-pick --left-only'>)} { (SQ <'\n'> <'\tgit rev-list --cherry-pick --left-only E...F -- bar > actual &&\n'> <'\tgit name-rev --stdin --name-only --refs="*tags/*" \\\n'> <'\t\t< actual > actual.named &&\n'> <'\ttest_cmp actual.named expect\n'> ) } ) (command.SimpleCommand words: [{(cat)}] redirects: [ (redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(expect)}) (redir.HereDoc op: <Redir_DLess '<<'> fd: 16777215 here_begin: {(EOF)} here_end_span_id: 325 stdin_parts: [('+tags/E\n') ('=tags/C\n')] ) ] ) (C {(test_expect_success)} {(SQ <--cherry>)} { (SQ <'\n'> <'\tgit rev-list --cherry F...E -- bar > actual &&\n'> <'\tgit name-rev --stdin --name-only --refs="*tags/*" \\\n'> <'\t\t< actual > actual.named &&\n'> <'\ttest_cmp actual.named expect\n'> ) } ) (command.SimpleCommand words: [{(cat)}] redirects: [ (redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(expect)}) (redir.HereDoc op: <Redir_DLess '<<'> fd: 16777215 here_begin: {(EOF)} here_end_span_id: 352 stdin_parts: [('1\t1\n')] ) ] ) (C {(test_expect_success)} {(SQ <'--cherry --count'>)} { (SQ <'\n'> <'\tgit rev-list --cherry --count F...E -- bar > actual &&\n'> <'\ttest_cmp actual expect\n'> ) } ) (command.SimpleCommand words: [{(cat)}] redirects: [ (redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(expect)}) (redir.HereDoc op: <Redir_DLess '<<'> fd: 16777215 here_begin: {(EOF)} here_end_span_id: 377 stdin_parts: [('2\t2\n')] ) ] ) (C {(test_expect_success)} {(SQ <'--cherry-mark --count'>)} { (SQ <'\n'> <'\tgit rev-list --cherry-mark --count F...E -- bar > actual &&\n'> <'\ttest_cmp actual expect\n'> ) } ) (command.SimpleCommand words: [{(cat)}] redirects: [ (redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(expect)}) (redir.HereDoc op: <Redir_DLess '<<'> fd: 16777215 here_begin: {(EOF)} here_end_span_id: 402 stdin_parts: [('1\t1\t2\n')] ) ] ) (C {(test_expect_success)} {(SQ <'--cherry-mark --left-right --count'>)} { (SQ <'\n'> <'\tgit rev-list --cherry-mark --left-right --count F...E -- bar > actual &&\n'> <'\ttest_cmp actual expect\n'> ) } ) (C {(test_expect_success)} {(SQ <'--cherry-pick with independent, but identical branches'>)} { (SQ <'\n'> <'\tgit symbolic-ref HEAD refs/heads/independent &&\n'> <'\trm .git/index &&\n'> <'\techo Hallo > foo &&\n'> <'\tgit add foo &&\n'> <'\ttest_tick &&\n'> <'\tgit commit -m "independent" &&\n'> <'\techo Bello > foo &&\n'> <'\ttest_tick &&\n'> <'\tgit commit -m "independent, too" foo &&\n'> <'\ttest -z "$(git rev-list --left-right --cherry-pick \\\n'> <'\t\tHEAD...master -- foo)"\n'> ) } ) (command.SimpleCommand words: [{(cat)}] redirects: [ (redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(expect)}) (redir.HereDoc op: <Redir_DLess '<<'> fd: 16777215 here_begin: {(EOF)} here_end_span_id: 449 stdin_parts: [('1\t2\n')] ) ] ) (C {(test_expect_success)} {(SQ <'--count --left-right'>)} { (SQ <'\n'> <'\tgit rev-list --count --left-right C...D > actual &&\n'> <'\ttest_cmp expect actual\n'> ) } ) (command.FuncDef name: remove_loose_object body: (command.BraceGroup children: [ (command.AndOr ops: [Op_DAmp Op_DAmp Op_DAmp] children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:sha1 spids:[478]) op: Equal rhs: { (DQ (word_part.CommandSubPart command_list: (command.CommandList children: [(C {(git)} {(rev-parse)} {(DQ ($ VSub_Number '$1'))})] ) left_token: <Left_CommandSub '$('> spids: [480 488] ) ) } spids: [478] ) ] spids: [478] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:remainder spids:[494]) op: Equal rhs: { (word_part.BracedVarSub token: <VSub_Name sha1> suffix_op: (suffix_op.StringUnary op_id:VOp1_Pound arg_word:{('??')}) spids: [495 499] ) } spids: [494] ) ] spids: [494] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:firsttwo spids:[504]) op: Equal rhs: { (word_part.BracedVarSub token: <VSub_Name sha1> suffix_op: (suffix_op.StringUnary op_id: VOp1_Percent arg_word: {($ VSub_Name '$remainder')} ) spids: [505 509] ) } spids: [504] ) ] spids: [504] ) (C {(rm)} {(.git/objects/) ($ VSub_Name '$firsttwo') (/) ($ VSub_Name '$remainder')}) ] ) ] spids: [475] ) spids: [470 474] ) (C {(test_expect_success)} {(SQ <'--cherry-pick avoids looking at full diffs'>)} { (SQ <'\n'> <'\tgit checkout -b shy-diff &&\n'> <'\ttest_commit dont-look-at-me &&\n'> <'\techo Hello >dont-look-at-me.t &&\n'> <'\ttest_tick &&\n'> <'\tgit commit -m tip dont-look-at-me.t &&\n'> <'\tgit checkout -b mainline HEAD^ &&\n'> <'\ttest_commit to-cherry-pick &&\n'> <'\tremove_loose_object shy-diff^:dont-look-at-me.t &&\n'> <'\tgit rev-list --cherry-pick ...shy-diff\n'> ) } ) (C {(test_done)}) ] )