(command.CommandList children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:test_description spids:[21]) op: Equal rhs: {(SQ <'Test commit notes index (expensive!)'>)} spids: [21] ) ] spids: [21] ) (C {(.)} {(./test-lib.sh)}) (command.FuncDef name: create_repo body: (command.BraceGroup children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:number_of_commits spids:[40]) op: Equal rhs: {($ VSub_Number '$1')} spids: [40] ) ] spids: [40] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:nr spids:[44]) op: Equal rhs: {(0)} spids: [44] ) ] spids: [44] ) (command.AndOr ops: [Op_DPipe] children: [ (C {(test)} {(-d)} {(.git)}) (command.BraceGroup children: [ (command.AndOr ops: [Op_DAmp Op_DAmp] children: [ (C {(git)} {(init)}) (command.Pipeline children: [ (command.Subshell child: (command.AndOr ops: [Op_DAmp Op_DAmp Op_DAmp] children: [ (command.WhileUntil keyword: <KW_While while> cond: [ (C {(test)} {($ VSub_Name '$nr')} {(-lt)} {($ VSub_Name '$number_of_commits')} ) ] body: (command.DoGroup children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:nr spids:[83]) op: Equal rhs: { (word_part.ArithSubPart anode: (arith_expr.ArithBinary op_id: Arith_Plus left: (arith_expr.ArithWord w: {($ VSub_Name '$nr')} ) right: (arith_expr.ArithWord w: {(Lit_Digits 1)} ) ) spids: [84 89] ) } spids: [83] ) ] spids: [83] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:mark spids:[92]) op: Equal rhs: { (word_part.ArithSubPart anode: (arith_expr.ArithBinary op_id: Arith_Plus left: (arith_expr.ArithWord w: {($ VSub_Name '$nr')} ) right: (arith_expr.ArithWord w: {($ VSub_Name '$nr')} ) ) spids: [93 98] ) } spids: [92] ) ] spids: [92] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:notemark spids:[101]) op: Equal rhs: { (word_part.ArithSubPart anode: (arith_expr.ArithBinary op_id: Arith_Plus left: (arith_expr.ArithWord w: {($ VSub_Name '$mark')} ) right: (arith_expr.ArithWord w: {(Lit_Digits 1)} ) ) spids: [102 107] ) } spids: [101] ) ] spids: [101] ) (command.AndOr ops: [Op_DAmp Op_DAmp] children: [ (C {(test_tick)}) (command.SimpleCommand words: [{(cat)}] redirects: [ (redir.HereDoc op: <Redir_DLessDash '<<-'> fd: 16777215 here_begin: {(INPUT_END)} here_end_span_id: 157 stdin_parts: [ ('commit refs/heads/master\n') ('mark :') ($ VSub_Name '$mark') ('\n') ('committer ') ($ VSub_Name '$GIT_COMMITTER_NAME') (' <') ($ VSub_Name '$GIT_COMMITTER_EMAIL') ('> ') ($ VSub_Name '$GIT_COMMITTER_DATE') ('\n') ('data <<COMMIT\n') ('commit #') ($ VSub_Name '$nr') ('\n') ('COMMIT\n') ('\n') ('M 644 inline file\n') ('data <<EOF\n') ('file in commit #') ($ VSub_Name '$nr') ('\n') ('EOF\n') ('\n') ('blob\n') ('mark :') ($ VSub_Name '$notemark') ('\n') ('data <<EOF\n') ('note for commit #') ($ VSub_Name '$nr') ('\n') ('EOF\n') ('\n') ] ) ] ) (command.SimpleCommand words: [ {(echo)} { (DQ ('N :') ($ VSub_Name '$notemark') (' :') ($ VSub_Name '$mark') ) } ] redirects: [ (redir.Redir op: <Redir_DGreat '>>'> fd: 16777215 arg_word: {(note_commit)} ) ] ) ] ) ] spids: [80 172] ) ) (C {(test_tick)}) (command.SimpleCommand words: [{(cat)}] redirects: [ (redir.HereDoc op: <Redir_DLessDash '<<-'> fd: 16777215 here_begin: {(INPUT_END)} here_end_span_id: 202 stdin_parts: [ ('commit refs/notes/commits\n') ('committer ') ($ VSub_Name '$GIT_COMMITTER_NAME') (' <') ($ VSub_Name '$GIT_COMMITTER_EMAIL') ('> ') ($ VSub_Name '$GIT_COMMITTER_DATE') ('\n') ('data <<COMMIT\n') ('notes\n') ('COMMIT\n') ('\n') ] ) ] ) (C {(cat)} {(note_commit)}) ] ) spids: [66 210] ) (C {(git)} {(fast-import)} {(--quiet)}) ] negated: F ) (C {(git)} {(config)} {(core.notesRef)} {(refs/notes/commits)}) ] ) ] spids: [56] ) ] ) ] spids: [37] ) spids: [32 36] ) (command.FuncDef name: test_notes body: (command.BraceGroup children: [ (command.AndOr ops: [Op_DAmp Op_DAmp Op_DAmp Op_DAmp Op_DAmp] children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:count spids:[246]) op: Equal rhs: {($ VSub_Number '$1')} spids: [246] ) ] spids: [246] ) (C {(git)} {(config)} {(core.notesRef)} {(refs/notes/commits)}) (command.Pipeline children: [ (C {(git)} {(log)}) (command.SimpleCommand words: [{(grep)} {(DQ ('^ '))}] redirects: [(redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(output)})] ) ] negated: F ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:i spids:[281]) op: Equal rhs: {($ VSub_Name '$count')} spids: [281] ) ] spids: [281] ) (command.WhileUntil keyword: <KW_While while> cond: [(C {(test)} {($ VSub_Name '$i')} {(-gt)} {(0)})] body: (command.DoGroup children: [ (command.AndOr ops: [Op_DAmp Op_DAmp] children: [ (C {(echo)} {(DQ (' commit #') ($ VSub_Name '$i'))}) (C {(echo)} {(DQ (' note for commit #') ($ VSub_Name '$i'))}) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:i spids:[321]) op: Equal rhs: { (word_part.ArithSubPart anode: (arith_expr.ArithBinary op_id: Arith_Minus left: (arith_expr.ArithWord w:{($ VSub_Name '$i')}) right: (arith_expr.ArithWord w:{(Lit_Digits 1)}) ) spids: [322 327] ) } spids: [321] ) ] spids: [321] ) ] ) ] spids: [298 330] ) redirects: [(redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(expect)})] ) (C {(test_cmp)} {(expect)} {(output)}) ] ) ] spids: [243] ) spids: [238 242] ) (command.SimpleCommand words: [{(write_script)} {(time_notes)}] redirects: [ (redir.HereDoc op: <Redir_DLess '<<'> fd: 16777215 here_begin: {(word_part.EscapedLiteralPart token:<Lit_EscapedChar '\\E'>) (OF)} here_end_span_id: 371 stdin_parts: [ ('\tmode=$1\n') ('\ti=1\n') ('\twhile test $i -lt $2\n') ('\tdo\n') ('\t\tcase $1 in\n') ('\t\tno-notes)\n') ('\t\t\tGIT_NOTES_REF=non-existing\n') ('\t\t\texport GIT_NOTES_REF\n') ('\t\t\t;;\n') ('\t\tnotes)\n') ('\t\t\tunset GIT_NOTES_REF\n') ('\t\t\t;;\n') ('\t\tesac\n') ('\t\tgit log\n') ('\t\ti=$(($i+1))\n') ('\tdone >/dev/null\n') ] ) ] ) (command.FuncDef name: time_notes body: (command.BraceGroup children: [ (command.ForEach iter_name: mode iter_words: [{(no-notes)} {(notes)}] do_arg_iter: F body: (command.DoGroup children: [ (C {(echo)} {($ VSub_Name '$mode')}) (C {(/usr/bin/time)} {(../time_notes)} {($ VSub_Name '$mode')} {($ VSub_Number '$1')}) ] spids: [392 409] ) spids: [386 16777215] ) ] spids: [378] ) spids: [373 377] ) (command.FuncDef name: do_tests body: (command.BraceGroup children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:count spids:[422]) op: Equal rhs: {($ VSub_Number '$1')} spids: [422] ) (assign_pair lhs: (lhs_expr.LhsName name:pr spids:[425]) op: Equal rhs: { (word_part.BracedVarSub token: <VSub_Number 2> suffix_op: (suffix_op.StringUnary op_id:VTest_Hyphen arg_word:{}) spids: [426 429] ) } spids: [425] ) ] spids: [422] ) (C {(test_expect_success)} {($ VSub_Name '$pr')} {(DQ ('setup ') ($ VSub_Name '$count'))} { (SQ <'\n'> <'\t\tmkdir "$count" &&\n'> <'\t\t(\n'> <'\t\t\tcd "$count" &&\n'> <'\t\t\tcreate_repo "$count"\n'> <'\t\t)\n'> <'\t'> ) } ) (C {(test_expect_success)} {($ VSub_Name '$pr')} {(SQ <'notes work'>)} { (SQ <'\n'> <'\t\t(\n'> <'\t\t\tcd "$count" &&\n'> <'\t\t\ttest_notes "$count"\n'> <'\t\t)\n'> <'\t'> ) } ) (C {(test_expect_success)} { (DQ (USR_BIN_TIME) (word_part.BracedVarSub token: <VSub_Name pr> suffix_op: (suffix_op.StringUnary op_id: VTest_ColonPlus arg_word: {(',') ($ VSub_Name '$pr')} ) spids: [477 482] ) ) } {(SQ <'notes timing with /usr/bin/time'>)} { (SQ <'\n'> <'\t\t(\n'> <'\t\t\tcd "$count" &&\n'> <'\t\t\ttime_notes 100\n'> <'\t\t)\n'> <'\t'> ) } ) ] spids: [419] ) spids: [414 418] ) (C {(do_tests)} {(10)}) (command.ForEach iter_name: count iter_words: [{(100)} {(1000)} {(10000)}] do_arg_iter: F body: (command.DoGroup children: [(C {(do_tests)} {(DQ ($ VSub_Name '$count'))} {(EXPENSIVE)})] spids: [517 528] ) spids: [510 16777215] ) (C {(test_done)}) ] )