(command.CommandList children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:test_description) op: assign_op.Equal rhs: {(SQ <'test git rev-list --cherry-pick -- file'>)} spids: [4] ) ] ) (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.Simple words: [{<cat>}] redirects: [ (redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expect>}) (redir op: <Id.Redir_DLess '<<'> loc: (redir_loc.Fd fd:0) arg: (redir_param.HereDoc here_begin: {<EOF>} here_end_span_id: 92 stdin_parts: [<'<tags/B\n'> <'>tags/C\n'>] ) ) ] do_fork: T ) (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.Simple words: [{<cat>}] redirects: [ (redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expect>}) (redir op: <Id.Redir_DLess '<<'> loc: (redir_loc.Fd fd:0) arg: (redir_param.HereDoc here_begin: {<EOF>} here_end_span_id: 144 stdin_parts: [<'>tags/C\n'>] ) ) ] do_fork: T ) (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.Simple words: [{<cat>}] redirects: [ (redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expect>}) (redir op: <Id.Redir_DLess '<<'> loc: (redir_loc.Fd fd:0) arg: (redir_param.HereDoc here_begin: {<EOF>} here_end_span_id: 187 stdin_parts: [<'<tags/F\n'> <'>tags/E\n'>] ) ) ] do_fork: T ) (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.Simple words: [{<cat>}] redirects: [ (redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expect>}) (redir op: <Id.Redir_DLess '<<'> loc: (redir_loc.Fd fd:0) arg: (redir_param.HereDoc here_begin: {<EOF>} here_end_span_id: 217 stdin_parts: [<'+tags/F\n'> <'=tags/D\n'> <'+tags/E\n'> <'=tags/C\n'>] ) ) ] do_fork: T ) (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.Simple words: [{<cat>}] redirects: [ (redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expect>}) (redir op: <Id.Redir_DLess '<<'> loc: (redir_loc.Fd fd:0) arg: (redir_param.HereDoc here_begin: {<EOF>} here_end_span_id: 247 stdin_parts: [<'<tags/F\n'> <'=tags/D\n'> <'>tags/E\n'> <'=tags/C\n'>] ) ) ] do_fork: T ) (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.Simple words: [{<cat>}] redirects: [ (redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expect>}) (redir op: <Id.Redir_DLess '<<'> loc: (redir_loc.Fd fd:0) arg: (redir_param.HereDoc here_begin: {<EOF>} here_end_span_id: 274 stdin_parts: [<'tags/E\n'>] ) ) ] do_fork: T ) (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.Simple words: [{<cat>}] redirects: [ (redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expect>}) (redir op: <Id.Redir_DLess '<<'> loc: (redir_loc.Fd fd:0) arg: (redir_param.HereDoc here_begin: {<EOF>} here_end_span_id: 317 stdin_parts: [<'+tags/E\n'> <'=tags/C\n'>] ) ) ] do_fork: T ) (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.Simple words: [{<cat>}] redirects: [ (redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expect>}) (redir op: <Id.Redir_DLess '<<'> loc: (redir_loc.Fd fd:0) arg: (redir_param.HereDoc here_begin:{<EOF>} here_end_span_id:344 stdin_parts:[<'1\t1\n'>]) ) ] do_fork: T ) (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.Simple words: [{<cat>}] redirects: [ (redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expect>}) (redir op: <Id.Redir_DLess '<<'> loc: (redir_loc.Fd fd:0) arg: (redir_param.HereDoc here_begin:{<EOF>} here_end_span_id:369 stdin_parts:[<'2\t2\n'>]) ) ] do_fork: T ) (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.Simple words: [{<cat>}] redirects: [ (redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expect>}) (redir op: <Id.Redir_DLess '<<'> loc: (redir_loc.Fd fd:0) arg: (redir_param.HereDoc here_begin: {<EOF>} here_end_span_id: 394 stdin_parts: [<'1\t1\t2\n'>] ) ) ] do_fork: T ) (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.Simple words: [{<cat>}] redirects: [ (redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expect>}) (redir op: <Id.Redir_DLess '<<'> loc: (redir_loc.Fd fd:0) arg: (redir_param.HereDoc here_begin:{<EOF>} here_end_span_id:441 stdin_parts:[<'1\t2\n'>]) ) ] do_fork: T ) (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.ShFunction name: remove_loose_object body: (BraceGroup children: [ (command.AndOr ops: [Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp] children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:sha1) op: assign_op.Equal rhs: { (DQ (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<git>} {<rev-parse>} {(DQ ($ Id.VSub_Number '$1'))}) ) ) } spids: [470] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:remainder) op: assign_op.Equal rhs: { (braced_var_sub token: <Id.VSub_Name sha1> suffix_op: (suffix_op.Unary tok: <Id.VOp1_Pound '#'> arg_word: {<Id.Lit_Other '?'> <Id.Lit_Other '?'>} ) ) } spids: [486] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:firsttwo) op: assign_op.Equal rhs: { (braced_var_sub token: <Id.VSub_Name sha1> suffix_op: (suffix_op.Unary tok: <Id.VOp1_Percent '%'> arg_word: {($ Id.VSub_DollarName '$remainder')} ) ) } spids: [497] ) ] ) (C {<rm>} {<'.git/objects/'> ($ Id.VSub_DollarName '$firsttwo') <'/'> ($ Id.VSub_DollarName '$remainder') } ) ] ) ] ) ) (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>}) ] )