(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 commit notes organized in subtrees'>)} spids: [12] ) ] spids: [12] ) (C {(.)} {(./test-lib.sh)}) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:number_of_commits spids:[23]) op: Equal rhs: {(100)} spids: [23] ) ] spids: [23] ) (command.FuncDef name: start_note_commit body: (command.BraceGroup children: [ (command.AndOr ops: [Op_DAmp] children: [ (C {(test_tick)}) (command.SimpleCommand words: [{(cat)}] redirects: [ (redir.HereDoc op: <Redir_DLess '<<'> fd: 16777215 here_begin: {(INPUT_END)} here_end_span_id: 60 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') ('from refs/notes/commits^0\n') ('deleteall\n') ] ) ] ) ] ) ] spids: [32] ) spids: [27 31] ) (command.FuncDef name: verify_notes body: (command.BraceGroup children: [ (command.AndOr ops: [Op_DAmp Op_DAmp Op_DAmp] children: [ (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:[92]) op: Equal rhs: {($ VSub_Name '$number_of_commits')} spids: [92] ) ] spids: [92] ) (command.WhileUntil keyword: <KW_While while> cond: [ (command.Sentence child: (C {(Lit_Other '[')} {($ VSub_Name '$i')} {(-gt)} {(0)} {(Lit_Other ']')}) terminator: <Op_Semi ';'> ) ] body: (command.DoGroup children: [ (command.Sentence child: (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:[134]) 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: [135 140] ) } spids: [134] ) ] spids: [134] ) ] ) terminator: <Op_Semi ';'> ) ] spids: [111 144] ) redirects: [(redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(expect)})] ) (C {(test_cmp)} {(expect)} {(output)}) ] ) ] spids: [70] ) spids: [65 69] ) (C {(test_expect_success)} {(DQ ('setup: create ') ($ VSub_Name '$number_of_commits') (' commits'))} { (SQ <'\n'> <'\n'> <'\t(\n'> <'\t\tnr=0 &&\n'> <'\t\twhile [ $nr -lt $number_of_commits ]; do\n'> <'\t\t\tnr=$(($nr+1)) &&\n'> <'\t\t\ttest_tick &&\n'> <'\t\t\tcat <<INPUT_END\n'> <'commit refs/heads/master\n'> <'committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE\n'> <'data <<COMMIT\n'> <'commit #$nr\n'> <'COMMIT\n'> <'\n'> <'M 644 inline file\n'> <'data <<EOF\n'> <'file in commit #$nr\n'> <'EOF\n'> <'\n'> <'INPUT_END\n'> <'\n'> <'\t\tdone &&\n'> <'\t\ttest_tick &&\n'> <'\t\tcat <<INPUT_END\n'> <'commit refs/notes/commits\n'> <'committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE\n'> <'data <<COMMIT\n'> <'no notes\n'> <'COMMIT\n'> <'\n'> <'deleteall\n'> <'\n'> <'INPUT_END\n'> <'\n'> <'\t) |\n'> <'\tgit fast-import --quiet &&\n'> <'\tgit config core.notesRef refs/notes/commits\n'> ) } ) (command.FuncDef name: test_sha1_based body: (command.BraceGroup children: [ (command.Pipeline children: [ (command.Subshell child: (command.AndOr ops: [Op_DAmp Op_DAmp] children: [ (C {(start_note_commit)}) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:nr spids:[227]) op: Equal rhs: {($ VSub_Name '$number_of_commits')} spids: [227] ) ] spids: [227] ) (command.Pipeline children: [ (C {(git)} {(rev-list)} {(refs/heads/master)}) (command.WhileUntil keyword: <KW_While while> cond: [ (command.Sentence child: (C {(read)} {(sha1)}) terminator: <Op_Semi ';'> ) ] body: (command.DoGroup children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:note_path spids:[252]) op: Equal rhs: { (word_part.CommandSubPart command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {(echo)} {(DQ ($ VSub_Name '$sha1'))}) (C {(sed)} {(DQ ($ VSub_Number '$1'))}) ] negated: F ) ] ) left_token: <Left_CommandSub '$('> spids: [253 267] ) } spids: [252] ) ] spids: [252] ) (command.AndOr ops: [Op_DAmp] children: [ (command.SimpleCommand words: [{(cat)}] redirects: [ (redir.HereDoc op: <Redir_DLess '<<'> fd: 16777215 here_begin: {(INPUT_END)} here_end_span_id: 287 stdin_parts: [ ('M 100644 inline ') ($ VSub_Name '$note_path') ('\n') ('data <<EOF\n') ('note for commit #') ($ VSub_Name '$nr') ('\n') ('EOF\n') ('\n') ] ) ] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:nr spids:[290]) op: Equal rhs: { (word_part.ArithSubPart anode: (arith_expr.ArithBinary op_id: Arith_Minus left: (arith_expr.ArithWord w: {($ VSub_Name '$nr')} ) right: (arith_expr.ArithWord w: {(Lit_Digits 1)} ) ) spids: [291 296] ) } spids: [290] ) ] spids: [290] ) ] ) ] spids: [249 299] ) ) ] negated: F ) ] ) spids: [219 302] ) (C {(git)} {(fast-import)} {(--quiet)}) ] negated: F ) ] spids: [216] ) spids: [211 215] ) (C {(test_expect_success)} {(SQ <'test notes in 2/38-fanout'>)} {(SQ <'test_sha1_based "s|^..|&/|"'>)} ) (C {(test_expect_success)} {(SQ <'verify notes in 2/38-fanout'>)} {(SQ <verify_notes>)}) (C {(test_expect_success)} {(SQ <'test notes in 2/2/36-fanout'>)} {(SQ <'test_sha1_based "s|^\\(..\\)\\(..\\)|\\1/\\2/|"'>)} ) (C {(test_expect_success)} {(SQ <'verify notes in 2/2/36-fanout'>)} {(SQ <verify_notes>)}) (C {(test_expect_success)} {(SQ <'test notes in 2/2/2/34-fanout'>)} {(SQ <'test_sha1_based "s|^\\(..\\)\\(..\\)\\(..\\)|\\1/\\2/\\3/|"'>)} ) (C {(test_expect_success)} {(SQ <'verify notes in 2/2/2/34-fanout'>)} {(SQ <verify_notes>)}) (command.FuncDef name: test_same_notes body: (command.BraceGroup children: [ (command.Pipeline children: [ (command.Subshell child: (command.AndOr ops: [Op_DAmp Op_DAmp] children: [ (C {(start_note_commit)}) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:nr spids:[395]) op: Equal rhs: {($ VSub_Name '$number_of_commits')} spids: [395] ) ] spids: [395] ) (command.Pipeline children: [ (C {(git)} {(rev-list)} {(refs/heads/master)}) (command.WhileUntil keyword: <KW_While while> cond: [ (command.Sentence child: (C {(read)} {(sha1)}) terminator: <Op_Semi ';'> ) ] body: (command.DoGroup children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:first_note_path spids:[420]) op: Equal rhs: { (word_part.CommandSubPart command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {(echo)} {(DQ ($ VSub_Name '$sha1'))}) (C {(sed)} {(DQ ($ VSub_Number '$1'))}) ] negated: F ) ] ) left_token: <Left_CommandSub '$('> spids: [421 435] ) } spids: [420] ) ] spids: [420] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:second_note_path spids:[438]) op: Equal rhs: { (word_part.CommandSubPart command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {(echo)} {(DQ ($ VSub_Name '$sha1'))}) (C {(sed)} {(DQ ($ VSub_Number '$2'))}) ] negated: F ) ] ) left_token: <Left_CommandSub '$('> spids: [439 453] ) } spids: [438] ) ] spids: [438] ) (command.AndOr ops: [Op_DAmp] children: [ (command.SimpleCommand words: [{(cat)}] redirects: [ (redir.HereDoc op: <Redir_DLess '<<'> fd: 16777215 here_begin: {(INPUT_END)} here_end_span_id: 482 stdin_parts: [ ('M 100644 inline ') ($ VSub_Name '$second_note_path') ('\n') ('data <<EOF\n') ('note for commit #') ($ VSub_Name '$nr') ('\n') ('EOF\n') ('\n') ('M 100644 inline ') ($ VSub_Name '$first_note_path') ('\n') ('data <<EOF\n') ('note for commit #') ($ VSub_Name '$nr') ('\n') ('EOF\n') ('\n') ] ) ] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:nr spids:[485]) op: Equal rhs: { (word_part.ArithSubPart anode: (arith_expr.ArithBinary op_id: Arith_Minus left: (arith_expr.ArithWord w: {($ VSub_Name '$nr')} ) right: (arith_expr.ArithWord w: {(Lit_Digits 1)} ) ) spids: [486 491] ) } spids: [485] ) ] spids: [485] ) ] ) ] spids: [417 494] ) ) ] negated: F ) ] ) spids: [387 497] ) (C {(git)} {(fast-import)} {(--quiet)}) ] negated: F ) ] spids: [384] ) spids: [379 383] ) (C {(test_expect_success)} {(SQ <'test same notes in no fanout and 2/38-fanout'>)} {(SQ <'test_same_notes "s|^..|&/|" ""'>)} ) (C {(test_expect_success)} {(SQ <'verify same notes in no fanout and 2/38-fanout'>)} {(SQ <verify_notes>)} ) (C {(test_expect_success)} {(SQ <'test same notes in no fanout and 2/2/36-fanout'>)} {(SQ <'test_same_notes "s|^\\(..\\)\\(..\\)|\\1/\\2/|" ""'>)} ) (C {(test_expect_success)} {(SQ <'verify same notes in no fanout and 2/2/36-fanout'>)} {(SQ <verify_notes>)} ) (C {(test_expect_success)} {(SQ <'test same notes in 2/38-fanout and 2/2/36-fanout'>)} {(SQ <'test_same_notes "s|^\\(..\\)\\(..\\)|\\1/\\2/|" "s|^..|&/|"'>)} ) (C {(test_expect_success)} {(SQ <'verify same notes in 2/38-fanout and 2/2/36-fanout'>)} {(SQ <verify_notes>)} ) (C {(test_expect_success)} {(SQ <'test same notes in 2/2/2/34-fanout and 2/2/36-fanout'>)} { (SQ < 'test_same_notes "s|^\\(..\\)\\(..\\)|\\1/\\2/|" "s|^\\(..\\)\\(..\\)\\(..\\)|\\1/\\2/\\3/|"' > ) } ) (C {(test_expect_success)} {(SQ <'verify same notes in 2/2/2/34-fanout and 2/2/36-fanout'>)} {(SQ <verify_notes>)} ) (command.FuncDef name: test_concatenated_notes body: (command.BraceGroup children: [ (command.Pipeline children: [ (command.Subshell child: (command.AndOr ops: [Op_DAmp Op_DAmp] children: [ (C {(start_note_commit)}) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:nr spids:[611]) op: Equal rhs: {($ VSub_Name '$number_of_commits')} spids: [611] ) ] spids: [611] ) (command.Pipeline children: [ (C {(git)} {(rev-list)} {(refs/heads/master)}) (command.WhileUntil keyword: <KW_While while> cond: [ (command.Sentence child: (C {(read)} {(sha1)}) terminator: <Op_Semi ';'> ) ] body: (command.DoGroup children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:first_note_path spids:[636]) op: Equal rhs: { (word_part.CommandSubPart command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {(echo)} {(DQ ($ VSub_Name '$sha1'))}) (C {(sed)} {(DQ ($ VSub_Number '$1'))}) ] negated: F ) ] ) left_token: <Left_CommandSub '$('> spids: [637 651] ) } spids: [636] ) ] spids: [636] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:second_note_path spids:[654]) op: Equal rhs: { (word_part.CommandSubPart command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {(echo)} {(DQ ($ VSub_Name '$sha1'))}) (C {(sed)} {(DQ ($ VSub_Number '$2'))}) ] negated: F ) ] ) left_token: <Left_CommandSub '$('> spids: [655 669] ) } spids: [654] ) ] spids: [654] ) (command.AndOr ops: [Op_DAmp] children: [ (command.SimpleCommand words: [{(cat)}] redirects: [ (redir.HereDoc op: <Redir_DLess '<<'> fd: 16777215 here_begin: {(INPUT_END)} here_end_span_id: 698 stdin_parts: [ ('M 100644 inline ') ($ VSub_Name '$second_note_path') ('\n') ('data <<EOF\n') ('second note for commit #') ($ VSub_Name '$nr') ('\n') ('EOF\n') ('\n') ('M 100644 inline ') ($ VSub_Name '$first_note_path') ('\n') ('data <<EOF\n') ('first note for commit #') ($ VSub_Name '$nr') ('\n') ('EOF\n') ('\n') ] ) ] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:nr spids:[701]) op: Equal rhs: { (word_part.ArithSubPart anode: (arith_expr.ArithBinary op_id: Arith_Minus left: (arith_expr.ArithWord w: {($ VSub_Name '$nr')} ) right: (arith_expr.ArithWord w: {(Lit_Digits 1)} ) ) spids: [702 707] ) } spids: [701] ) ] spids: [701] ) ] ) ] spids: [633 710] ) ) ] negated: F ) ] ) spids: [603 713] ) (C {(git)} {(fast-import)} {(--quiet)}) ] negated: F ) ] spids: [600] ) spids: [595 599] ) (command.FuncDef name: verify_concatenated_notes body: (command.BraceGroup children: [ (command.AndOr ops: [Op_DAmp Op_DAmp Op_DAmp] children: [ (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:[754]) op: Equal rhs: {($ VSub_Name '$number_of_commits')} spids: [754] ) ] spids: [754] ) (command.WhileUntil keyword: <KW_While while> cond: [ (command.Sentence child: (C {(Lit_Other '[')} {($ VSub_Name '$i')} {(-gt)} {(0)} {(Lit_Other ']')}) terminator: <Op_Semi ';'> ) ] body: (command.DoGroup children: [ (command.Sentence child: (command.AndOr ops: [Op_DAmp Op_DAmp Op_DAmp Op_DAmp] children: [ (C {(echo)} {(DQ (' commit #') ($ VSub_Name '$i'))}) (C {(echo)} {(DQ (' first note for commit #') ($ VSub_Name '$i'))}) (C {(echo)} {(DQ (' '))}) (C {(echo)} {(DQ (' second note for commit #') ($ VSub_Name '$i'))}) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:i spids:[815]) 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: [816 821] ) } spids: [815] ) ] spids: [815] ) ] ) terminator: <Op_Semi ';'> ) ] spids: [773 825] ) redirects: [(redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(expect)})] ) (C {(test_cmp)} {(expect)} {(output)}) ] ) ] spids: [732] ) spids: [727 731] ) (C {(test_expect_success)} {(SQ <'test notes in no fanout concatenated with 2/38-fanout'>)} {(SQ <'test_concatenated_notes "s|^..|&/|" ""'>)} ) (C {(test_expect_success)} {(SQ <'verify notes in no fanout concatenated with 2/38-fanout'>)} {(SQ <verify_concatenated_notes>)} ) (C {(test_expect_success)} {(SQ <'test notes in no fanout concatenated with 2/2/36-fanout'>)} {(SQ <'test_concatenated_notes "s|^\\(..\\)\\(..\\)|\\1/\\2/|" ""'>)} ) (C {(test_expect_success)} {(SQ <'verify notes in no fanout concatenated with 2/2/36-fanout'>)} {(SQ <verify_concatenated_notes>)} ) (C {(test_expect_success)} {(SQ <'test notes in 2/38-fanout concatenated with 2/2/36-fanout'>)} {(SQ <'test_concatenated_notes "s|^\\(..\\)\\(..\\)|\\1/\\2/|" "s|^..|&/|"'>)} ) (C {(test_expect_success)} {(SQ <'verify notes in 2/38-fanout concatenated with 2/2/36-fanout'>)} {(SQ <verify_concatenated_notes>)} ) (C {(test_expect_success)} {(SQ <'test notes in 2/2/36-fanout concatenated with 2/2/2/34-fanout'>)} { (SQ < 'test_concatenated_notes "s|^\\(..\\)\\(..\\)\\(..\\)|\\1/\\2/\\3/|" "s|^\\(..\\)\\(..\\)|\\1/\\2/|"' > ) } ) (C {(test_expect_success)} {(SQ <'verify notes in 2/2/36-fanout concatenated with 2/2/2/34-fanout'>)} {(SQ <verify_concatenated_notes>)} ) (C {(test_done)}) ] )