(CommandList children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:test_description) op: Equal rhs: {(SQ <'test git fast-import of notes objects'>)} spids: [13] ) ] spids: [13] ) (C {(.)} {(./test-lib.sh)}) (C {(test_tick)}) (SimpleCommand words: [{(cat)}] redirects: [ (Redir op_id:Redir_Great fd:-1 arg_word:{(input)} spids:[28]) (HereDoc op_id: Redir_DLess fd: -1 body: { (DQ ('commit refs/heads/master\n') ('committer ') ($ VSub_Name '$GIT_COMMITTER_NAME') (' <') ($ VSub_Name '$GIT_COMMITTER_EMAIL') ('> ') ($ VSub_Name '$GIT_COMMITTER_DATE') ('\n') ('data <<COMMIT\n') ('first commit\n') ('COMMIT\n') ('\n') ('M 644 inline foo\n') ('data <<EOF\n') ('file foo in first commit\n') ('EOF\n') ('\n') ('M 755 inline bar\n') ('data <<EOF\n') ('file bar in first commit\n') ('EOF\n') ('\n') ('M 644 inline baz/xyzzy\n') ('data <<EOF\n') ('file baz/xyzzy in first commit\n') ('EOF\n') ('\n') ('commit refs/heads/master\n') ('committer ') ($ VSub_Name '$GIT_COMMITTER_NAME') (' <') ($ VSub_Name '$GIT_COMMITTER_EMAIL') ('> ') ($ VSub_Name '$GIT_COMMITTER_DATE') ('\n') ('data <<COMMIT\n') ('second commit\n') ('COMMIT\n') ('\n') ('M 644 inline foo\n') ('data <<EOF\n') ('file foo in second commit\n') ('EOF\n') ('\n') ('M 755 inline baz/xyzzy\n') ('data <<EOF\n') ('file baz/xyzzy in second commit\n') ('EOF\n') ('\n') ('commit refs/heads/master\n') ('committer ') ($ VSub_Name '$GIT_COMMITTER_NAME') (' <') ($ VSub_Name '$GIT_COMMITTER_EMAIL') ('> ') ($ VSub_Name '$GIT_COMMITTER_DATE') ('\n') ('data <<COMMIT\n') ('third commit\n') ('COMMIT\n') ('\n') ('M 644 inline foo\n') ('data <<EOF\n') ('file foo in third commit\n') ('EOF\n') ('\n') ('commit refs/heads/master\n') ('committer ') ($ VSub_Name '$GIT_COMMITTER_NAME') (' <') ($ VSub_Name '$GIT_COMMITTER_EMAIL') ('> ') ($ VSub_Name '$GIT_COMMITTER_DATE') ('\n') ('data <<COMMIT\n') ('fourth commit\n') ('COMMIT\n') ('\n') ('M 755 inline bar\n') ('data <<EOF\n') ('file bar in fourth commit\n') ('EOF\n') ('\n') ) } do_expansion: True here_end: INPUT_END was_filled: True spids: [31] ) ] ) (C {(test_expect_success)} {(SQ <'set up master branch'>)} {(SQ <'\n'> <'\n'> <'\tgit fast-import <input &&\n'> <'\tgit whatchanged master\n'>)} ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:commit4) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [(C {(git)} {(rev-parse)} {(refs/heads/master)})] ) left_token: <Left_CommandSub '$('> spids: [134 140] ) } spids: [133] ) ] spids: [133] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:commit3) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [(C {(git)} {(rev-parse)} {(DQ ($ VSub_Name '$commit4') ('^'))})] ) left_token: <Left_CommandSub '$('> spids: [143 152] ) } spids: [142] ) ] spids: [142] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:commit2) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [(C {(git)} {(rev-parse)} {(DQ ($ VSub_Name '$commit4') ('~2'))})] ) left_token: <Left_CommandSub '$('> spids: [155 164] ) } spids: [154] ) ] spids: [154] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:commit1) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [(C {(git)} {(rev-parse)} {(DQ ($ VSub_Name '$commit4') ('~3'))})] ) left_token: <Left_CommandSub '$('> spids: [167 176] ) } spids: [166] ) ] spids: [166] ) (C {(test_tick)}) (SimpleCommand words: [{(cat)}] redirects: [ (Redir op_id:Redir_Great fd:-1 arg_word:{(input)} spids:[183]) (HereDoc op_id: Redir_DLess fd: -1 body: { (DQ ('commit refs/notes/test\n') ('committer ') ($ VSub_Name '$GIT_COMMITTER_NAME') (' <') ($ VSub_Name '$GIT_COMMITTER_EMAIL') ('> ') ($ VSub_Name '$GIT_COMMITTER_DATE') ('\n') ('data <<COMMIT\n') ('first notes commit\n') ('COMMIT\n') ('\n') ('M 644 inline ') ($ VSub_Name '$commit1') ('\n') ('data <<EOF\n') ('first note for first commit\n') ('EOF\n') ('\n') ('M 755 inline ') ($ VSub_Name '$commit2') ('\n') ('data <<EOF\n') ('first note for second commit\n') ('EOF\n') ('\n') ) } do_expansion: True here_end: INPUT_END was_filled: True spids: [186] ) ] ) (SimpleCommand words: [{(cat)}] redirects: [ (Redir op_id:Redir_Great fd:-1 arg_word:{(expect)} spids:[219]) (HereDoc op_id: Redir_DLess fd: -1 body: { (DQ (' fourth commit\n') (' third commit\n') (' second commit\n') (' first note for second commit\n') (' first commit\n') (' first note for first commit\n') ) } do_expansion: True here_end: EXPECT_END was_filled: True spids: [222] ) ] ) (C {(test_expect_success)} {(SQ <'add notes with simple M command'>)} { (SQ <'\n'> <'\n'> <'\tgit fast-import <input &&\n'> <'\tGIT_NOTES_REF=refs/notes/test git log | grep "^ " > actual &&\n'> <'\ttest_cmp expect actual\n'> <'\n'> ) } ) (C {(test_tick)}) (SimpleCommand words: [{(cat)}] redirects: [ (Redir op_id:Redir_Great fd:-1 arg_word:{(input)} spids:[253]) (HereDoc op_id: Redir_DLess fd: -1 body: { (DQ ('feature notes\n') ('commit refs/notes/test\n') ('committer ') ($ VSub_Name '$GIT_COMMITTER_NAME') (' <') ($ VSub_Name '$GIT_COMMITTER_EMAIL') ('> ') ($ VSub_Name '$GIT_COMMITTER_DATE') ('\n') ('data <<COMMIT\n') ('second notes commit\n') ('COMMIT\n') ('\n') ('from refs/notes/test^0\n') ('N inline ') ($ VSub_Name '$commit3') ('\n') ('data <<EOF\n') ('first note for third commit\n') ('EOF\n') ('\n') ('N inline ') ($ VSub_Name '$commit4') ('\n') ('data <<EOF\n') ('first note for fourth commit\n') ('EOF\n') ('\n') ) } do_expansion: True here_end: INPUT_END was_filled: True spids: [256] ) ] ) (SimpleCommand words: [{(cat)}] redirects: [ (Redir op_id:Redir_Great fd:-1 arg_word:{(expect)} spids:[291]) (HereDoc op_id: Redir_DLess fd: -1 body: { (DQ (' fourth commit\n') (' first note for fourth commit\n') (' third commit\n') (' first note for third commit\n') (' second commit\n') (' first note for second commit\n') (' first commit\n') (' first note for first commit\n') ) } do_expansion: True here_end: EXPECT_END was_filled: True spids: [294] ) ] ) (C {(test_expect_success)} {(SQ <'add notes with simple N command'>)} { (SQ <'\n'> <'\n'> <'\tgit fast-import <input &&\n'> <'\tGIT_NOTES_REF=refs/notes/test git log | grep "^ " > actual &&\n'> <'\ttest_cmp expect actual\n'> <'\n'> ) } ) (C {(test_tick)}) (SimpleCommand words: [{(cat)}] redirects: [ (Redir op_id:Redir_Great fd:-1 arg_word:{(input)} spids:[327]) (HereDoc op_id: Redir_DLess fd: -1 body: { (DQ ('commit refs/notes/test\n') ('committer ') ($ VSub_Name '$GIT_COMMITTER_NAME') (' <') ($ VSub_Name '$GIT_COMMITTER_EMAIL') ('> ') ($ VSub_Name '$GIT_COMMITTER_DATE') ('\n') ('data <<COMMIT\n') ('third notes commit\n') ('COMMIT\n') ('\n') ('from refs/notes/test^0\n') ('N inline ') ($ VSub_Name '$commit1') ('\n') ('data <<EOF\n') ('second note for first commit\n') ('EOF\n') ('\n') ('N inline ') ($ VSub_Name '$commit2') ('\n') ('data <<EOF\n') ('second note for second commit\n') ('EOF\n') ('\n') ('N inline ') ($ VSub_Name '$commit3') ('\n') ('data <<EOF\n') ('second note for third commit\n') ('EOF\n') ('\n') ('N inline ') ($ VSub_Name '$commit4') ('\n') ('data <<EOF\n') ('second note for fourth commit\n') ('EOF\n') ('\n') ) } do_expansion: True here_end: INPUT_END was_filled: True spids: [330] ) ] ) (SimpleCommand words: [{(cat)}] redirects: [ (Redir op_id:Redir_Great fd:-1 arg_word:{(expect)} spids:[378]) (HereDoc op_id: Redir_DLess fd: -1 body: { (DQ (' fourth commit\n') (' second note for fourth commit\n') (' third commit\n') (' second note for third commit\n') (' second commit\n') (' second note for second commit\n') (' first commit\n') (' second note for first commit\n') ) } do_expansion: True here_end: EXPECT_END was_filled: True spids: [381] ) ] ) (C {(test_expect_success)} {(SQ <'update existing notes with N command'>)} { (SQ <'\n'> <'\n'> <'\tgit fast-import <input &&\n'> <'\tGIT_NOTES_REF=refs/notes/test git log | grep "^ " > actual &&\n'> <'\ttest_cmp expect actual\n'> <'\n'> ) } ) (C {(test_tick)}) (SimpleCommand words: [{(cat)}] redirects: [ (Redir op_id:Redir_Great fd:-1 arg_word:{(input)} spids:[414]) (HereDoc op_id: Redir_DLess fd: -1 body: { (DQ ('commit refs/notes/test\n') ('committer ') ($ VSub_Name '$GIT_COMMITTER_NAME') (' <') ($ VSub_Name '$GIT_COMMITTER_EMAIL') ('> ') ($ VSub_Name '$GIT_COMMITTER_DATE') ('\n') ('data <<COMMIT\n') ('fourth notes commit\n') ('COMMIT\n') ('\n') ('from refs/notes/test^0\n') ('M 644 inline ') (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(echo)} {(DQ ($ VSub_Name '$commit3'))}) (C {(sed)} {(DQ ('s|^..|&/|'))}) ] negated: False ) ] ) left_token: <Left_CommandSub '$('> spids: [434 448] ) ('\n') ('data <<EOF\n') ('prefix of note for third commit\n') ('EOF\n') ('\n') ('M 644 inline ') (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(echo)} {(DQ ($ VSub_Name '$commit4'))}) (C {(sed)} {(DQ ('s|^..|&/|'))}) ] negated: False ) ] ) left_token: <Left_CommandSub '$('> spids: [455 469] ) ('\n') ('data <<EOF\n') ('prefix of note for fourth commit\n') ('EOF\n') ('\n') ('M 644 inline ') (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(echo)} {(DQ ($ VSub_Name '$commit4'))}) (C {(sed)} { (DQ ('s|^') (EscapedLiteralPart token:<Lit_EscapedChar '\\('>) (..) (EscapedLiteralPart token: <Lit_EscapedChar '\\)'> ) (EscapedLiteralPart token:<Lit_EscapedChar '\\('>) (..) (EscapedLiteralPart token: <Lit_EscapedChar '\\)'> ) ('|') (EscapedLiteralPart token:<Lit_EscapedChar '\\1'>) (/) (EscapedLiteralPart token: <Lit_EscapedChar '\\2'> ) ('/|') ) } ) ] negated: False ) ] ) left_token: <Left_CommandSub '$('> spids: [476 501] ) ('\n') ('data <<EOF\n') ('pre-prefix of note for fourth commit\n') ('EOF\n') ('\n') ('N inline ') ($ VSub_Name '$commit1') ('\n') ('data <<EOF\n') ('third note for first commit\n') ('EOF\n') ('\n') ('N inline ') ($ VSub_Name '$commit2') ('\n') ('data <<EOF\n') ('third note for second commit\n') ('EOF\n') ('\n') ('N inline ') ($ VSub_Name '$commit3') ('\n') ('data <<EOF\n') ('third note for third commit\n') ('EOF\n') ('\n') ('N inline ') ($ VSub_Name '$commit4') ('\n') ('data <<EOF\n') ('third note for fourth commit\n') ('EOF\n') ('\n') ('\n') ) } do_expansion: True here_end: INPUT_END was_filled: True spids: [417] ) ] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:whitespace) op:Equal rhs:{(DQ (' '))} spids:[538])] spids: [538] ) (SimpleCommand words: [{(cat)}] redirects: [ (Redir op_id:Redir_Great fd:-1 arg_word:{(expect)} spids:[546]) (HereDoc op_id: Redir_DLess fd: -1 body: { (DQ (' fourth commit\n') (' pre-prefix of note for fourth commit\n') ($ VSub_Name '$whitespace') ('\n') (' prefix of note for fourth commit\n') ($ VSub_Name '$whitespace') ('\n') (' third note for fourth commit\n') (' third commit\n') (' prefix of note for third commit\n') ($ VSub_Name '$whitespace') ('\n') (' third note for third commit\n') (' second commit\n') (' third note for second commit\n') (' first commit\n') (' third note for first commit\n') ) } do_expansion: True here_end: EXPECT_END was_filled: True spids: [549] ) ] ) (C {(test_expect_success)} {(SQ <'add concatentation notes with M command'>)} { (SQ <'\n'> <'\n'> <'\tgit fast-import <input &&\n'> <'\tGIT_NOTES_REF=refs/notes/test git log | grep "^ " > actual &&\n'> <'\ttest_cmp expect actual\n'> <'\n'> ) } ) (C {(test_tick)}) (SimpleCommand words: [{(cat)}] redirects: [ (Redir op_id:Redir_Great fd:-1 arg_word:{(input)} spids:[591]) (HereDoc op_id: Redir_DLess fd: -1 body: { (DQ ('commit refs/notes/test\n') ('committer ') ($ VSub_Name '$GIT_COMMITTER_NAME') (' <') ($ VSub_Name '$GIT_COMMITTER_EMAIL') ('> ') ($ VSub_Name '$GIT_COMMITTER_DATE') ('\n') ('data <<COMMIT\n') ('fifth notes commit\n') ('COMMIT\n') ('\n') ('from refs/notes/test^0\n') ('deleteall\n') ('\n') ) } do_expansion: True here_end: INPUT_END was_filled: True spids: [594] ) ] ) (SimpleCommand words: [{(cat)}] redirects: [ (Redir op_id:Redir_Great fd:-1 arg_word:{(expect)} spids:[616]) (HereDoc op_id: Redir_DLess fd: -1 body: { (DQ (' fourth commit\n') (' third commit\n') (' second commit\n') (' first commit\n') ) } do_expansion: True here_end: EXPECT_END was_filled: True spids: [619] ) ] ) (C {(test_expect_success)} {(SQ <'verify that deleteall also removes notes'>)} { (SQ <'\n'> <'\n'> <'\tgit fast-import <input &&\n'> <'\tGIT_NOTES_REF=refs/notes/test git log | grep "^ " > actual &&\n'> <'\ttest_cmp expect actual\n'> <'\n'> ) } ) (C {(test_tick)}) (SimpleCommand words: [{(cat)}] redirects: [ (Redir op_id:Redir_Great fd:-1 arg_word:{(input)} spids:[648]) (HereDoc op_id: Redir_DLess fd: -1 body: { (DQ ('commit refs/notes/test\n') ('committer ') ($ VSub_Name '$GIT_COMMITTER_NAME') (' <') ($ VSub_Name '$GIT_COMMITTER_EMAIL') ('> ') ($ VSub_Name '$GIT_COMMITTER_DATE') ('\n') ('data <<COMMIT\n') ('sixth notes commit\n') ('COMMIT\n') ('\n') ('from refs/notes/test^0\n') ('M 644 inline ') ($ VSub_Name '$commit1') ('\n') ('data <<EOF\n') ('third note for first commit\n') ('EOF\n') ('\n') ('M 644 inline ') ($ VSub_Name '$commit3') ('\n') ('data <<EOF\n') ('third note for third commit\n') ('EOF\n') ('\n') ('N inline ') ($ VSub_Name '$commit1') ('\n') ('data <<EOF\n') ('fourth note for first commit\n') ('EOF\n') ('\n') ('N inline ') ($ VSub_Name '$commit3') ('\n') ('data <<EOF\n') ('fourth note for third commit\n') ('EOF\n') ('\n') ) } do_expansion: True here_end: INPUT_END was_filled: True spids: [651] ) ] ) (SimpleCommand words: [{(cat)}] redirects: [ (Redir op_id:Redir_Great fd:-1 arg_word:{(expect)} spids:[699]) (HereDoc op_id: Redir_DLess fd: -1 body: { (DQ (' fourth commit\n') (' third commit\n') (' fourth note for third commit\n') (' second commit\n') (' first commit\n') (' fourth note for first commit\n') ) } do_expansion: True here_end: EXPECT_END was_filled: True spids: [702] ) ] ) (C {(test_expect_success)} {(SQ <'verify that later N commands override earlier M commands'>)} { (SQ <'\n'> <'\n'> <'\tgit fast-import <input &&\n'> <'\tGIT_NOTES_REF=refs/notes/test git log | grep "^ " > actual &&\n'> <'\ttest_cmp expect actual\n'> <'\n'> ) } ) (FuncDef name: fast_import_commits body: (BraceGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:my_ref) op: Equal rhs: {($ VSub_Number '$1')} spids: [740] ) ] spids: [740] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:my_num_commits) op: Equal rhs: {($ VSub_Number '$2')} spids: [744] ) ] spids: [744] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:my_append_to_file) op: Equal rhs: {($ VSub_Number '$3')} spids: [748] ) ] spids: [748] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:my_i) op:Equal rhs:{(0)} spids:[752])] spids: [752] ) (While cond: [(C {(test)} {($ VSub_Name '$my_i')} {(-lt)} {($ VSub_Name '$my_num_commits')})] body: (DoGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:my_i) op: Equal rhs: { (ArithSubPart anode: (ArithBinary op_id: Arith_Plus left: (ArithWord w:{($ VSub_Name '$my_i')}) right: (ArithWord w:{(Lit_Digits 1)}) ) spids: [771 778] ) } spids: [770] ) ] spids: [770] ) (C {(test_tick)}) (SimpleCommand words: [{(cat)}] redirects: [ (Redir op_id: Redir_DGreat fd: -1 arg_word: {(DQ ($ VSub_Name '$my_append_to_file'))} spids: [786] ) (HereDoc op_id: Redir_DLess fd: -1 body: { (DQ ('commit ') ($ VSub_Name '$my_ref') ('\n') ('mark :') ($ VSub_Name '$my_i') ('\n') ('committer ') ($ VSub_Name '$GIT_COMMITTER_NAME') (' <') ($ VSub_Name '$GIT_COMMITTER_EMAIL') ('> ') ($ VSub_Name '$GIT_COMMITTER_DATE') ('\n') ('data <<COMMIT\n') ('commit #') ($ VSub_Name '$my_i') ('\n') ('COMMIT\n') ('\n') ('M 644 inline file\n') ('data <<EOF\n') ('file contents in commit #') ($ VSub_Name '$my_i') ('\n') ('EOF\n') ('\n') ) } do_expansion: True here_end: INPUT_END was_filled: True spids: [791] ) ] ) ] spids: [767 822] ) ) ] spids: [737] ) spids: [732 736] ) (FuncDef name: fast_import_notes body: (BraceGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:my_notes_ref) op: Equal rhs: {($ VSub_Number '$1')} spids: [841] ) ] spids: [841] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:my_num_commits) op: Equal rhs: {($ VSub_Number '$2')} spids: [845] ) ] spids: [845] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:my_append_to_file) op: Equal rhs: {($ VSub_Number '$3')} spids: [849] ) ] spids: [849] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:my_note_append) op: Equal rhs: {($ VSub_Number '$4')} spids: [853] ) ] spids: [853] ) (C {(test_tick)}) (SimpleCommand words: [{(cat)}] redirects: [ (Redir op_id: Redir_DGreat fd: -1 arg_word: {(DQ ($ VSub_Name '$my_append_to_file'))} spids: [862] ) (HereDoc op_id: Redir_DLess fd: -1 body: { (DQ ('commit ') ($ VSub_Name '$my_notes_ref') ('\n') ('committer ') ($ VSub_Name '$GIT_COMMITTER_NAME') (' <') ($ VSub_Name '$GIT_COMMITTER_EMAIL') ('> ') ($ VSub_Name '$GIT_COMMITTER_DATE') ('\n') ('data <<COMMIT\n') ('committing ') ($ VSub_Name '$my_num_commits') (' notes\n') ('COMMIT\n') ('\n') ) } do_expansion: True here_end: INPUT_END was_filled: True spids: [867] ) ] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:my_i) op:Equal rhs:{(0)} spids:[889])] spids: [889] ) (While cond: [(C {(test)} {($ VSub_Name '$my_i')} {(-lt)} {($ VSub_Name '$my_num_commits')})] body: (DoGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:my_i) op: Equal rhs: { (ArithSubPart anode: (ArithBinary op_id: Arith_Plus left: (ArithWord w:{($ VSub_Name '$my_i')}) right: (ArithWord w:{(Lit_Digits 1)}) ) spids: [908 915] ) } spids: [907] ) ] spids: [907] ) (SimpleCommand words: [{(cat)}] redirects: [ (Redir op_id: Redir_DGreat fd: -1 arg_word: {(DQ ($ VSub_Name '$my_append_to_file'))} spids: [920] ) (HereDoc op_id: Redir_DLess fd: -1 body: { (DQ ('N inline :') ($ VSub_Name '$my_i') ('\n') ('data <<EOF\n') ('note for commit #') ($ VSub_Name '$my_i') ($ VSub_Name '$my_note_append') ('\n') ('EOF\n') ('\n') ) } do_expansion: True here_end: INPUT_END was_filled: True spids: [925] ) ] ) ] spids: [904 940] ) ) ] spids: [838] ) spids: [833 837] ) (C {(rm)} {(input)} {(expect)}) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:num_commits) op:Equal rhs:{(400)} spids:[952])] spids: [952] ) (C {(fast_import_commits)} {(DQ (refs/heads/many_commits))} {($ VSub_Name '$num_commits')} {(input)}) (C {(fast_import_notes)} {(DQ (refs/notes/many_notes))} {($ VSub_Name '$num_commits')} {(input)}) (C {(test_tick)}) (SimpleCommand words: [{(cat)}] redirects: [ (Redir op_id:Redir_DGreat fd:-1 arg_word:{(input)} spids:[988]) (HereDoc op_id: Redir_DLess fd: -1 body: { (DQ ('commit refs/notes/many_notes\n') ('committer ') ($ VSub_Name '$GIT_COMMITTER_NAME') (' <') ($ VSub_Name '$GIT_COMMITTER_EMAIL') ('> ') ($ VSub_Name '$GIT_COMMITTER_DATE') ('\n') ('data <<COMMIT\n') ('committing some non-notes to the notes tree\n') ('COMMIT\n') ('\n') ('M 755 inline foobar/non-note.txt\n') ('data <<EOF\n') ('This is not a note, but rather a regular file residing in a notes tree\n') ('EOF\n') ('\n') ('M 644 inline deadbeef\n') ('data <<EOF\n') ('Non-note file\n') ('EOF\n') ('\n') ('M 644 inline de/adbeef\n') ('data <<EOF\n') ('Another non-note file\n') ('EOF\n') ('\n') ) } do_expansion: True here_end: INPUT_END was_filled: True spids: [991] ) ] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:i) op: Equal rhs: {($ VSub_Name '$num_commits')} spids: [1025] ) ] spids: [1025] ) (While cond: [(C {(test)} {($ VSub_Name '$i')} {(-gt)} {(0)})] body: (DoGroup children: [ (SimpleCommand words: [{(cat)}] redirects: [ (Redir op_id:Redir_DGreat fd:-1 arg_word:{(expect)} spids:[1043]) (HereDoc op_id: Redir_DLess fd: -1 body: { (DQ (' commit #') ($ VSub_Name '$i') ('\n') (' note for commit #') ($ VSub_Name '$i') ('\n') ) } do_expansion: True here_end: EXPECT_END was_filled: True spids: [1046] ) ] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:i) op: Equal rhs: { (ArithSubPart anode: (ArithBinary op_id: Arith_Minus left: (ArithWord w:{($ VSub_Name '$i')}) right: (ArithWord w:{(Lit_Digits 1)}) ) spids: [1058 1065] ) } spids: [1057] ) ] spids: [1057] ) ] spids: [1038 1067] ) ) (C {(test_expect_success)} {(SQ <'add lots of commits and notes'>)} { (SQ <'\n'> <'\n'> <'\tgit fast-import <input &&\n'> <'\tGIT_NOTES_REF=refs/notes/many_notes git log refs/heads/many_commits |\n'> <'\t grep "^ " > actual &&\n'> <'\ttest_cmp expect actual\n'> <'\n'> ) } ) (C {(test_expect_success)} {(SQ <'verify that lots of notes trigger a fanout scheme'>)} { (SQ <'\n'> <'\n'> <'\t# None of the entries in the top-level notes tree should be a full SHA1\n'> <'\tgit ls-tree --name-only refs/notes/many_notes |\n'> <'\twhile read path\n'> <'\tdo\n'> <'\t\tif test $(expr length "$path") -ge 40\n'> <'\t\tthen\n'> <'\t\t\treturn 1\n'> <'\t\tfi\n'> <'\tdone\n'> <'\n'> ) } ) (SimpleCommand words: [{(cat)}] redirects: [ (Redir op_id:Redir_DGreat fd:-1 arg_word:{(expect_non-note1)} spids:[1111]) (HereDoc op_id: Redir_DLess fd: -1 body: {(DQ ('This is not a note, but rather a regular file residing in a notes tree\n'))} do_expansion: True here_end: EOF was_filled: True spids: [1114] ) ] ) (SimpleCommand words: [{(cat)}] redirects: [ (Redir op_id:Redir_DGreat fd:-1 arg_word:{(expect_non-note2)} spids:[1123]) (HereDoc op_id: Redir_DLess fd: -1 body: {(DQ ('Non-note file\n'))} do_expansion: True here_end: EOF was_filled: True spids: [1126] ) ] ) (SimpleCommand words: [{(cat)}] redirects: [ (Redir op_id:Redir_DGreat fd:-1 arg_word:{(expect_non-note3)} spids:[1135]) (HereDoc op_id: Redir_DLess fd: -1 body: {(DQ ('Another non-note file\n'))} do_expansion: True here_end: EOF was_filled: True spids: [1138] ) ] ) (C {(test_expect_success)} {(SQ <'verify that non-notes are untouched by a fanout change'>)} { (SQ <'\n'> <'\n'> <'\tgit cat-file -p refs/notes/many_notes:foobar/non-note.txt > actual &&\n'> <'\ttest_cmp expect_non-note1 actual &&\n'> <'\tgit cat-file -p refs/notes/many_notes:deadbeef > actual &&\n'> <'\ttest_cmp expect_non-note2 actual &&\n'> <'\tgit cat-file -p refs/notes/many_notes:de/adbeef > actual &&\n'> <'\ttest_cmp expect_non-note3 actual\n'> <'\n'> ) } ) (C {(test_tick)}) (SimpleCommand words: [{(cat)}] redirects: [ (Redir op_id:Redir_Great fd:-1 arg_word:{(input)} spids:[1171]) (HereDoc op_id: Redir_DLess fd: -1 body: { (DQ ('commit refs/notes/many_notes\n') ('committer ') ($ VSub_Name '$GIT_COMMITTER_NAME') (' <') ($ VSub_Name '$GIT_COMMITTER_EMAIL') ('> ') ($ VSub_Name '$GIT_COMMITTER_DATE') ('\n') ('data <<COMMIT\n') ('changing notes for the top three commits\n') ('COMMIT\n') ('from refs/notes/many_notes^0\n') ) } do_expansion: True here_end: INPUT_END was_filled: True spids: [1174] ) ] ) (C {(rm)} {(expect)}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:i) op: Equal rhs: {($ VSub_Name '$num_commits')} spids: [1195] ) ] spids: [1195] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:j) op:Equal rhs:{(0)} spids:[1198])] spids: [1198] ) (While cond: [(C {(test)} {($ VSub_Name '$j')} {(-lt)} {(3)})] body: (DoGroup children: [ (SimpleCommand words: [{(cat)}] redirects: [ (Redir op_id:Redir_DGreat fd:-1 arg_word:{(input)} spids:[1216]) (HereDoc op_id: Redir_DLess fd: -1 body: { (DQ ('N inline refs/heads/many_commits~') ($ VSub_Name '$j') ('\n') ('data <<EOF\n') ('changed note for commit #') ($ VSub_Name '$i') ('\n') ('EOF\n') ) } do_expansion: True here_end: INPUT_END was_filled: True spids: [1219] ) ] ) (SimpleCommand words: [{(cat)}] redirects: [ (Redir op_id:Redir_DGreat fd:-1 arg_word:{(expect)} spids:[1234]) (HereDoc op_id: Redir_DLess fd: -1 body: { (DQ (' commit #') ($ VSub_Name '$i') ('\n') (' changed note for commit #') ($ VSub_Name '$i') ('\n') ) } do_expansion: True here_end: EXPECT_END was_filled: True spids: [1237] ) ] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:i) op: Equal rhs: { (ArithSubPart anode: (ArithBinary op_id: Arith_Minus left: (ArithWord w:{($ VSub_Name '$i')}) right: (ArithWord w:{(Lit_Digits 1)}) ) spids: [1249 1256] ) } spids: [1248] ) ] spids: [1248] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:j) op: Equal rhs: { (ArithSubPart anode: (ArithBinary op_id: Arith_Plus left: (ArithWord w:{($ VSub_Name '$j')}) right: (ArithWord w:{(Lit_Digits 1)}) ) spids: [1260 1267] ) } spids: [1259] ) ] spids: [1259] ) ] spids: [1211 1269] ) ) (C {(test_expect_success)} {(SQ <'change a few existing notes'>)} { (SQ <'\n'> <'\n'> <'\tgit fast-import <input &&\n'> <'\tGIT_NOTES_REF=refs/notes/many_notes git log -n3 refs/heads/many_commits |\n'> <'\t grep "^ " > actual &&\n'> <'\ttest_cmp expect actual\n'> <'\n'> ) } ) (C {(test_expect_success)} {(SQ <'verify that changing notes respect existing fanout'>)} { (SQ <'\n'> <'\n'> <'\t# None of the entries in the top-level notes tree should be a full SHA1\n'> <'\tgit ls-tree --name-only refs/notes/many_notes |\n'> <'\twhile read path\n'> <'\tdo\n'> <'\t\tif test $(expr length "$path") -ge 40\n'> <'\t\tthen\n'> <'\t\t\treturn 1\n'> <'\t\tfi\n'> <'\tdone\n'> <'\n'> ) } ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:remaining_notes) op:Equal rhs:{(10)} spids:[1311])] spids: [1311] ) (C {(test_tick)}) (SimpleCommand words: [{(cat)}] redirects: [ (Redir op_id:Redir_Great fd:-1 arg_word:{(input)} spids:[1318]) (HereDoc op_id: Redir_DLess fd: -1 body: { (DQ ('commit refs/notes/many_notes\n') ('committer ') ($ VSub_Name '$GIT_COMMITTER_NAME') (' <') ($ VSub_Name '$GIT_COMMITTER_EMAIL') ('> ') ($ VSub_Name '$GIT_COMMITTER_DATE') ('\n') ('data <<COMMIT\n') ('removing all notes but ') ($ VSub_Name '$remaining_notes') ('\n') ('COMMIT\n') ('from refs/notes/many_notes^0\n') ) } do_expansion: True here_end: INPUT_END was_filled: True spids: [1321] ) ] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:i) op: Equal rhs: { (ArithSubPart anode: (ArithBinary op_id: Arith_Minus left: (ArithWord w:{($ VSub_Name '$num_commits')}) right: (ArithWord w:{($ VSub_Name '$remaining_notes')}) ) spids: [1341 1348] ) } spids: [1340] ) ] spids: [1340] ) (ForEach iter_name: sha1 iter_words: [ { (CommandSubPart command_list: (CommandList children: [ (C {(git)} {(rev-list)} {(-n)} {($ VSub_Name '$i')} {(refs/heads/many_commits)}) ] ) left_token: <Left_CommandSub '$('> spids: [1356 1366] ) } ] do_arg_iter: False body: (DoGroup children: [ (SimpleCommand words: [{(cat)}] redirects: [ (Redir op_id:Redir_DGreat fd:-1 arg_word:{(input)} spids:[1373]) (HereDoc op_id: Redir_DLess fd: -1 body: { (DQ ('N 0000000000000000000000000000000000000000 ') ($ VSub_Name '$sha1') ('\n')) } do_expansion: True here_end: INPUT_END was_filled: True spids: [1376] ) ] ) ] spids: [1368 1383] ) spids: [1355 -1] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:i) op: Equal rhs: {($ VSub_Name '$num_commits')} spids: [1386] ) ] spids: [1386] ) (C {(rm)} {(expect)}) (While cond: [(C {(test)} {($ VSub_Name '$i')} {(-gt)} {(0)})] body: (DoGroup children: [ (SimpleCommand words: [{(cat)}] redirects: [ (Redir op_id:Redir_DGreat fd:-1 arg_word:{(expect)} spids:[1408]) (HereDoc op_id: Redir_DLess fd: -1 body: {(DQ (' commit #') ($ VSub_Name '$i') ('\n'))} do_expansion: True here_end: EXPECT_END was_filled: True spids: [1411] ) ] ) (If arms: [ (if_arm cond: [(C {(test)} {($ VSub_Name '$i')} {(-le)} {($ VSub_Name '$remaining_notes')})] action: [ (SimpleCommand words: [{(cat)}] redirects: [ (Redir op_id: Redir_DGreat fd: -1 arg_word: {(expect)} spids: [1435] ) (HereDoc op_id: Redir_DLess fd: -1 body: {(DQ (' note for commit #') ($ VSub_Name '$i') ('\n'))} do_expansion: True here_end: EXPECT_END was_filled: True spids: [1438] ) ] ) ] spids: [-1 1430] ) ] spids: [-1 1446] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:i) op: Equal rhs: { (ArithSubPart anode: (ArithBinary op_id: Arith_Minus left: (ArithWord w:{($ VSub_Name '$i')}) right: (ArithWord w:{(Lit_Digits 1)}) ) spids: [1450 1457] ) } spids: [1449] ) ] spids: [1449] ) ] spids: [1403 1459] ) ) (C {(test_expect_success)} {(SQ <'remove lots of notes'>)} { (SQ <'\n'> <'\n'> <'\tgit fast-import <input &&\n'> <'\tGIT_NOTES_REF=refs/notes/many_notes git log refs/heads/many_commits |\n'> <'\t grep "^ " > actual &&\n'> <'\ttest_cmp expect actual\n'> <'\n'> ) } ) (C {(test_expect_success)} {(SQ <'verify that removing notes trigger fanout consolidation'>)} { (SQ <'\n'> <'\n'> <'\t# All entries in the top-level notes tree should be a full SHA1\n'> <'\tgit ls-tree --name-only -r refs/notes/many_notes |\n'> <'\twhile read path\n'> <'\tdo\n'> <'\t\t# Explicitly ignore the non-note paths\n'> <'\t\ttest "$path" = "foobar/non-note.txt" && continue\n'> <'\t\ttest "$path" = "deadbeef" && continue\n'> <'\t\ttest "$path" = "de/adbeef" && continue\n'> <'\n'> <'\t\tif test $(expr length "$path") -ne 40\n'> <'\t\tthen\n'> <'\t\t\treturn 1\n'> <'\t\tfi\n'> <'\tdone\n'> <'\n'> ) } ) (C {(test_expect_success)} {(SQ <'verify that non-notes are untouched by a fanout change'>)} { (SQ <'\n'> <'\n'> <'\tgit cat-file -p refs/notes/many_notes:foobar/non-note.txt > actual &&\n'> <'\ttest_cmp expect_non-note1 actual &&\n'> <'\tgit cat-file -p refs/notes/many_notes:deadbeef > actual &&\n'> <'\ttest_cmp expect_non-note2 actual &&\n'> <'\tgit cat-file -p refs/notes/many_notes:de/adbeef > actual &&\n'> <'\ttest_cmp expect_non-note3 actual\n'> <'\n'> ) } ) (C {(rm)} {(input)} {(expect)}) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:num_notes_refs) op:Equal rhs:{(10)} spids:[1532])] spids: [1532] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:num_commits) op:Equal rhs:{(16)} spids:[1535])] spids: [1535] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:some_commits) op:Equal rhs:{(8)} spids:[1538])] spids: [1538] ) (C {(fast_import_commits)} {(DQ (refs/heads/more_commits))} {($ VSub_Name '$num_commits')} {(input)}) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:i) op:Equal rhs:{(0)} spids:[1557])] spids: [1557] ) (While cond: [(C {(test)} {($ VSub_Name '$i')} {(-lt)} {($ VSub_Name '$num_notes_refs')})] body: (DoGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:i) op: Equal rhs: { (ArithSubPart anode: (ArithBinary op_id: Arith_Plus left: (ArithWord w:{($ VSub_Name '$i')}) right: (ArithWord w:{(Lit_Digits 1)}) ) spids: [1574 1581] ) } spids: [1573] ) ] spids: [1573] ) (C {(fast_import_notes)} {(DQ (refs/notes/more_notes_) ($ VSub_Name '$i'))} {($ VSub_Name '$num_commits')} {(input)} ) ] spids: [1570 1595] ) ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:i) op:Equal rhs:{(0)} spids:[1600])] spids: [1600] ) (While cond: [(C {(test)} {($ VSub_Name '$i')} {(-lt)} {($ VSub_Name '$num_notes_refs')})] body: (DoGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:i) op: Equal rhs: { (ArithSubPart anode: (ArithBinary op_id: Arith_Plus left: (ArithWord w:{($ VSub_Name '$i')}) right: (ArithWord w:{(Lit_Digits 1)}) ) spids: [1617 1624] ) } spids: [1616] ) ] spids: [1616] ) (C {(fast_import_notes)} {(DQ (refs/notes/more_notes_) ($ VSub_Name '$i'))} {($ VSub_Name '$some_commits')} {(input)} {(DQ (' (2)'))} ) ] spids: [1613 1642] ) ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:i) op: Equal rhs: {($ VSub_Name '$num_commits')} spids: [1647] ) ] spids: [1647] ) (While cond: [(C {(test)} {($ VSub_Name '$i')} {(-gt)} {(0)})] body: (DoGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:note_data) op: Equal rhs: {(DQ ('note for commit #') ($ VSub_Name '$i'))} spids: [1663] ) ] spids: [1663] ) (If arms: [ (if_arm cond: [(C {(test)} {($ VSub_Name '$i')} {(-le)} {($ VSub_Name '$some_commits')})] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:note_data) op: Equal rhs: {(DQ ($ VSub_Name '$note_data') (' (2)'))} spids: [1684] ) ] spids: [1684] ) ] spids: [-1 1681] ) ] spids: [-1 1691] ) (SimpleCommand words: [{(cat)}] redirects: [ (Redir op_id:Redir_DGreat fd:-1 arg_word:{(expect)} spids:[1696]) (HereDoc op_id: Redir_DLess fd: -1 body: { (DQ (' commit #') ($ VSub_Name '$i') ('\n') (' ') ($ VSub_Name '$note_data') ('\n') ) } do_expansion: True here_end: EXPECT_END was_filled: True spids: [1699] ) ] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:i) op: Equal rhs: { (ArithSubPart anode: (ArithBinary op_id: Arith_Minus left: (ArithWord w:{($ VSub_Name '$i')}) right: (ArithWord w:{(Lit_Digits 1)}) ) spids: [1711 1718] ) } spids: [1710] ) ] spids: [1710] ) ] spids: [1660 1720] ) ) (C {(test_expect_success)} { (DQ ('add notes to ') ($ VSub_Name '$num_commits') (' commits in each of ') ($ VSub_Name '$num_notes_refs') (' refs') ) } { (SQ <'\n'> <'\n'> <'\tgit fast-import --active-branches=5 <input &&\n'> <'\tGIT_NOTES_REF=refs/notes/more_notes_1 git log refs/heads/more_commits |\n'> <'\t grep "^ " > actual &&\n'> <'\ttest_cmp expect actual\n'> <'\n'> ) } ) (C {(test_done)}) ] )