(command.CommandList children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:test_description spids:[21]) op: Equal rhs: {(SQ <'for-each-ref test'>)} spids: [21] ) ] spids: [21] ) (C {(.)} {(./test-lib.sh)}) (C {(.)} {(DQ ($ VSub_Name '$TEST_DIRECTORY')) (/lib-gpg.sh)}) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:datestamp spids:[42]) op: Equal rhs: {(1151968723)} spids: [42] ) ] spids: [42] ) (command.FuncDef name: setdate_and_increment body: (command.BraceGroup children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:GIT_COMMITTER_DATE spids:[53]) op: Equal rhs: {(DQ ($ VSub_Name '$datestamp') (' +0200'))} spids: [53] ) ] spids: [53] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:datestamp spids:[60]) op: Equal rhs: { (word_part.CommandSubPart command_list: (command.CommandList children: [ (C {(expr)} {(DQ ($ VSub_Name '$datestamp'))} {(Lit_Other '+')} {(1)}) ] ) left_token: <Left_CommandSub '$('> spids: [61 71] ) } spids: [60] ) ] spids: [60] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:GIT_AUTHOR_DATE spids:[74]) op: Equal rhs: {(DQ ($ VSub_Name '$datestamp') (' +0200'))} spids: [74] ) ] spids: [74] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:datestamp spids:[81]) op: Equal rhs: { (word_part.CommandSubPart command_list: (command.CommandList children: [ (C {(expr)} {(DQ ($ VSub_Name '$datestamp'))} {(Lit_Other '+')} {(1)}) ] ) left_token: <Left_CommandSub '$('> spids: [82 92] ) } spids: [81] ) ] spids: [81] ) (C {(export)} {(GIT_COMMITTER_DATE)} {(GIT_AUTHOR_DATE)}) ] spids: [50] ) spids: [45 49] ) (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.FuncDef name: test_atom body: (command.BraceGroup children: [ (command.Case to_match: {(DQ ($ VSub_Number '$1'))} arms: [ (case_arm pat_list: [{(head)}] action: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:ref spids:[145]) op: Equal rhs: {(refs/heads/master)} spids: [145] ) ] spids: [145] ) ] spids: [142 143 148 16777215] ) (case_arm pat_list: [{(tag)}] action: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:ref spids:[154]) op: Equal rhs: {(refs/tags/testtag)} spids: [154] ) ] spids: [154] ) ] spids: [151 152 157 16777215] ) (case_arm pat_list: [{(Lit_Other '*')}] action: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:ref spids:[163]) op: Equal rhs: {($ VSub_Number '$1')} spids: [163] ) ] spids: [163] ) ] spids: [160 161 166 16777215] ) ] spids: [133 139 169] ) (command.SimpleCommand words: [{(printf)} {(SQ <'%s\\n'>)} {(DQ ($ VSub_Number '$3'))}] redirects: [(redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(expected)})] ) (C {(test_expect_) (word_part.BracedVarSub token: <VSub_Number 4> suffix_op: (suffix_op.StringUnary op_id:VTest_ColonHyphen arg_word:{(success)}) spids: [187 191] ) } {($ VSub_Name '$PREREQ')} {(DQ ('basic atom: ') ($ VSub_Number '$1') (' ') ($ VSub_Number '$2'))} { (DQ ('\n') ("\t\tgit for-each-ref --format='%(") ($ VSub_Number '$2') (")' ") ($ VSub_Name '$ref') (' >actual &&\n') ('\t\tsanitize_pgp <actual >actual.clean &&\n') ('\t\ttest_cmp expected actual.clean\n') ('\t') ) } ) ] spids: [130] ) spids: [126 129] ) (C {(test_atom)} {(head)} {(refname)} {(refs/heads/master)}) (C {(test_atom)} {(head)} {(refname) (Lit_Other ':') (short)} {(master)}) (C {(test_atom)} {(head)} {(refname) (Lit_Other ':') (Lit_VarLike 'strip=') (1)} {(heads/master)}) (C {(test_atom)} {(head)} {(refname) (Lit_Other ':') (Lit_VarLike 'strip=') (2)} {(master)}) (C {(test_atom)} {(head)} {(upstream)} {(refs/remotes/origin/master)}) (C {(test_atom)} {(head)} {(upstream) (Lit_Other ':') (short)} {(origin/master)}) (C {(test_atom)} {(head)} {(push)} {(refs/remotes/myfork/master)}) (C {(test_atom)} {(head)} {(push) (Lit_Other ':') (short)} {(myfork/master)}) (C {(test_atom)} {(head)} {(objecttype)} {(commit)}) (C {(test_atom)} {(head)} {(objectsize)} {(171)}) (C {(test_atom)} {(head)} {(objectname)} { (word_part.CommandSubPart command_list: (command.CommandList children: [(C {(git)} {(rev-parse)} {(refs/heads/master)})] ) left_token: <Left_CommandSub '$('> spids: [315 321] ) } ) (C {(test_atom)} {(head)} {(objectname) (Lit_Other ':') (short)} { (word_part.CommandSubPart command_list: (command.CommandList children: [(C {(git)} {(rev-parse)} {(--short)} {(refs/heads/master)})] ) left_token: <Left_CommandSub '$('> spids: [331 339] ) } ) (C {(test_atom)} {(head)} {(tree)} { (word_part.CommandSubPart command_list: (command.CommandList children: [ (C {(git)} {(rev-parse)} {(refs/heads/master) (Lit_Other '^') (Lit_LBrace '{') (tree) (Lit_RBrace '}')} ) ] ) left_token: <Left_CommandSub '$('> spids: [347 357] ) } ) (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) (Lit_Other ':') (subject)} {(SQ <Initial>)}) (C {(test_atom)} {(head)} {(body)} {(SQ )}) (C {(test_atom)} {(head)} {(contents) (Lit_Other ':') (body)} {(SQ )}) (C {(test_atom)} {(head)} {(contents) (Lit_Other ':') (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) (Lit_Other ':') (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)} { (word_part.CommandSubPart command_list: (command.CommandList children: [(C {(git)} {(rev-parse)} {(refs/tags/testtag)})] ) left_token: <Left_CommandSub '$('> spids: [693 699] ) } ) (C {(test_atom)} {(tag)} {(objectname) (Lit_Other ':') (short)} { (word_part.CommandSubPart command_list: (command.CommandList children: [(C {(git)} {(rev-parse)} {(--short)} {(refs/tags/testtag)})] ) left_token: <Left_CommandSub '$('> spids: [709 717] ) } ) (C {(test_atom)} {(tag)} {(tree)} {(SQ )}) (C {(test_atom)} {(tag)} {(parent)} {(SQ )}) (C {(test_atom)} {(tag)} {(numparent)} {(SQ )}) (C {(test_atom)} {(tag)} {(object)} { (word_part.CommandSubPart command_list: (command.CommandList children: [(C {(git)} {(rev-parse)} {(refs/tags/testtag) (Lit_Other '^') (0)})] ) left_token: <Left_CommandSub '$('> spids: [752 760] ) } ) (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) (Lit_Other ':') (subject)} {(SQ <'Tagging at 1151968727'>)}) (C {(test_atom)} {(tag)} {(body)} {(SQ )}) (C {(test_atom)} {(tag)} {(contents) (Lit_Other ':') (body)} {(SQ )}) (C {(test_atom)} {(tag)} {(contents) (Lit_Other ':') (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.FuncDef name: test_date body: (command.BraceGroup children: [ (command.AndOr ops: [Op_DAmp Op_DAmp Op_DAmp Op_DAmp Op_DAmp Op_DAmp] children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:f spids:[1102]) op: Equal rhs: {($ VSub_Number '$1')} spids: [1102] ) ] spids: [1102] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:committer_date spids:[1108]) op: Equal rhs: {($ VSub_Number '$2')} spids: [1108] ) ] spids: [1108] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:author_date spids:[1114]) op: Equal rhs: {($ VSub_Number '$3')} spids: [1114] ) ] spids: [1114] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:tagger_date spids:[1120]) op: Equal rhs: {($ VSub_Number '$4')} spids: [1120] ) ] spids: [1120] ) (command.SimpleCommand words: [{(cat)}] redirects: [ (redir.Redir op: <Redir_Great '>'> fd: 16777215 arg_word: {(expected)} ) (redir.HereDoc op: <Redir_DLessDash '<<-'> fd: 16777215 here_begin: {(EOF)} here_end_span_id: 1145 stdin_parts: [ ("'refs/heads/master' '") ($ VSub_Name '$committer_date') ("' '") ($ VSub_Name '$author_date') ("'\n") ("'refs/tags/testtag' '") ($ VSub_Name '$tagger_date') ("'\n") ] ) ] ) (command.Subshell child: (command.AndOr ops: [Op_DAmp] children: [ (C {(git)} {(for-each-ref)} {(--shell)} {(--format) (Lit_Other '=') (DQ ('%(refname) %(committerdate') (word_part.BracedVarSub token: <VSub_Name f> suffix_op: (suffix_op.StringUnary op_id: VTest_ColonPlus arg_word: {(':') ($ VSub_Name '$f')} ) spids: [1162 1167] ) (') %(authordate') (word_part.BracedVarSub token: <VSub_Name f> suffix_op: (suffix_op.StringUnary op_id: VTest_ColonPlus arg_word: {(':') ($ VSub_Name '$f')} ) spids: [1169 1174] ) (')') ) } {(refs/heads)} ) (C {(git)} {(for-each-ref)} {(--shell)} {(--format) (Lit_Other '=') (DQ ('%(refname) %(taggerdate') (word_part.BracedVarSub token: <VSub_Name f> suffix_op: (suffix_op.StringUnary op_id: VTest_ColonPlus arg_word: {(':') ($ VSub_Name '$f')} ) spids: [1197 1202] ) (')') ) } {(refs/tags)} ) ] ) redirects: [(redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(actual)})] spids: [1147 1211] ) (C {(test_cmp)} {(expected)} {(actual)}) ] ) ] spids: [1099] ) spids: [1094 1098] ) (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.SimpleCommand words: [{(cat)}] redirects: [ (redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(expected)}) (redir.HereDoc op: <Redir_DLess '<<'> fd: 16777215 here_begin: {(word_part.EscapedLiteralPart token:<Lit_EscapedChar '\\E'>) (OF)} here_end_span_id: 1493 stdin_parts: [ ('refs/heads/master\n') ('refs/remotes/origin/master\n') ('refs/tags/testtag\n') ] ) ] ) (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.SimpleCommand words: [{(cat)}] redirects: [ (redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(expected)}) (redir.HereDoc op: <Redir_DLess '<<'> fd: 16777215 here_begin: {(word_part.EscapedLiteralPart token:<Lit_EscapedChar '\\E'>) (OF)} here_end_span_id: 1521 stdin_parts: [ ('refs/tags/testtag\n') ('refs/remotes/origin/master\n') ('refs/heads/master\n') ] ) ] ) (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.SimpleCommand words: [{(cat)}] redirects: [ (redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(expected)}) (redir.HereDoc op: <Redir_DLess '<<'> fd: 16777215 here_begin: {(word_part.EscapedLiteralPart token:<Lit_EscapedChar '\\E'>) (OF)} here_end_span_id: 1548 stdin_parts: [ ("'refs/heads/master'\n") ("'refs/remotes/origin/master'\n") ("'refs/tags/testtag'\n") ] ) ] ) (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.SimpleCommand words: [{(cat)}] redirects: [ (redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(expected)}) (redir.HereDoc op: <Redir_DLess '<<'> fd: 16777215 here_begin: {(word_part.EscapedLiteralPart token:<Lit_EscapedChar '\\E'>) (OF)} here_end_span_id: 1601 stdin_parts: [ ('"refs/heads/master"\n') ('"refs/remotes/origin/master"\n') ('"refs/tags/testtag"\n') ] ) ] ) (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: ') ($ VSub_Name '$i'))} { (DQ ('\n') ('\t\tgit for-each-ref ') ($ VSub_Name '$i') (' 2>&1 | (read line &&\n') ('\t\tcase ') (word_part.EscapedLiteralPart token:<Lit_EscapedChar '\\$'>) ('line in\n') ('\t\t') (word_part.EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) ('error: more than one quoting style') (word_part.EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) ('*) : happy;;\n') ('\t\t*) false\n') ('\t\tesac)\n') ('\t') ) } ) ] spids: [1639 1667] ) spids: [1621 1637] ) (C {(test_expect_success)} {(SQ <'setup for upstream:track[short]'>)} {(SQ <'\n'> <'\ttest_commit two\n'>)} ) (C {(test_atom)} {(head)} {(upstream) (Lit_Other ':') (track)} {(SQ <'[ahead 1]'>)}) (C {(test_atom)} {(head)} {(upstream) (Lit_Other ':') (trackshort)} {(SQ <'>'>)}) (C {(test_atom)} {(head)} {(push) (Lit_Other ':') (track)} {(SQ <'[ahead 1]'>)}) (C {(test_atom)} {(head)} {(push) (Lit_Other ':') (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.FuncDef name: get_color body: (command.BraceGroup children: [(C {(git)} {(config)} {(--get-color)} {(no.such.slot)} {(DQ ($ VSub_Number '$1'))})] spids: [1782] ) spids: [1777 1781] ) (command.SimpleCommand words: [{(cat)}] redirects: [ (redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(expected)}) (redir.HereDoc op: <Redir_DLess '<<'> fd: 16777215 here_begin: {(EOF)} here_end_span_id: 1897 stdin_parts: [ (word_part.CommandSubPart command_list: (command.CommandList children: [(C {(git)} {(rev-parse)} {(--short)} {(refs/heads/master)})] ) left_token: <Left_CommandSub '$('> spids: [1808 1816] ) (' ') (word_part.CommandSubPart command_list: (command.CommandList children:[(C {(get_color)} {(green)})]) left_token: <Left_CommandSub '$('> spids: [1818 1822] ) (master) (word_part.CommandSubPart command_list: (command.CommandList children:[(C {(get_color)} {(reset)})]) left_token: <Left_CommandSub '$('> spids: [1824 1828] ) ('\n') (word_part.CommandSubPart command_list: (command.CommandList children: [(C {(git)} {(rev-parse)} {(--short)} {(refs/remotes/origin/master)})] ) left_token: <Left_CommandSub '$('> spids: [1830 1838] ) (' ') (word_part.CommandSubPart command_list: (command.CommandList children:[(C {(get_color)} {(green)})]) left_token: <Left_CommandSub '$('> spids: [1840 1844] ) (origin/master) (word_part.CommandSubPart command_list: (command.CommandList children:[(C {(get_color)} {(reset)})]) left_token: <Left_CommandSub '$('> spids: [1846 1850] ) ('\n') (word_part.CommandSubPart command_list: (command.CommandList children: [(C {(git)} {(rev-parse)} {(--short)} {(refs/tags/testtag)})] ) left_token: <Left_CommandSub '$('> spids: [1852 1860] ) (' ') (word_part.CommandSubPart command_list: (command.CommandList children:[(C {(get_color)} {(green)})]) left_token: <Left_CommandSub '$('> spids: [1862 1866] ) (testtag) (word_part.CommandSubPart command_list: (command.CommandList children:[(C {(get_color)} {(reset)})]) left_token: <Left_CommandSub '$('> spids: [1868 1872] ) ('\n') (word_part.CommandSubPart command_list: (command.CommandList children: [(C {(git)} {(rev-parse)} {(--short)} {(refs/tags/two)})] ) left_token: <Left_CommandSub '$('> spids: [1874 1882] ) (' ') (word_part.CommandSubPart command_list: (command.CommandList children:[(C {(get_color)} {(green)})]) left_token: <Left_CommandSub '$('> spids: [1884 1888] ) (two) (word_part.CommandSubPart command_list: (command.CommandList children:[(C {(get_color)} {(reset)})]) left_token: <Left_CommandSub '$('> spids: [1890 1894] ) ('\n') ] ) ] ) (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.SimpleCommand words: [{(cat)}] redirects: [ (redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(expected)}) (redir.HereDoc op: <Redir_DLess '<<'> fd: 16777215 here_begin: {(word_part.EscapedLiteralPart token:<Lit_EscapedChar '\\E'>) (OF)} here_end_span_id: 1923 stdin_parts: [('heads/master\n') ('tags/master\n')] ) ] ) (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.SimpleCommand words: [{(cat)}] redirects: [ (redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(expected)}) (redir.HereDoc op: <Redir_DLess '<<'> fd: 16777215 here_begin: {(word_part.EscapedLiteralPart token:<Lit_EscapedChar '\\E'>) (OF)} here_end_span_id: 1956 stdin_parts: [('heads/master\n') ('master\n')] ) ] ) (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.SimpleCommand words: [{(cat)}] redirects: [ (redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(expected)}) (redir.HereDoc op: <Redir_DLess '<<'> fd: 16777215 here_begin: {(word_part.EscapedLiteralPart token:<Lit_EscapedChar '\\E'>) (OF)} here_end_span_id: 1983 stdin_parts: [('heads/ambiguous\n') ('ambiguous\n')] ) ] ) (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) (Lit_Other ':') (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) (Lit_Other ':') (body)} {(SQ <'first body line\n'> <'second body line\n'>)} ) (C {(test_atom)} {(refs/tags/multiline)} {(contents) (Lit_Other ':') (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.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:sig spids:[2182]) op: Equal rhs: {(SQ <'-----BEGIN PGP SIGNATURE-----\n'> <'-----END PGP SIGNATURE-----\n'>)} spids: [2182] ) ] spids: [2182] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:PREREQ spids:[2189]) op: Equal rhs: {(GPG)} spids: [2189] ) ] spids: [2189] ) (C {(test_atom)} {(refs/tags/signed-empty)} {(subject)} {(SQ )}) (C {(test_atom)} {(refs/tags/signed-empty)} {(contents) (Lit_Other ':') (subject)} {(SQ )}) (C {(test_atom)} {(refs/tags/signed-empty)} {(body)} {(DQ ($ VSub_Name '$sig'))}) (C {(test_atom)} {(refs/tags/signed-empty)} {(contents) (Lit_Other ':') (body)} {(SQ )}) (C {(test_atom)} {(refs/tags/signed-empty)} {(contents) (Lit_Other ':') (signature)} {(DQ ($ VSub_Name '$sig'))} ) (C {(test_atom)} {(refs/tags/signed-empty)} {(contents)} {(DQ ($ VSub_Name '$sig'))}) (C {(test_atom)} {(refs/tags/signed-short)} {(subject)} {(SQ <'subject line'>)}) (C {(test_atom)} {(refs/tags/signed-short)} {(contents) (Lit_Other ':') (subject)} {(SQ <'subject line'>)} ) (C {(test_atom)} {(refs/tags/signed-short)} {(body)} {(DQ ($ VSub_Name '$sig'))}) (C {(test_atom)} {(refs/tags/signed-short)} {(contents) (Lit_Other ':') (body)} {(SQ )}) (C {(test_atom)} {(refs/tags/signed-short)} {(contents) (Lit_Other ':') (signature)} {(DQ ($ VSub_Name '$sig'))} ) (C {(test_atom)} {(refs/tags/signed-short)} {(contents)} {(DQ ('subject line\n') ($ VSub_Name '$sig'))} ) (C {(test_atom)} {(refs/tags/signed-long)} {(subject)} {(SQ <'subject line'>)}) (C {(test_atom)} {(refs/tags/signed-long)} {(contents) (Lit_Other ':') (subject)} {(SQ <'subject line'>)} ) (C {(test_atom)} {(refs/tags/signed-long)} {(body)} {(DQ ('body contents\n') ($ VSub_Name '$sig'))}) (C {(test_atom)} {(refs/tags/signed-long)} {(contents) (Lit_Other ':') (body)} {(SQ <'body contents\n'>)} ) (C {(test_atom)} {(refs/tags/signed-long)} {(contents) (Lit_Other ':') (signature)} {(DQ ($ VSub_Name '$sig'))} ) (C {(test_atom)} {(refs/tags/signed-long)} {(contents)} {(DQ ('subject line\n') ('\n') ('body contents\n') ($ VSub_Name '$sig'))} ) (command.SimpleCommand words: [{(cat)}] redirects: [ (redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(expected)}) (redir.HereDoc op: <Redir_DLess '<<'> fd: 16777215 here_begin: {(EOF)} here_end_span_id: 2419 stdin_parts: [ (word_part.CommandSubPart command_list: (command.CommandList children: [(C {(git)} {(rev-parse)} {(refs/tags/bogo)})] ) left_token: <Left_CommandSub '$('> spids: [2402 2408] ) (' <committer@example.com> refs/tags/bogo\n') (word_part.CommandSubPart command_list: (command.CommandList children: [(C {(git)} {(rev-parse)} {(refs/tags/master)})] ) left_token: <Left_CommandSub '$('> spids: [2410 2416] ) (' <committer@example.com> refs/tags/master\n') ] ) ] ) (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)}) ] )