(command.CommandList children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:test_description) op: assign_op.Equal rhs: {(SQ <'Test commit notes organized in subtrees'>)} spids: [4] ) ] ) (C {<.>} {<'./test-lib.sh'>}) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:number_of_commits) op: assign_op.Equal rhs: {<100>} spids: [15] ) ] ) (command.ShFunction name: start_note_commit body: (BraceGroup children: [ (command.AndOr ops: [Id.Op_DAmp] children: [ (C {<test_tick>}) (command.Simple words: [{<cat>}] redirects: [ (redir op: <Id.Redir_DLess '<<'> loc: (redir_loc.Fd fd:0) arg: (redir_param.HereDoc here_begin: {<INPUT_END>} here_end_span_id: 52 stdin_parts: [ <'commit refs/notes/commits\n'> <'committer '> ($ Id.VSub_DollarName '$GIT_COMMITTER_NAME') <' <'> ($ Id.VSub_DollarName '$GIT_COMMITTER_EMAIL') <'> '> ($ Id.VSub_DollarName '$GIT_COMMITTER_DATE') <'\n'> <'data <<COMMIT\n'> <'notes\n'> <'COMMIT\n'> <'\n'> <'from refs/notes/commits^0\n'> <'deleteall\n'> ] ) ) ] do_fork: T ) ] ) ] ) ) (command.ShFunction name: verify_notes body: (BraceGroup children: [ (command.AndOr ops: [Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp] children: [ (command.Pipeline children: [ (C {<git>} {<log>}) (command.Simple words: [{<grep>} {(DQ <'^ '>)}] redirects: [ (redir op: <Id.Redir_Great '>'> loc: (redir_loc.Fd fd:1) arg: {<output>} ) ] do_fork: T ) ] negated: F ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:i) op: assign_op.Equal rhs: {($ Id.VSub_DollarName '$number_of_commits')} spids: [84] ) ] ) (command.WhileUntil keyword: <Id.KW_While while> cond: (condition.Shell commands: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} {($ Id.VSub_DollarName '$i')} {<-gt>} {<0>} {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] ) body: (command.DoGroup children: [ (command.Sentence child: (command.AndOr ops: [Id.Op_DAmp Id.Op_DAmp] children: [ (C {<echo>} {(DQ <' commit #'> ($ Id.VSub_DollarName '$i'))}) (C {<echo>} {(DQ <' note for commit #'> ($ Id.VSub_DollarName '$i'))}) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:i) op: assign_op.Equal rhs: { (word_part.ArithSub anode: (arith_expr.Binary op_id: Id.Arith_Minus left: {($ Id.VSub_DollarName '$i')} right: {<Id.Lit_Digits 1>} ) ) } spids: [126] ) ] ) ] ) terminator: <Id.Op_Semi _> ) ] ) redirects: [(redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expect>})] ) (C {<test_cmp>} {<expect>} {<output>}) ] ) ] ) ) (C {<test_expect_success>} {(DQ <'setup: create '> ($ Id.VSub_DollarName '$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.ShFunction name: test_sha1_based body: (BraceGroup children: [ (command.Pipeline children: [ (command.Subshell child: (command.AndOr ops: [Id.Op_DAmp Id.Op_DAmp] children: [ (C {<start_note_commit>}) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:nr) op: assign_op.Equal rhs: {($ Id.VSub_DollarName '$number_of_commits')} spids: [219] ) ] ) (command.Pipeline children: [ (C {<git>} {<rev-list>} {<'refs/heads/master'>}) (command.WhileUntil keyword: <Id.KW_While while> cond: (condition.Shell commands: [ (command.Sentence child: (C {<read>} {<sha1>}) terminator: <Id.Op_Semi _> ) ] ) body: (command.DoGroup children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:note_path) op: assign_op.Equal rhs: { (command_sub left_token: <Id.Left_DollarParen '$('> child: (command.Pipeline children: [ (C {<echo>} {(DQ ($ Id.VSub_DollarName '$sha1'))}) (C {<sed>} {(DQ ($ Id.VSub_Number '$1'))}) ] negated: F ) ) } spids: [244] ) ] ) (command.AndOr ops: [Id.Op_DAmp] children: [ (command.Simple words: [{<cat>}] redirects: [ (redir op: <Id.Redir_DLess '<<'> loc: (redir_loc.Fd fd:0) arg: (redir_param.HereDoc here_begin: {<INPUT_END>} here_end_span_id: 279 stdin_parts: [ <'M 100644 inline '> ($ Id.VSub_DollarName '$note_path') <'\n'> <'data <<EOF\n'> <'note for commit #'> ($ Id.VSub_DollarName '$nr') <'\n'> <'EOF\n'> <'\n'> ] ) ) ] do_fork: T ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:nr) op: assign_op.Equal rhs: { (word_part.ArithSub anode: (arith_expr.Binary op_id: Id.Arith_Minus left: {($ Id.VSub_DollarName '$nr')} right: {<Id.Lit_Digits 1>} ) ) } spids: [282] ) ] ) ] ) ] ) ) ] negated: F ) ] ) ) (C {<git>} {<fast-import>} {<--quiet>}) ] negated: F ) ] ) ) (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.ShFunction name: test_same_notes body: (BraceGroup children: [ (command.Pipeline children: [ (command.Subshell child: (command.AndOr ops: [Id.Op_DAmp Id.Op_DAmp] children: [ (C {<start_note_commit>}) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:nr) op: assign_op.Equal rhs: {($ Id.VSub_DollarName '$number_of_commits')} spids: [387] ) ] ) (command.Pipeline children: [ (C {<git>} {<rev-list>} {<'refs/heads/master'>}) (command.WhileUntil keyword: <Id.KW_While while> cond: (condition.Shell commands: [ (command.Sentence child: (C {<read>} {<sha1>}) terminator: <Id.Op_Semi _> ) ] ) body: (command.DoGroup children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:first_note_path) op: assign_op.Equal rhs: { (command_sub left_token: <Id.Left_DollarParen '$('> child: (command.Pipeline children: [ (C {<echo>} {(DQ ($ Id.VSub_DollarName '$sha1'))}) (C {<sed>} {(DQ ($ Id.VSub_Number '$1'))}) ] negated: F ) ) } spids: [412] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:second_note_path) op: assign_op.Equal rhs: { (command_sub left_token: <Id.Left_DollarParen '$('> child: (command.Pipeline children: [ (C {<echo>} {(DQ ($ Id.VSub_DollarName '$sha1'))}) (C {<sed>} {(DQ ($ Id.VSub_Number '$2'))}) ] negated: F ) ) } spids: [430] ) ] ) (command.AndOr ops: [Id.Op_DAmp] children: [ (command.Simple words: [{<cat>}] redirects: [ (redir op: <Id.Redir_DLess '<<'> loc: (redir_loc.Fd fd:0) arg: (redir_param.HereDoc here_begin: {<INPUT_END>} here_end_span_id: 474 stdin_parts: [ <'M 100644 inline '> ($ Id.VSub_DollarName '$second_note_path') <'\n'> <'data <<EOF\n'> <'note for commit #'> ($ Id.VSub_DollarName '$nr') <'\n'> <'EOF\n'> <'\n'> <'M 100644 inline '> ($ Id.VSub_DollarName '$first_note_path') <'\n'> <'data <<EOF\n'> <'note for commit #'> ($ Id.VSub_DollarName '$nr') <'\n'> <'EOF\n'> <'\n'> ] ) ) ] do_fork: T ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:nr) op: assign_op.Equal rhs: { (word_part.ArithSub anode: (arith_expr.Binary op_id: Id.Arith_Minus left: {($ Id.VSub_DollarName '$nr')} right: {<Id.Lit_Digits 1>} ) ) } spids: [477] ) ] ) ] ) ] ) ) ] negated: F ) ] ) ) (C {<git>} {<fast-import>} {<--quiet>}) ] negated: F ) ] ) ) (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.ShFunction name: test_concatenated_notes body: (BraceGroup children: [ (command.Pipeline children: [ (command.Subshell child: (command.AndOr ops: [Id.Op_DAmp Id.Op_DAmp] children: [ (C {<start_note_commit>}) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:nr) op: assign_op.Equal rhs: {($ Id.VSub_DollarName '$number_of_commits')} spids: [603] ) ] ) (command.Pipeline children: [ (C {<git>} {<rev-list>} {<'refs/heads/master'>}) (command.WhileUntil keyword: <Id.KW_While while> cond: (condition.Shell commands: [ (command.Sentence child: (C {<read>} {<sha1>}) terminator: <Id.Op_Semi _> ) ] ) body: (command.DoGroup children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:first_note_path) op: assign_op.Equal rhs: { (command_sub left_token: <Id.Left_DollarParen '$('> child: (command.Pipeline children: [ (C {<echo>} {(DQ ($ Id.VSub_DollarName '$sha1'))}) (C {<sed>} {(DQ ($ Id.VSub_Number '$1'))}) ] negated: F ) ) } spids: [628] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:second_note_path) op: assign_op.Equal rhs: { (command_sub left_token: <Id.Left_DollarParen '$('> child: (command.Pipeline children: [ (C {<echo>} {(DQ ($ Id.VSub_DollarName '$sha1'))}) (C {<sed>} {(DQ ($ Id.VSub_Number '$2'))}) ] negated: F ) ) } spids: [646] ) ] ) (command.AndOr ops: [Id.Op_DAmp] children: [ (command.Simple words: [{<cat>}] redirects: [ (redir op: <Id.Redir_DLess '<<'> loc: (redir_loc.Fd fd:0) arg: (redir_param.HereDoc here_begin: {<INPUT_END>} here_end_span_id: 690 stdin_parts: [ <'M 100644 inline '> ($ Id.VSub_DollarName '$second_note_path') <'\n'> <'data <<EOF\n'> <'second note for commit #'> ($ Id.VSub_DollarName '$nr') <'\n'> <'EOF\n'> <'\n'> <'M 100644 inline '> ($ Id.VSub_DollarName '$first_note_path') <'\n'> <'data <<EOF\n'> <'first note for commit #'> ($ Id.VSub_DollarName '$nr') <'\n'> <'EOF\n'> <'\n'> ] ) ) ] do_fork: T ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:nr) op: assign_op.Equal rhs: { (word_part.ArithSub anode: (arith_expr.Binary op_id: Id.Arith_Minus left: {($ Id.VSub_DollarName '$nr')} right: {<Id.Lit_Digits 1>} ) ) } spids: [693] ) ] ) ] ) ] ) ) ] negated: F ) ] ) ) (C {<git>} {<fast-import>} {<--quiet>}) ] negated: F ) ] ) ) (command.ShFunction name: verify_concatenated_notes body: (BraceGroup children: [ (command.AndOr ops: [Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp] children: [ (command.Pipeline children: [ (C {<git>} {<log>}) (command.Simple words: [{<grep>} {(DQ <'^ '>)}] redirects: [ (redir op: <Id.Redir_Great '>'> loc: (redir_loc.Fd fd:1) arg: {<output>} ) ] do_fork: T ) ] negated: F ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:i) op: assign_op.Equal rhs: {($ Id.VSub_DollarName '$number_of_commits')} spids: [746] ) ] ) (command.WhileUntil keyword: <Id.KW_While while> cond: (condition.Shell commands: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} {($ Id.VSub_DollarName '$i')} {<-gt>} {<0>} {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] ) body: (command.DoGroup children: [ (command.Sentence child: (command.AndOr ops: [Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp] children: [ (C {<echo>} {(DQ <' commit #'> ($ Id.VSub_DollarName '$i'))}) (C {<echo>} {(DQ <' first note for commit #'> ($ Id.VSub_DollarName '$i'))} ) (C {<echo>} {(DQ <' '>)}) (C {<echo>} {(DQ <' second note for commit #'> ($ Id.VSub_DollarName '$i'))} ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:i) op: assign_op.Equal rhs: { (word_part.ArithSub anode: (arith_expr.Binary op_id: Id.Arith_Minus left: {($ Id.VSub_DollarName '$i')} right: {<Id.Lit_Digits 1>} ) ) } spids: [807] ) ] ) ] ) terminator: <Id.Op_Semi _> ) ] ) redirects: [(redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expect>})] ) (C {<test_cmp>} {<expect>} {<output>}) ] ) ] ) ) (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>}) ] )