(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:<Redir_Great '>'> fd:16777215 arg_word:{(input)})
        (HereDoc
          op: <Redir_DLess '<<'>
          fd: 16777215
          here_begin: {(INPUT_END)}
          here_end_span_id: 118
          stdin_parts: [
            ('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')
          ]
        )
      ]
    )
    (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: [135 141]
              )
            }
          spids: [134]
        )
      ]
      spids: [134]
    )
    (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: [144 153]
              )
            }
          spids: [143]
        )
      ]
      spids: [143]
    )
    (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: [156 165]
              )
            }
          spids: [155]
        )
      ]
      spids: [155]
    )
    (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: [168 177]
              )
            }
          spids: [167]
        )
      ]
      spids: [167]
    )
    (C {(test_tick)})
    (SimpleCommand
      words: [{(cat)}]
      redirects: [
        (Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(input)})
        (HereDoc
          op: <Redir_DLess '<<'>
          fd: 16777215
          here_begin: {(INPUT_END)}
          here_end_span_id: 217
          stdin_parts: [
            ('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')
          ]
        )
      ]
    )
    (SimpleCommand
      words: [{(cat)}]
      redirects: [
        (Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(expect)})
        (HereDoc
          op: <Redir_DLess '<<'>
          fd: 16777215
          here_begin: {(EXPECT_END)}
          here_end_span_id: 234
          stdin_parts: [
            ('    fourth commit\n')
            ('    third commit\n')
            ('    second commit\n')
            ('    first note for second commit\n')
            ('    first commit\n')
            ('    first note for first commit\n')
          ]
        )
      ]
    )
    (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:<Redir_Great '>'> fd:16777215 arg_word:{(input)})
        (HereDoc
          op: <Redir_DLess '<<'>
          fd: 16777215
          here_begin: {(INPUT_END)}
          here_end_span_id: 291
          stdin_parts: [
            ('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')
          ]
        )
      ]
    )
    (SimpleCommand
      words: [{(cat)}]
      redirects: [
        (Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(expect)})
        (HereDoc
          op: <Redir_DLess '<<'>
          fd: 16777215
          here_begin: {(EXPECT_END)}
          here_end_span_id: 310
          stdin_parts: [
            ('    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')
          ]
        )
      ]
    )
    (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:<Redir_Great '>'> fd:16777215 arg_word:{(input)})
        (HereDoc
          op: <Redir_DLess '<<'>
          fd: 16777215
          here_begin: {(INPUT_END)}
          here_end_span_id: 380
          stdin_parts: [
            ('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')
          ]
        )
      ]
    )
    (SimpleCommand
      words: [{(cat)}]
      redirects: [
        (Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(expect)})
        (HereDoc
          op: <Redir_DLess '<<'>
          fd: 16777215
          here_begin: {(EXPECT_END)}
          here_end_span_id: 399
          stdin_parts: [
            ('    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')
          ]
        )
      ]
    )
    (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:<Redir_Great '>'> fd:16777215 arg_word:{(input)})
        (HereDoc
          op: <Redir_DLess '<<'>
          fd: 16777215
          here_begin: {(INPUT_END)}
          here_end_span_id: 545
          stdin_parts: [
            ('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: F
                    )
                  ]
                )
              left_token: <Left_CommandSub '$('>
              spids: [441 455]
            )
            ('\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: F
                    )
                  ]
                )
              left_token: <Left_CommandSub '$('>
              spids: [462 476]
            )
            ('\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|^') (Lit_Other '\\') ('(..') (Lit_Other '\\') (')') (Lit_Other '\\') 
                              ('(..') (Lit_Other '\\') (')|') (Lit_Other '\\') (1/) (Lit_Other '\\') ('2/|')
                            )
                          }
                        )
                      ]
                      negated: F
                    )
                  ]
                )
              left_token: <Left_CommandSub '$('>
              spids: [483 509]
            )
            ('\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')
          ]
        )
      ]
    )
    (Assignment
      keyword: Assign_None
      pairs: [(assign_pair lhs:(LhsName name:whitespace) op:Equal rhs:{(DQ ('    '))} spids:[547])]
      spids: [547]
    )
    (SimpleCommand
      words: [{(cat)}]
      redirects: [
        (Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(expect)})
        (HereDoc
          op: <Redir_DLess '<<'>
          fd: 16777215
          here_begin: {(EXPECT_END)}
          here_end_span_id: 579
          stdin_parts: [
            ('    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')
          ]
        )
      ]
    )
    (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:<Redir_Great '>'> fd:16777215 arg_word:{(input)})
        (HereDoc
          op: <Redir_DLess '<<'>
          fd: 16777215
          here_begin: {(INPUT_END)}
          here_end_span_id: 623
          stdin_parts: [
            ('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')
          ]
        )
      ]
    )
    (SimpleCommand
      words: [{(cat)}]
      redirects: [
        (Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(expect)})
        (HereDoc
          op: <Redir_DLess '<<'>
          fd: 16777215
          here_begin: {(EXPECT_END)}
          here_end_span_id: 638
          stdin_parts: [
            ('    fourth commit\n')
            ('    third commit\n')
            ('    second commit\n')
            ('    first commit\n')
          ]
        )
      ]
    )
    (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:<Redir_Great '>'> fd:16777215 arg_word:{(input)})
        (HereDoc
          op: <Redir_DLess '<<'>
          fd: 16777215
          here_begin: {(INPUT_END)}
          here_end_span_id: 708
          stdin_parts: [
            ('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')
          ]
        )
      ]
    )
    (SimpleCommand
      words: [{(cat)}]
      redirects: [
        (Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(expect)})
        (HereDoc
          op: <Redir_DLess '<<'>
          fd: 16777215
          here_begin: {(EXPECT_END)}
          here_end_span_id: 725
          stdin_parts: [
            ('    fourth commit\n')
            ('    third commit\n')
            ('    fourth note for third commit\n')
            ('    second commit\n')
            ('    first commit\n')
            ('    fourth note for first commit\n')
          ]
        )
      ]
    )
    (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: [754]
                )
              ]
              spids: [754]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:my_num_commits)
                  op: Equal
                  rhs: {($ VSub_Number '$2')}
                  spids: [758]
                )
              ]
              spids: [758]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:my_append_to_file)
                  op: Equal
                  rhs: {($ VSub_Number '$3')}
                  spids: [762]
                )
              ]
              spids: [762]
            )
            (Assignment
              keyword: Assign_None
              pairs: [(assign_pair lhs:(LhsName name:my_i) op:Equal rhs:{(0)} spids:[766])]
              spids: [766]
            )
            (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: [785 792]
                              )
                            }
                          spids: [784]
                        )
                      ]
                      spids: [784]
                    )
                    (C {(test_tick)})
                    (SimpleCommand
                      words: [{(cat)}]
                      redirects: [
                        (Redir
                          op: <Redir_DGreat '>>'>
                          fd: 16777215
                          arg_word: {(DQ ($ VSub_Name '$my_append_to_file'))}
                        )
                        (HereDoc
                          op: <Redir_DLess '<<'>
                          fd: 16777215
                          here_begin: {(INPUT_END)}
                          here_end_span_id: 835
                          stdin_parts: [
                            ('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')
                          ]
                        )
                      ]
                    )
                  ]
                  spids: [781 837]
                )
            )
          ]
          spids: [751]
        )
      spids: [746 750]
    )
    (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: [856]
                )
              ]
              spids: [856]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:my_num_commits)
                  op: Equal
                  rhs: {($ VSub_Number '$2')}
                  spids: [860]
                )
              ]
              spids: [860]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:my_append_to_file)
                  op: Equal
                  rhs: {($ VSub_Number '$3')}
                  spids: [864]
                )
              ]
              spids: [864]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:my_note_append)
                  op: Equal
                  rhs: {($ VSub_Number '$4')}
                  spids: [868]
                )
              ]
              spids: [868]
            )
            (C {(test_tick)})
            (SimpleCommand
              words: [{(cat)}]
              redirects: [
                (Redir
                  op: <Redir_DGreat '>>'>
                  fd: 16777215
                  arg_word: {(DQ ($ VSub_Name '$my_append_to_file'))}
                )
                (HereDoc
                  op: <Redir_DLess '<<'>
                  fd: 16777215
                  here_begin: {(INPUT_END)}
                  here_end_span_id: 902
                  stdin_parts: [
                    ('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')
                  ]
                )
              ]
            )
            (Assignment
              keyword: Assign_None
              pairs: [(assign_pair lhs:(LhsName name:my_i) op:Equal rhs:{(0)} spids:[905])]
              spids: [905]
            )
            (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: [924 931]
                              )
                            }
                          spids: [923]
                        )
                      ]
                      spids: [923]
                    )
                    (SimpleCommand
                      words: [{(cat)}]
                      redirects: [
                        (Redir
                          op: <Redir_DGreat '>>'>
                          fd: 16777215
                          arg_word: {(DQ ($ VSub_Name '$my_append_to_file'))}
                        )
                        (HereDoc
                          op: <Redir_DLess '<<'>
                          fd: 16777215
                          here_begin: {(INPUT_END)}
                          here_end_span_id: 955
                          stdin_parts: [
                            ('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')
                          ]
                        )
                      ]
                    )
                  ]
                  spids: [920 957]
                )
            )
          ]
          spids: [853]
        )
      spids: [848 852]
    )
    (C {(rm)} {(input)} {(expect)})
    (Assignment
      keyword: Assign_None
      pairs: [(assign_pair lhs:(LhsName name:num_commits) op:Equal rhs:{(400)} spids:[969])]
      spids: [969]
    )
    (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:<Redir_DGreat '>>'> fd:16777215 arg_word:{(input)})
        (HereDoc
          op: <Redir_DLess '<<'>
          fd: 16777215
          here_begin: {(INPUT_END)}
          here_end_span_id: 1039
          stdin_parts: [
            ('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')
          ]
        )
      ]
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:i)
          op: Equal
          rhs: {($ VSub_Name '$num_commits')}
          spids: [1043]
        )
      ]
      spids: [1043]
    )
    (While
      cond: [(C {(test)} {($ VSub_Name '$i')} {(-gt)} {(0)})]
      body: 
        (DoGroup
          children: [
            (SimpleCommand
              words: [{(cat)}]
              redirects: [
                (Redir op:<Redir_DGreat '>>'> fd:16777215 arg_word:{(expect)})
                (HereDoc
                  op: <Redir_DLess '<<'>
                  fd: 16777215
                  here_begin: {(EXPECT_END)}
                  here_end_span_id: 1074
                  stdin_parts: [
                    ('    commit #')
                    ($ VSub_Name '$i')
                    ('\n')
                    ('    note for commit #')
                    ($ VSub_Name '$i')
                    ('\n')
                  ]
                )
              ]
            )
            (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: [1077 1084]
                      )
                    }
                  spids: [1076]
                )
              ]
              spids: [1076]
            )
          ]
          spids: [1056 1086]
        )
    )
    (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:<Redir_DGreat '>>'> fd:16777215 arg_word:{(expect_non-note1)})
        (HereDoc
          op: <Redir_DLess '<<'>
          fd: 16777215
          here_begin: {(EOF)}
          here_end_span_id: 1139
          stdin_parts: [('This is not a note, but rather a regular file residing in a notes tree\n')]
        )
      ]
    )
    (SimpleCommand
      words: [{(cat)}]
      redirects: [
        (Redir op:<Redir_DGreat '>>'> fd:16777215 arg_word:{(expect_non-note2)})
        (HereDoc
          op: <Redir_DLess '<<'>
          fd: 16777215
          here_begin: {(EOF)}
          here_end_span_id: 1152
          stdin_parts: [('Non-note file\n')]
        )
      ]
    )
    (SimpleCommand
      words: [{(cat)}]
      redirects: [
        (Redir op:<Redir_DGreat '>>'> fd:16777215 arg_word:{(expect_non-note3)})
        (HereDoc
          op: <Redir_DLess '<<'>
          fd: 16777215
          here_begin: {(EOF)}
          here_end_span_id: 1165
          stdin_parts: [('Another non-note file\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 {(test_tick)})
    (SimpleCommand
      words: [{(cat)}]
      redirects: [
        (Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(input)})
        (HereDoc
          op: <Redir_DLess '<<'>
          fd: 16777215
          here_begin: {(INPUT_END)}
          here_end_span_id: 1212
          stdin_parts: [
            ('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')
          ]
        )
      ]
    )
    (C {(rm)} {(expect)})
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:i)
          op: Equal
          rhs: {($ VSub_Name '$num_commits')}
          spids: [1218]
        )
      ]
      spids: [1218]
    )
    (Assignment
      keyword: Assign_None
      pairs: [(assign_pair lhs:(LhsName name:j) op:Equal rhs:{(0)} spids:[1221])]
      spids: [1221]
    )
    (While
      cond: [(C {(test)} {($ VSub_Name '$j')} {(-lt)} {(3)})]
      body: 
        (DoGroup
          children: [
            (SimpleCommand
              words: [{(cat)}]
              redirects: [
                (Redir op:<Redir_DGreat '>>'> fd:16777215 arg_word:{(input)})
                (HereDoc
                  op: <Redir_DLess '<<'>
                  fd: 16777215
                  here_begin: {(INPUT_END)}
                  here_end_span_id: 1254
                  stdin_parts: [
                    ('N inline refs/heads/many_commits~')
                    ($ VSub_Name '$j')
                    ('\n')
                    ('data <<EOF\n')
                    ('changed note for commit #')
                    ($ VSub_Name '$i')
                    ('\n')
                    ('EOF\n')
                  ]
                )
              ]
            )
            (SimpleCommand
              words: [{(cat)}]
              redirects: [
                (Redir op:<Redir_DGreat '>>'> fd:16777215 arg_word:{(expect)})
                (HereDoc
                  op: <Redir_DLess '<<'>
                  fd: 16777215
                  here_begin: {(EXPECT_END)}
                  here_end_span_id: 1271
                  stdin_parts: [
                    ('    commit #')
                    ($ VSub_Name '$i')
                    ('\n')
                    ('    changed note for commit #')
                    ($ VSub_Name '$i')
                    ('\n')
                  ]
                )
              ]
            )
            (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: [1274 1281]
                      )
                    }
                  spids: [1273]
                )
              ]
              spids: [1273]
            )
            (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: [1285 1292]
                      )
                    }
                  spids: [1284]
                )
              ]
              spids: [1284]
            )
          ]
          spids: [1234 1294]
        )
    )
    (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:[1336])]
      spids: [1336]
    )
    (C {(test_tick)})
    (SimpleCommand
      words: [{(cat)}]
      redirects: [
        (Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(input)})
        (HereDoc
          op: <Redir_DLess '<<'>
          fd: 16777215
          here_begin: {(INPUT_END)}
          here_end_span_id: 1364
          stdin_parts: [
            ('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')
          ]
        )
      ]
    )
    (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: [1367 1374]
              )
            }
          spids: [1366]
        )
      ]
      spids: [1366]
    )
    (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: [1382 1392]
          )
        }
      ]
      do_arg_iter: F
      body: 
        (DoGroup
          children: [
            (SimpleCommand
              words: [{(cat)}]
              redirects: [
                (Redir op:<Redir_DGreat '>>'> fd:16777215 arg_word:{(input)})
                (HereDoc
                  op: <Redir_DLess '<<'>
                  fd: 16777215
                  here_begin: {(INPUT_END)}
                  here_end_span_id: 1409
                  stdin_parts: [
                    ('N 0000000000000000000000000000000000000000 ')
                    ($ VSub_Name '$sha1')
                    ('\n')
                  ]
                )
              ]
            )
          ]
          spids: [1394 1410]
        )
      spids: [1381 16777215]
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:i)
          op: Equal
          rhs: {($ VSub_Name '$num_commits')}
          spids: [1413]
        )
      ]
      spids: [1413]
    )
    (C {(rm)} {(expect)})
    (While
      cond: [(C {(test)} {($ VSub_Name '$i')} {(-gt)} {(0)})]
      body: 
        (DoGroup
          children: [
            (SimpleCommand
              words: [{(cat)}]
              redirects: [
                (Redir op:<Redir_DGreat '>>'> fd:16777215 arg_word:{(expect)})
                (HereDoc
                  op: <Redir_DLess '<<'>
                  fd: 16777215
                  here_begin: {(EXPECT_END)}
                  here_end_span_id: 1445
                  stdin_parts: [('    commit #') ($ VSub_Name '$i') ('\n')]
                )
              ]
            )
            (If
              arms: [
                (if_arm
                  cond: [(C {(test)} {($ VSub_Name '$i')} {(-le)} {($ VSub_Name '$remaining_notes')})]
                  action: [
                    (SimpleCommand
                      words: [{(cat)}]
                      redirects: [
                        (Redir
                          op: <Redir_DGreat '>>'>
                          fd: 16777215
                          arg_word: {(expect)}
                        )
                        (HereDoc
                          op: <Redir_DLess '<<'>
                          fd: 16777215
                          here_begin: {(EXPECT_END)}
                          here_end_span_id: 1473
                          stdin_parts: [('    note for commit #') ($ VSub_Name '$i') ('\n')]
                        )
                      ]
                    )
                  ]
                  spids: [16777215 1458]
                )
              ]
              spids: [16777215 1475]
            )
            (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: [1479 1486]
                      )
                    }
                  spids: [1478]
                )
              ]
              spids: [1478]
            )
          ]
          spids: [1430 1488]
        )
    )
    (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:[1561])]
      spids: [1561]
    )
    (Assignment
      keyword: Assign_None
      pairs: [(assign_pair lhs:(LhsName name:num_commits) op:Equal rhs:{(16)} spids:[1564])]
      spids: [1564]
    )
    (Assignment
      keyword: Assign_None
      pairs: [(assign_pair lhs:(LhsName name:some_commits) op:Equal rhs:{(8)} spids:[1567])]
      spids: [1567]
    )
    (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:[1586])]
      spids: [1586]
    )
    (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: [1603 1610]
                      )
                    }
                  spids: [1602]
                )
              ]
              spids: [1602]
            )
            (C {(fast_import_notes)} {(DQ (refs/notes/more_notes_) ($ VSub_Name '$i'))} 
              {($ VSub_Name '$num_commits')} {(input)}
            )
          ]
          spids: [1599 1624]
        )
    )
    (Assignment
      keyword: Assign_None
      pairs: [(assign_pair lhs:(LhsName name:i) op:Equal rhs:{(0)} spids:[1629])]
      spids: [1629]
    )
    (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: [1646 1653]
                      )
                    }
                  spids: [1645]
                )
              ]
              spids: [1645]
            )
            (C {(fast_import_notes)} {(DQ (refs/notes/more_notes_) ($ VSub_Name '$i'))} 
              {($ VSub_Name '$some_commits')} {(input)} {(DQ (' (2)'))}
            )
          ]
          spids: [1642 1671]
        )
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:i)
          op: Equal
          rhs: {($ VSub_Name '$num_commits')}
          spids: [1676]
        )
      ]
      spids: [1676]
    )
    (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: [1692]
                )
              ]
              spids: [1692]
            )
            (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: [1713]
                        )
                      ]
                      spids: [1713]
                    )
                  ]
                  spids: [16777215 1710]
                )
              ]
              spids: [16777215 1720]
            )
            (SimpleCommand
              words: [{(cat)}]
              redirects: [
                (Redir op:<Redir_DGreat '>>'> fd:16777215 arg_word:{(expect)})
                (HereDoc
                  op: <Redir_DLess '<<'>
                  fd: 16777215
                  here_begin: {(EXPECT_END)}
                  here_end_span_id: 1738
                  stdin_parts: [
                    ('    commit #')
                    ($ VSub_Name '$i')
                    ('\n')
                    ('    ')
                    ($ VSub_Name '$note_data')
                    ('\n')
                  ]
                )
              ]
            )
            (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: [1741 1748]
                      )
                    }
                  spids: [1740]
                )
              ]
              spids: [1740]
            )
          ]
          spids: [1689 1750]
        )
    )
    (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)})
  ]
)