(command.CommandList children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:test_description) op: assign_op.Equal rhs: {(SQ <'for-each-ref test'>)} spids: [13] ) ] ) (C {<.>} {<'./test-lib.sh'>}) (C {<.>} {(DQ ($ Id.VSub_DollarName '$TEST_DIRECTORY')) <'/lib-gpg.sh'>}) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:datestamp) op: assign_op.Equal rhs: {<1151968723>} spids: [34] ) ] ) (command.ShFunction name: setdate_and_increment body: (BraceGroup children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:GIT_COMMITTER_DATE) op: assign_op.Equal rhs: {(DQ ($ Id.VSub_DollarName '$datestamp') <' +0200'>)} spids: [45] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:datestamp) op: assign_op.Equal rhs: { (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<expr>} {(DQ ($ Id.VSub_DollarName '$datestamp'))} {<Id.Lit_Other '+'>} {<1>} ) ) } spids: [52] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:GIT_AUTHOR_DATE) op: assign_op.Equal rhs: {(DQ ($ Id.VSub_DollarName '$datestamp') <' +0200'>)} spids: [66] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:datestamp) op: assign_op.Equal rhs: { (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<expr>} {(DQ ($ Id.VSub_DollarName '$datestamp'))} {<Id.Lit_Other '+'>} {<1>} ) ) } spids: [73] ) ] ) (C {<export>} {<GIT_COMMITTER_DATE>} {<GIT_AUTHOR_DATE>}) ] ) ) (C {<test_expect_success>} {<setup>} { (SQ <'\n'> <'\tsetdate_and_increment &&\n'> <'\techo "Using $datestamp" > one &&\n'> <'\tgit add one &&\n'> <'\tgit commit -m "Initial" &&\n'> <'\tsetdate_and_increment &&\n'> <'\tgit tag -a -m "Tagging at $datestamp" testtag &&\n'> <'\tgit update-ref refs/remotes/origin/master master &&\n'> <'\tgit remote add origin nowhere &&\n'> <'\tgit config branch.master.remote origin &&\n'> <'\tgit config branch.master.merge refs/heads/master &&\n'> <'\tgit remote add myfork elsewhere &&\n'> <'\tgit config remote.pushdefault myfork &&\n'> <'\tgit config push.default current\n'> ) } ) (command.ShFunction name: test_atom body: (BraceGroup children: [ (command.Case to_match: {(DQ ($ Id.VSub_Number '$1'))} arms: [ (case_arm pat_list: [{<head>}] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:ref) op: assign_op.Equal rhs: {<'refs/heads/master'>} spids: [137] ) ] ) ] spids: [134 135 140 -1] ) (case_arm pat_list: [{<tag>}] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:ref) op: assign_op.Equal rhs: {<'refs/tags/testtag'>} spids: [146] ) ] ) ] spids: [143 144 149 -1] ) (case_arm pat_list: [{<Id.Lit_Star '*'>}] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:ref) op: assign_op.Equal rhs: {($ Id.VSub_Number '$1')} spids: [155] ) ] ) ] spids: [152 153 158 -1] ) ] ) (command.Simple words: [{<printf>} {(SQ <'%s\\n'>)} {(DQ ($ Id.VSub_Number '$3'))}] redirects: [(redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expected>})] do_fork: T ) (C {<test_expect_> (braced_var_sub token: <Id.VSub_Number 4> suffix_op: (suffix_op.Unary tok:<Id.VTest_ColonHyphen ':-'> arg_word:{<success>}) ) } {($ Id.VSub_DollarName '$PREREQ')} {(DQ <'basic atom: '> ($ Id.VSub_Number '$1') <' '> ($ Id.VSub_Number '$2'))} { (DQ <'\n'> <'\t\tgit for-each-ref --format=\'%('> ($ Id.VSub_Number '$2') <')\' '> ($ Id.VSub_DollarName '$ref') <' >actual &&\n'> <'\t\tsanitize_pgp <actual >actual.clean &&\n'> <'\t\ttest_cmp expected actual.clean\n'> <'\t'> ) } ) ] ) ) (C {<test_atom>} {<head>} {<refname>} {<'refs/heads/master'>}) (C {<test_atom>} {<head>} {<refname> <Id.Lit_Colon ':'> <short>} {<master>}) (C {<test_atom>} {<head>} {<refname> <Id.Lit_Colon ':'> <Id.Lit_VarLike 'strip='> <1>} {<'heads/master'>} ) (C {<test_atom>} {<head>} {<refname> <Id.Lit_Colon ':'> <Id.Lit_VarLike 'strip='> <2>} {<master>}) (C {<test_atom>} {<head>} {<upstream>} {<'refs/remotes/origin/master'>}) (C {<test_atom>} {<head>} {<upstream> <Id.Lit_Colon ':'> <short>} {<'origin/master'>}) (C {<test_atom>} {<head>} {<push>} {<'refs/remotes/myfork/master'>}) (C {<test_atom>} {<head>} {<push> <Id.Lit_Colon ':'> <short>} {<'myfork/master'>}) (C {<test_atom>} {<head>} {<objecttype>} {<commit>}) (C {<test_atom>} {<head>} {<objectsize>} {<171>}) (C {<test_atom>} {<head>} {<objectname>} { (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<git>} {<rev-parse>} {<'refs/heads/master'>}) ) } ) (C {<test_atom>} {<head>} {<objectname> <Id.Lit_Colon ':'> <short>} { (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<git>} {<rev-parse>} {<--short>} {<'refs/heads/master'>}) ) } ) (C {<test_atom>} {<head>} {<tree>} { (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<git>} {<rev-parse>} {<'refs/heads/master'> <Id.Lit_Other '^'> <Id.Lit_LBrace '{'> <tree> <Id.Lit_RBrace '}'>} ) ) } ) (C {<test_atom>} {<head>} {<parent>} {(SQ )}) (C {<test_atom>} {<head>} {<numparent>} {<0>}) (C {<test_atom>} {<head>} {<object>} {(SQ )}) (C {<test_atom>} {<head>} {<type>} {(SQ )}) (C {<test_atom>} {<head>} {(SQ <'*objectname'>)} {(SQ )}) (C {<test_atom>} {<head>} {(SQ <'*objecttype'>)} {(SQ )}) (C {<test_atom>} {<head>} {<author>} {(SQ <'A U Thor <author@example.com> 1151968724 +0200'>)}) (C {<test_atom>} {<head>} {<authorname>} {(SQ <'A U Thor'>)}) (C {<test_atom>} {<head>} {<authoremail>} {(SQ <'<author@example.com>'>)}) (C {<test_atom>} {<head>} {<authordate>} {(SQ <'Tue Jul 4 01:18:44 2006 +0200'>)}) (C {<test_atom>} {<head>} {<committer>} {(SQ <'C O Mitter <committer@example.com> 1151968723 +0200'>)}) (C {<test_atom>} {<head>} {<committername>} {(SQ <'C O Mitter'>)}) (C {<test_atom>} {<head>} {<committeremail>} {(SQ <'<committer@example.com>'>)}) (C {<test_atom>} {<head>} {<committerdate>} {(SQ <'Tue Jul 4 01:18:43 2006 +0200'>)}) (C {<test_atom>} {<head>} {<tag>} {(SQ )}) (C {<test_atom>} {<head>} {<tagger>} {(SQ )}) (C {<test_atom>} {<head>} {<taggername>} {(SQ )}) (C {<test_atom>} {<head>} {<taggeremail>} {(SQ )}) (C {<test_atom>} {<head>} {<taggerdate>} {(SQ )}) (C {<test_atom>} {<head>} {<creator>} {(SQ <'C O Mitter <committer@example.com> 1151968723 +0200'>)}) (C {<test_atom>} {<head>} {<creatordate>} {(SQ <'Tue Jul 4 01:18:43 2006 +0200'>)}) (C {<test_atom>} {<head>} {<subject>} {(SQ <Initial>)}) (C {<test_atom>} {<head>} {<contents> <Id.Lit_Colon ':'> <subject>} {(SQ <Initial>)}) (C {<test_atom>} {<head>} {<body>} {(SQ )}) (C {<test_atom>} {<head>} {<contents> <Id.Lit_Colon ':'> <body>} {(SQ )}) (C {<test_atom>} {<head>} {<contents> <Id.Lit_Colon ':'> <signature>} {(SQ )}) (C {<test_atom>} {<head>} {<contents>} {(SQ <'Initial\n'>)}) (C {<test_atom>} {<head>} {<HEAD>} {(SQ <'*'>)}) (C {<test_atom>} {<tag>} {<refname>} {<'refs/tags/testtag'>}) (C {<test_atom>} {<tag>} {<refname> <Id.Lit_Colon ':'> <short>} {<testtag>}) (C {<test_atom>} {<tag>} {<upstream>} {(SQ )}) (C {<test_atom>} {<tag>} {<push>} {(SQ )}) (C {<test_atom>} {<tag>} {<objecttype>} {<tag>}) (C {<test_atom>} {<tag>} {<objectsize>} {<154>}) (C {<test_atom>} {<tag>} {<objectname>} { (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<git>} {<rev-parse>} {<'refs/tags/testtag'>}) ) } ) (C {<test_atom>} {<tag>} {<objectname> <Id.Lit_Colon ':'> <short>} { (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<git>} {<rev-parse>} {<--short>} {<'refs/tags/testtag'>}) ) } ) (C {<test_atom>} {<tag>} {<tree>} {(SQ )}) (C {<test_atom>} {<tag>} {<parent>} {(SQ )}) (C {<test_atom>} {<tag>} {<numparent>} {(SQ )}) (C {<test_atom>} {<tag>} {<object>} { (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<git>} {<rev-parse>} {<'refs/tags/testtag'> <Id.Lit_Other '^'> <0>}) ) } ) (C {<test_atom>} {<tag>} {<type>} {(SQ <commit>)}) (C {<test_atom>} {<tag>} {(SQ <'*objectname'>)} {(SQ <ea122842f48be4afb2d1fc6a4b96c05885ab7463>)}) (C {<test_atom>} {<tag>} {(SQ <'*objecttype'>)} {(SQ <commit>)}) (C {<test_atom>} {<tag>} {<author>} {(SQ )}) (C {<test_atom>} {<tag>} {<authorname>} {(SQ )}) (C {<test_atom>} {<tag>} {<authoremail>} {(SQ )}) (C {<test_atom>} {<tag>} {<authordate>} {(SQ )}) (C {<test_atom>} {<tag>} {<committer>} {(SQ )}) (C {<test_atom>} {<tag>} {<committername>} {(SQ )}) (C {<test_atom>} {<tag>} {<committeremail>} {(SQ )}) (C {<test_atom>} {<tag>} {<committerdate>} {(SQ )}) (C {<test_atom>} {<tag>} {<tag>} {(SQ <testtag>)}) (C {<test_atom>} {<tag>} {<tagger>} {(SQ <'C O Mitter <committer@example.com> 1151968725 +0200'>)}) (C {<test_atom>} {<tag>} {<taggername>} {(SQ <'C O Mitter'>)}) (C {<test_atom>} {<tag>} {<taggeremail>} {(SQ <'<committer@example.com>'>)}) (C {<test_atom>} {<tag>} {<taggerdate>} {(SQ <'Tue Jul 4 01:18:45 2006 +0200'>)}) (C {<test_atom>} {<tag>} {<creator>} {(SQ <'C O Mitter <committer@example.com> 1151968725 +0200'>)}) (C {<test_atom>} {<tag>} {<creatordate>} {(SQ <'Tue Jul 4 01:18:45 2006 +0200'>)}) (C {<test_atom>} {<tag>} {<subject>} {(SQ <'Tagging at 1151968727'>)}) (C {<test_atom>} {<tag>} {<contents> <Id.Lit_Colon ':'> <subject>} {(SQ <'Tagging at 1151968727'>)}) (C {<test_atom>} {<tag>} {<body>} {(SQ )}) (C {<test_atom>} {<tag>} {<contents> <Id.Lit_Colon ':'> <body>} {(SQ )}) (C {<test_atom>} {<tag>} {<contents> <Id.Lit_Colon ':'> <signature>} {(SQ )}) (C {<test_atom>} {<tag>} {<contents>} {(SQ <'Tagging at 1151968727\n'>)}) (C {<test_atom>} {<tag>} {<HEAD>} {(SQ <' '>)}) (C {<test_expect_success>} {(SQ <'Check invalid atoms names are errors'>)} {(SQ <'\n'> <'\ttest_must_fail git for-each-ref --format="%(INVALID)" refs/heads\n'>)} ) (C {<test_expect_success>} {(SQ <'arguments to :strip must be positive integers'>)} { (SQ <'\n'> <'\ttest_must_fail git for-each-ref --format="%(refname:strip=0)" &&\n'> <'\ttest_must_fail git for-each-ref --format="%(refname:strip=-1)" &&\n'> <'\ttest_must_fail git for-each-ref --format="%(refname:strip=foo)"\n'> ) } ) (C {<test_expect_success>} {(SQ <'stripping refnames too far gives an error'>)} {(SQ <'\n'> <'\ttest_must_fail git for-each-ref --format="%(refname:strip=3)"\n'>)} ) (C {<test_expect_success>} {(SQ <'Check format specifiers are ignored in naming date atoms'>)} { (SQ <'\n'> <'\tgit for-each-ref --format="%(authordate)" refs/heads &&\n'> <'\tgit for-each-ref --format="%(authordate:default) %(authordate)" refs/heads &&\n'> <'\tgit for-each-ref --format="%(authordate) %(authordate:default)" refs/heads &&\n'> <'\tgit for-each-ref --format="%(authordate:default) %(authordate:default)" refs/heads\n'> ) } ) (C {<test_expect_success>} {(SQ <'Check valid format specifiers for date fields'>)} { (SQ <'\n'> <'\tgit for-each-ref --format="%(authordate:default)" refs/heads &&\n'> <'\tgit for-each-ref --format="%(authordate:relative)" refs/heads &&\n'> <'\tgit for-each-ref --format="%(authordate:short)" refs/heads &&\n'> <'\tgit for-each-ref --format="%(authordate:local)" refs/heads &&\n'> <'\tgit for-each-ref --format="%(authordate:iso8601)" refs/heads &&\n'> <'\tgit for-each-ref --format="%(authordate:rfc2822)" refs/heads\n'> ) } ) (C {<test_expect_success>} {(SQ <'Check invalid format specifiers are errors'>)} { (SQ <'\n'> <'\ttest_must_fail git for-each-ref --format="%(authordate:INVALID)" refs/heads\n'>) } ) (command.ShFunction name: test_date body: (BraceGroup children: [ (command.AndOr ops: [Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp] children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:f) op: assign_op.Equal rhs: {($ Id.VSub_Number '$1')} spids: [1094] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:committer_date) op: assign_op.Equal rhs: {($ Id.VSub_Number '$2')} spids: [1100] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:author_date) op: assign_op.Equal rhs: {($ Id.VSub_Number '$3')} spids: [1106] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:tagger_date) op: assign_op.Equal rhs: {($ Id.VSub_Number '$4')} spids: [1112] ) ] ) (command.Simple words: [{<cat>}] redirects: [ (redir op: <Id.Redir_Great '>'> loc: (redir_loc.Fd fd:1) arg: {<expected>} ) (redir op: <Id.Redir_DLessDash '<<-'> loc: (redir_loc.Fd fd:0) arg: (redir_param.HereDoc here_begin: {<EOF>} here_end_span_id: 1137 stdin_parts: [ <'\'refs/heads/master\' \''> ($ Id.VSub_DollarName '$committer_date') <'\' \''> ($ Id.VSub_DollarName '$author_date') <'\'\n'> <'\'refs/tags/testtag\' \''> ($ Id.VSub_DollarName '$tagger_date') <'\'\n'> ] ) ) ] do_fork: T ) (command.Subshell child: (command.AndOr ops: [Id.Op_DAmp] children: [ (C {<git>} {<for-each-ref>} {<--shell>} {<--format> <Id.Lit_Equals '='> (DQ <'%(refname) %(committerdate'> (braced_var_sub token: <Id.VSub_Name f> suffix_op: (suffix_op.Unary tok: <Id.VTest_ColonPlus ':+'> arg_word: {<':'> ($ Id.VSub_DollarName '$f')} ) ) <') %(authordate'> (braced_var_sub token: <Id.VSub_Name f> suffix_op: (suffix_op.Unary tok: <Id.VTest_ColonPlus ':+'> arg_word: {<':'> ($ Id.VSub_DollarName '$f')} ) ) <')'> ) } {<'refs/heads'>} ) (C {<git>} {<for-each-ref>} {<--shell>} {<--format> <Id.Lit_Equals '='> (DQ <'%(refname) %(taggerdate'> (braced_var_sub token: <Id.VSub_Name f> suffix_op: (suffix_op.Unary tok: <Id.VTest_ColonPlus ':+'> arg_word: {<':'> ($ Id.VSub_DollarName '$f')} ) ) <')'> ) } {<'refs/tags'>} ) ] ) redirects: [(redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<actual>})] ) (C {<test_cmp>} {<expected>} {<actual>}) ] ) ] ) ) (C {<test_expect_success>} {(SQ <'Check unformatted date fields output'>)} { (SQ <'\n'> <'\ttest_date "" \\\n'> <'\t\t"Tue Jul 4 01:18:43 2006 +0200" \\\n'> <'\t\t"Tue Jul 4 01:18:44 2006 +0200" \\\n'> <'\t\t"Tue Jul 4 01:18:45 2006 +0200"\n'> ) } ) (C {<test_expect_success>} {(SQ <'Check format "default" formatted date fields output'>)} { (SQ <'\n'> <'\ttest_date default \\\n'> <'\t\t"Tue Jul 4 01:18:43 2006 +0200" \\\n'> <'\t\t"Tue Jul 4 01:18:44 2006 +0200" \\\n'> <'\t\t"Tue Jul 4 01:18:45 2006 +0200"\n'> ) } ) (C {<test_expect_success>} {(SQ <'Check format "default-local" date fields output'>)} { (SQ <'\n'> < '\ttest_date default-local "Mon Jul 3 23:18:43 2006" "Mon Jul 3 23:18:44 2006" "Mon Jul 3 23:18:45 2006"\n' > ) } ) (C {<test_expect_success>} {(SQ <'Check format "relative" date fields output'>)} { (SQ <'\n'> <'\tf=relative &&\n'> < '\t(git for-each-ref --shell --format="%(refname) %(committerdate:$f) %(authordate:$f)" refs/heads &&\n' > <'\tgit for-each-ref --shell --format="%(refname) %(taggerdate:$f)" refs/tags) >actual\n'> ) } ) (C {<test_expect_success>} {(SQ <'Check format "relative-local" date fields output'>)} { (SQ <'\n'> <'\ttest_date relative-local \\\n'> <'\t\t"$(git for-each-ref --format="%(committerdate:relative)" refs/heads)" \\\n'> <'\t\t"$(git for-each-ref --format="%(authordate:relative)" refs/heads)" \\\n'> <'\t\t"$(git for-each-ref --format="%(taggerdate:relative)" refs/tags)"\n'> ) } ) (C {<test_expect_success>} {(SQ <'Check format "short" date fields output'>)} {(SQ <'\n'> <'\ttest_date short 2006-07-04 2006-07-04 2006-07-04\n'>)} ) (C {<test_expect_success>} {(SQ <'Check format "short-local" date fields output'>)} {(SQ <'\n'> <'\ttest_date short-local 2006-07-03 2006-07-03 2006-07-03\n'>)} ) (C {<test_expect_success>} {(SQ <'Check format "local" date fields output'>)} { (SQ <'\n'> <'\ttest_date local \\\n'> <'\t\t"Mon Jul 3 23:18:43 2006" \\\n'> <'\t\t"Mon Jul 3 23:18:44 2006" \\\n'> <'\t\t"Mon Jul 3 23:18:45 2006"\n'> ) } ) (C {<test_expect_success>} {(SQ <'Check format "iso8601" date fields output'>)} { (SQ <'\n'> <'\ttest_date iso8601 \\\n'> <'\t\t"2006-07-04 01:18:43 +0200" \\\n'> <'\t\t"2006-07-04 01:18:44 +0200" \\\n'> <'\t\t"2006-07-04 01:18:45 +0200"\n'> ) } ) (C {<test_expect_success>} {(SQ <'Check format "iso8601-local" date fields output'>)} { (SQ <'\n'> < '\ttest_date iso8601-local "2006-07-03 23:18:43 +0000" "2006-07-03 23:18:44 +0000" "2006-07-03 23:18:45 +0000"\n' > ) } ) (C {<test_expect_success>} {(SQ <'Check format "rfc2822" date fields output'>)} { (SQ <'\n'> <'\ttest_date rfc2822 \\\n'> <'\t\t"Tue, 4 Jul 2006 01:18:43 +0200" \\\n'> <'\t\t"Tue, 4 Jul 2006 01:18:44 +0200" \\\n'> <'\t\t"Tue, 4 Jul 2006 01:18:45 +0200"\n'> ) } ) (C {<test_expect_success>} {(SQ <'Check format "rfc2822-local" date fields output'>)} { (SQ <'\n'> < '\ttest_date rfc2822-local "Mon, 3 Jul 2006 23:18:43 +0000" "Mon, 3 Jul 2006 23:18:44 +0000" "Mon, 3 Jul 2006 23:18:45 +0000"\n' > ) } ) (C {<test_expect_success>} {(SQ <'Check format "raw" date fields output'>)} {(SQ <'\n'> <'\ttest_date raw "1151968723 +0200" "1151968724 +0200" "1151968725 +0200"\n'>)} ) (C {<test_expect_success>} {(SQ <'Check format "raw-local" date fields output'>)} { (SQ <'\n'> <'\ttest_date raw-local "1151968723 +0000" "1151968724 +0000" "1151968725 +0000"\n'> ) } ) (C {<test_expect_success>} {(SQ <'Check format of strftime date fields'>)} { (SQ <'\n'> <'\techo "my date is 2006-07-04" >expected &&\n'> <'\tgit for-each-ref \\\n'> <'\t --format="%(authordate:format:my date is %Y-%m-%d)" \\\n'> <'\t refs/heads >actual &&\n'> <'\ttest_cmp expected actual\n'> ) } ) (C {<test_expect_success>} {(SQ <'Check format of strftime-local date fields'>)} { (SQ <'\n'> <'\techo "my date is 2006-07-03" >expected &&\n'> <'\tgit for-each-ref \\\n'> <'\t --format="%(authordate:format-local:my date is %Y-%m-%d)" \\\n'> <'\t refs/heads >actual &&\n'> <'\ttest_cmp expected actual\n'> ) } ) (C {<test_expect_success>} {(SQ <'exercise strftime with odd fields'>)} { (SQ <'\n'> <'\techo >expected &&\n'> <'\tgit for-each-ref --format="%(authordate:format:)" refs/heads >actual &&\n'> <'\ttest_cmp expected actual &&\n'> <'\tlong="long format -- $_z40$_z40$_z40$_z40$_z40$_z40$_z40" &&\n'> <'\techo $long >expected &&\n'> <'\tgit for-each-ref --format="%(authordate:format:$long)" refs/heads >actual &&\n'> <'\ttest_cmp expected actual\n'> ) } ) (command.Simple words: [{<cat>}] redirects: [ (redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expected>}) (redir op: <Id.Redir_DLess '<<'> loc: (redir_loc.Fd fd:0) arg: (redir_param.HereDoc here_begin: {(word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\E'>) <OF>} here_end_span_id: 1485 stdin_parts: [ <'refs/heads/master\n'> <'refs/remotes/origin/master\n'> <'refs/tags/testtag\n'> ] ) ) ] do_fork: T ) (C {<test_expect_success>} {(SQ <'Verify ascending sort'>)} { (SQ <'\n'> <'\tgit for-each-ref --format="%(refname)" --sort=refname >actual &&\n'> <'\ttest_cmp expected actual\n'> ) } ) (command.Simple words: [{<cat>}] redirects: [ (redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expected>}) (redir op: <Id.Redir_DLess '<<'> loc: (redir_loc.Fd fd:0) arg: (redir_param.HereDoc here_begin: {(word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\E'>) <OF>} here_end_span_id: 1513 stdin_parts: [ <'refs/tags/testtag\n'> <'refs/remotes/origin/master\n'> <'refs/heads/master\n'> ] ) ) ] do_fork: T ) (C {<test_expect_success>} {(SQ <'Verify descending sort'>)} { (SQ <'\n'> <'\tgit for-each-ref --format="%(refname)" --sort=-refname >actual &&\n'> <'\ttest_cmp expected actual\n'> ) } ) (command.Simple words: [{<cat>}] redirects: [ (redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expected>}) (redir op: <Id.Redir_DLess '<<'> loc: (redir_loc.Fd fd:0) arg: (redir_param.HereDoc here_begin: {(word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\E'>) <OF>} here_end_span_id: 1540 stdin_parts: [ <'\'refs/heads/master\'\n'> <'\'refs/remotes/origin/master\'\n'> <'\'refs/tags/testtag\'\n'> ] ) ) ] do_fork: T ) (C {<test_expect_success>} {(SQ <'Quoting style: shell'>)} { (SQ <'\n'> <'\tgit for-each-ref --shell --format="%(refname)" >actual &&\n'> <'\ttest_cmp expected actual\n'> ) } ) (C {<test_expect_success>} {(SQ <'Quoting style: perl'>)} { (SQ <'\n'> <'\tgit for-each-ref --perl --format="%(refname)" >actual &&\n'> <'\ttest_cmp expected actual\n'> ) } ) (C {<test_expect_success>} {(SQ <'Quoting style: python'>)} { (SQ <'\n'> <'\tgit for-each-ref --python --format="%(refname)" >actual &&\n'> <'\ttest_cmp expected actual\n'> ) } ) (command.Simple words: [{<cat>}] redirects: [ (redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expected>}) (redir op: <Id.Redir_DLess '<<'> loc: (redir_loc.Fd fd:0) arg: (redir_param.HereDoc here_begin: {(word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\E'>) <OF>} here_end_span_id: 1593 stdin_parts: [ <'"refs/heads/master"\n'> <'"refs/remotes/origin/master"\n'> <'"refs/tags/testtag"\n'> ] ) ) ] do_fork: T ) (C {<test_expect_success>} {(SQ <'Quoting style: tcl'>)} { (SQ <'\n'> <'\tgit for-each-ref --tcl --format="%(refname)" >actual &&\n'> <'\ttest_cmp expected actual\n'> ) } ) (command.ForEach iter_name: i iter_words: [ {(DQ <'--perl --shell'>)} {(DQ <'-s --python'>)} {(DQ <'--python --tcl'>)} {(DQ <'--tcl --perl'>)} ] do_arg_iter: F body: (command.DoGroup children: [ (C {<test_expect_success>} {(DQ <'more than one quoting style: '> ($ Id.VSub_DollarName '$i'))} { (DQ <'\n'> <'\t\tgit for-each-ref '> ($ Id.VSub_DollarName '$i') <' 2>&1 | (read line &&\n'> <'\t\tcase '> (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\$'>) <'line in\n'> <'\t\t'> (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\"'>) <'error: more than one quoting style'> (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\"'>) <'*) : happy;;\n'> <'\t\t*) false\n'> <'\t\tesac)\n'> <'\t'> ) } ) ] ) ) (C {<test_expect_success>} {(SQ <'setup for upstream:track[short]'>)} {(SQ <'\n'> <'\ttest_commit two\n'>)} ) (C {<test_atom>} {<head>} {<upstream> <Id.Lit_Colon ':'> <track>} {(SQ <'[ahead 1]'>)}) (C {<test_atom>} {<head>} {<upstream> <Id.Lit_Colon ':'> <trackshort>} {(SQ <'>'>)}) (C {<test_atom>} {<head>} {<push> <Id.Lit_Colon ':'> <track>} {(SQ <'[ahead 1]'>)}) (C {<test_atom>} {<head>} {<push> <Id.Lit_Colon ':'> <trackshort>} {(SQ <'>'>)}) (C {<test_expect_success>} {(SQ <'Check that :track[short] cannot be used with other atoms'>)} { (SQ <'\n'> <'\ttest_must_fail git for-each-ref --format="%(refname:track)" 2>/dev/null &&\n'> <'\ttest_must_fail git for-each-ref --format="%(refname:trackshort)" 2>/dev/null\n'> ) } ) (C {<test_expect_success>} {(SQ <'Check that :track[short] works when upstream is invalid'>)} { (SQ <'\n'> <'\tcat >expected <<-\\EOF &&\n'> <'\n'> <'\n'> <'\tEOF\n'> <'\ttest_when_finished "git config branch.master.merge refs/heads/master" &&\n'> <'\tgit config branch.master.merge refs/heads/does-not-exist &&\n'> <'\tgit for-each-ref \\\n'> <'\t\t--format="%(upstream:track)$LF%(upstream:trackshort)" \\\n'> <'\t\trefs/heads >actual &&\n'> <'\ttest_cmp expected actual\n'> ) } ) (C {<test_expect_success>} {(SQ <'Check for invalid refname format'>)} {(SQ <'\n'> <'\ttest_must_fail git for-each-ref --format="%(refname:INVALID)"\n'>)} ) (command.ShFunction name: get_color body: (BraceGroup children: [ (C {<git>} {<config>} {<--get-color>} {<no.such.slot>} {(DQ ($ Id.VSub_Number '$1'))}) ] ) ) (command.Simple words: [{<cat>}] redirects: [ (redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expected>}) (redir op: <Id.Redir_DLess '<<'> loc: (redir_loc.Fd fd:0) arg: (redir_param.HereDoc here_begin: {<EOF>} here_end_span_id: 1889 stdin_parts: [ (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<git>} {<rev-parse>} {<--short>} {<'refs/heads/master'>}) ) <' '> (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<get_color>} {<green>}) ) <master> (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<get_color>} {<reset>}) ) <'\n'> (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<git>} {<rev-parse>} {<--short>} {<'refs/remotes/origin/master'>}) ) <' '> (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<get_color>} {<green>}) ) <'origin/master'> (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<get_color>} {<reset>}) ) <'\n'> (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<git>} {<rev-parse>} {<--short>} {<'refs/tags/testtag'>}) ) <' '> (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<get_color>} {<green>}) ) <testtag> (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<get_color>} {<reset>}) ) <'\n'> (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<git>} {<rev-parse>} {<--short>} {<'refs/tags/two'>}) ) <' '> (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<get_color>} {<green>}) ) <two> (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<get_color>} {<reset>}) ) <'\n'> ] ) ) ] do_fork: T ) (C {<test_expect_success>} {(SQ <'Check %(color:...) '>)} { (SQ <'\n'> < '\tgit for-each-ref --format="%(objectname:short) %(color:green)%(refname:short)" >actual &&\n' > <'\ttest_cmp expected actual\n'> ) } ) (command.Simple words: [{<cat>}] redirects: [ (redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expected>}) (redir op: <Id.Redir_DLess '<<'> loc: (redir_loc.Fd fd:0) arg: (redir_param.HereDoc here_begin: {(word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\E'>) <OF>} here_end_span_id: 1915 stdin_parts: [<'heads/master\n'> <'tags/master\n'>] ) ) ] do_fork: T ) (C {<test_expect_success>} {(SQ <'Check ambiguous head and tag refs (strict)'>)} { (SQ <'\n'> <'\tgit config --bool core.warnambiguousrefs true &&\n'> <'\tgit checkout -b newtag &&\n'> <'\techo "Using $datestamp" > one &&\n'> <'\tgit add one &&\n'> <'\tgit commit -m "Branch" &&\n'> <'\tsetdate_and_increment &&\n'> <'\tgit tag -m "Tagging at $datestamp" master &&\n'> < '\tgit for-each-ref --format "%(refname:short)" refs/heads/master refs/tags/master >actual &&\n' > <'\ttest_cmp expected actual\n'> ) } ) (command.Simple words: [{<cat>}] redirects: [ (redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expected>}) (redir op: <Id.Redir_DLess '<<'> loc: (redir_loc.Fd fd:0) arg: (redir_param.HereDoc here_begin: {(word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\E'>) <OF>} here_end_span_id: 1948 stdin_parts: [<'heads/master\n'> <'master\n'>] ) ) ] do_fork: T ) (C {<test_expect_success>} {(SQ <'Check ambiguous head and tag refs (loose)'>)} { (SQ <'\n'> <'\tgit config --bool core.warnambiguousrefs false &&\n'> < '\tgit for-each-ref --format "%(refname:short)" refs/heads/master refs/tags/master >actual &&\n' > <'\ttest_cmp expected actual\n'> ) } ) (command.Simple words: [{<cat>}] redirects: [ (redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expected>}) (redir op: <Id.Redir_DLess '<<'> loc: (redir_loc.Fd fd:0) arg: (redir_param.HereDoc here_begin: {(word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\E'>) <OF>} here_end_span_id: 1975 stdin_parts: [<'heads/ambiguous\n'> <'ambiguous\n'>] ) ) ] do_fork: T ) (C {<test_expect_success>} {(SQ <'Check ambiguous head and tag refs II (loose)'>)} { (SQ <'\n'> <'\tgit checkout master &&\n'> <'\tgit tag ambiguous testtag^0 &&\n'> <'\tgit branch ambiguous testtag^0 &&\n'> < '\tgit for-each-ref --format "%(refname:short)" refs/heads/ambiguous refs/tags/ambiguous >actual &&\n' > <'\ttest_cmp expected actual\n'> ) } ) (C {<test_expect_success>} {(SQ <'an unusual tag with an incomplete line'>)} { (SQ <'\n'> <'\n'> <'\tgit tag -m "bogo" bogo &&\n'> <'\tbogo=$(git cat-file tag bogo) &&\n'> <'\tbogo=$(printf "%s" "$bogo" | git mktag) &&\n'> <'\tgit tag -f bogo "$bogo" &&\n'> <'\tgit for-each-ref --format "%(body)" refs/tags/bogo\n'> <'\n'> ) } ) (C {<test_expect_success>} {(SQ <'create tag with subject and body content'>)} { (SQ <'\n'> <'\tcat >>msg <<-\\EOF &&\n'> <'\t\tthe subject line\n'> <'\n'> <'\t\tfirst body line\n'> <'\t\tsecond body line\n'> <'\tEOF\n'> <'\tgit tag -F msg subject-body\n'> ) } ) (C {<test_atom>} {<'refs/tags/subject-body'>} {<subject>} {(SQ <'the subject line'>)}) (C {<test_atom>} {<'refs/tags/subject-body'>} {<body>} {(SQ <'first body line\n'> <'second body line\n'>)} ) (C {<test_atom>} {<'refs/tags/subject-body'>} {<contents>} {(SQ <'the subject line\n'> <'\n'> <'first body line\n'> <'second body line\n'>)} ) (C {<test_expect_success>} {(SQ <'create tag with multiline subject'>)} { (SQ <'\n'> <'\tcat >msg <<-\\EOF &&\n'> <'\t\tfirst subject line\n'> <'\t\tsecond subject line\n'> <'\n'> <'\t\tfirst body line\n'> <'\t\tsecond body line\n'> <'\tEOF\n'> <'\tgit tag -F msg multiline\n'> ) } ) (C {<test_atom>} {<'refs/tags/multiline'>} {<subject>} {(SQ <'first subject line second subject line'>)} ) (C {<test_atom>} {<'refs/tags/multiline'>} {<contents> <Id.Lit_Colon ':'> <subject>} {(SQ <'first subject line second subject line'>)} ) (C {<test_atom>} {<'refs/tags/multiline'>} {<body>} {(SQ <'first body line\n'> <'second body line\n'>)} ) (C {<test_atom>} {<'refs/tags/multiline'>} {<contents> <Id.Lit_Colon ':'> <body>} {(SQ <'first body line\n'> <'second body line\n'>)} ) (C {<test_atom>} {<'refs/tags/multiline'>} {<contents> <Id.Lit_Colon ':'> <signature>} {(SQ )}) (C {<test_atom>} {<'refs/tags/multiline'>} {<contents>} { (SQ <'first subject line\n'> <'second subject line\n'> <'\n'> <'first body line\n'> <'second body line\n'> ) } ) (C {<test_expect_success>} {<GPG>} {(SQ <'create signed tags'>)} { (SQ <'\n'> <'\tgit tag -s -m "" signed-empty &&\n'> <'\tgit tag -s -m "subject line" signed-short &&\n'> <'\tcat >msg <<-\\EOF &&\n'> <'\tsubject line\n'> <'\n'> <'\tbody contents\n'> <'\tEOF\n'> <'\tgit tag -s -F msg signed-long\n'> ) } ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:sig) op: assign_op.Equal rhs: {(SQ <'-----BEGIN PGP SIGNATURE-----\n'> <'-----END PGP SIGNATURE-----\n'>)} spids: [2174] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:PREREQ) op: assign_op.Equal rhs: {<GPG>} spids: [2181] ) ] ) (C {<test_atom>} {<'refs/tags/signed-empty'>} {<subject>} {(SQ )}) (C {<test_atom>} {<'refs/tags/signed-empty'>} {<contents> <Id.Lit_Colon ':'> <subject>} {(SQ )}) (C {<test_atom>} {<'refs/tags/signed-empty'>} {<body>} {(DQ ($ Id.VSub_DollarName '$sig'))}) (C {<test_atom>} {<'refs/tags/signed-empty'>} {<contents> <Id.Lit_Colon ':'> <body>} {(SQ )}) (C {<test_atom>} {<'refs/tags/signed-empty'>} {<contents> <Id.Lit_Colon ':'> <signature>} {(DQ ($ Id.VSub_DollarName '$sig'))} ) (C {<test_atom>} {<'refs/tags/signed-empty'>} {<contents>} {(DQ ($ Id.VSub_DollarName '$sig'))}) (C {<test_atom>} {<'refs/tags/signed-short'>} {<subject>} {(SQ <'subject line'>)}) (C {<test_atom>} {<'refs/tags/signed-short'>} {<contents> <Id.Lit_Colon ':'> <subject>} {(SQ <'subject line'>)} ) (C {<test_atom>} {<'refs/tags/signed-short'>} {<body>} {(DQ ($ Id.VSub_DollarName '$sig'))}) (C {<test_atom>} {<'refs/tags/signed-short'>} {<contents> <Id.Lit_Colon ':'> <body>} {(SQ )}) (C {<test_atom>} {<'refs/tags/signed-short'>} {<contents> <Id.Lit_Colon ':'> <signature>} {(DQ ($ Id.VSub_DollarName '$sig'))} ) (C {<test_atom>} {<'refs/tags/signed-short'>} {<contents>} {(DQ <'subject line\n'> ($ Id.VSub_DollarName '$sig'))} ) (C {<test_atom>} {<'refs/tags/signed-long'>} {<subject>} {(SQ <'subject line'>)}) (C {<test_atom>} {<'refs/tags/signed-long'>} {<contents> <Id.Lit_Colon ':'> <subject>} {(SQ <'subject line'>)} ) (C {<test_atom>} {<'refs/tags/signed-long'>} {<body>} {(DQ <'body contents\n'> ($ Id.VSub_DollarName '$sig'))} ) (C {<test_atom>} {<'refs/tags/signed-long'>} {<contents> <Id.Lit_Colon ':'> <body>} {(SQ <'body contents\n'>)} ) (C {<test_atom>} {<'refs/tags/signed-long'>} {<contents> <Id.Lit_Colon ':'> <signature>} {(DQ ($ Id.VSub_DollarName '$sig'))} ) (C {<test_atom>} {<'refs/tags/signed-long'>} {<contents>} {(DQ <'subject line\n'> <'\n'> <'body contents\n'> ($ Id.VSub_DollarName '$sig'))} ) (command.Simple words: [{<cat>}] redirects: [ (redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expected>}) (redir op: <Id.Redir_DLess '<<'> loc: (redir_loc.Fd fd:0) arg: (redir_param.HereDoc here_begin: {<EOF>} here_end_span_id: 2411 stdin_parts: [ (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<git>} {<rev-parse>} {<'refs/tags/bogo'>}) ) <' <committer@example.com> refs/tags/bogo\n'> (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<git>} {<rev-parse>} {<'refs/tags/master'>}) ) <' <committer@example.com> refs/tags/master\n'> ] ) ) ] do_fork: T ) (C {<test_expect_success>} {(SQ <'Verify sort with multiple keys'>)} { (SQ <'\n'> < '\tgit for-each-ref --format="%(objectname) %(taggeremail) %(refname)" --sort=objectname --sort=taggeremail \\\n' > <'\t\trefs/tags/bogo refs/tags/master > actual &&\n'> <'\ttest_cmp expected actual\n'> ) } ) (C {<test_done>}) ] )