(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:16777215 arg_word:{(input)} spids:[28])
        (HereDoc
          op_id: Redir_DLess
          fd: 16777215
          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:16777215 arg_word:{(input)} spids:[183])
        (HereDoc
          op_id: Redir_DLess
          fd: 16777215
          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:16777215 arg_word:{(expect)} spids:[219])
        (HereDoc
          op_id: Redir_DLess
          fd: 16777215
          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:16777215 arg_word:{(input)} spids:[253])
        (HereDoc
          op_id: Redir_DLess
          fd: 16777215
          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:16777215 arg_word:{(expect)} spids:[291])
        (HereDoc
          op_id: Redir_DLess
          fd: 16777215
          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:16777215 arg_word:{(input)} spids:[327])
        (HereDoc
          op_id: Redir_DLess
          fd: 16777215
          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:16777215 arg_word:{(expect)} spids:[378])
        (HereDoc
          op_id: Redir_DLess
          fd: 16777215
          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:16777215 arg_word:{(input)} spids:[414])
        (HereDoc
          op_id: Redir_DLess
          fd: 16777215
          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|^') (Lit_Other '\\') ('(..') (Lit_Other '\\') (')') 
                                  (Lit_Other '\\') ('(..') (Lit_Other '\\') (')|') (Lit_Other '\\') (1/) (Lit_Other '\\') ('2/|')
                                )
                              }
                            )
                          ]
                          negated: False
                        )
                      ]
                    )
                  left_token: <Left_CommandSub '$('>
                  spids: [476 502]
                ) ('\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:[539])]
      spids: [539]
    )
    (SimpleCommand
      words: [{(cat)}]
      redirects: [
        (Redir op_id:Redir_Great fd:16777215 arg_word:{(expect)} spids:[547])
        (HereDoc
          op_id: Redir_DLess
          fd: 16777215
          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: [550]
        )
      ]
    )
    (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:16777215 arg_word:{(input)} spids:[592])
        (HereDoc
          op_id: Redir_DLess
          fd: 16777215
          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: [595]
        )
      ]
    )
    (SimpleCommand
      words: [{(cat)}]
      redirects: [
        (Redir op_id:Redir_Great fd:16777215 arg_word:{(expect)} spids:[617])
        (HereDoc
          op_id: Redir_DLess
          fd: 16777215
          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: [620]
        )
      ]
    )
    (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:16777215 arg_word:{(input)} spids:[649])
        (HereDoc
          op_id: Redir_DLess
          fd: 16777215
          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: [652]
        )
      ]
    )
    (SimpleCommand
      words: [{(cat)}]
      redirects: [
        (Redir op_id:Redir_Great fd:16777215 arg_word:{(expect)} spids:[700])
        (HereDoc
          op_id: Redir_DLess
          fd: 16777215
          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: [703]
        )
      ]
    )
    (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: [741]
                )
              ]
              spids: [741]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:my_num_commits)
                  op: Equal
                  rhs: {($ VSub_Number '$2')}
                  spids: [745]
                )
              ]
              spids: [745]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:my_append_to_file)
                  op: Equal
                  rhs: {($ VSub_Number '$3')}
                  spids: [749]
                )
              ]
              spids: [749]
            )
            (Assignment
              keyword: Assign_None
              pairs: [(assign_pair lhs:(LhsName name:my_i) op:Equal rhs:{(0)} spids:[753])]
              spids: [753]
            )
            (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: [772 779]
                              )
                            }
                          spids: [771]
                        )
                      ]
                      spids: [771]
                    )
                    (C {(test_tick)})
                    (SimpleCommand
                      words: [{(cat)}]
                      redirects: [
                        (Redir
                          op_id: Redir_DGreat
                          fd: 16777215
                          arg_word: {(DQ ($ VSub_Name '$my_append_to_file'))}
                          spids: [787]
                        )
                        (HereDoc
                          op_id: Redir_DLess
                          fd: 16777215
                          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: [792]
                        )
                      ]
                    )
                  ]
                  spids: [768 823]
                )
            )
          ]
          spids: [738]
        )
      spids: [733 737]
    )
    (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: [842]
                )
              ]
              spids: [842]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:my_num_commits)
                  op: Equal
                  rhs: {($ VSub_Number '$2')}
                  spids: [846]
                )
              ]
              spids: [846]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:my_append_to_file)
                  op: Equal
                  rhs: {($ VSub_Number '$3')}
                  spids: [850]
                )
              ]
              spids: [850]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:my_note_append)
                  op: Equal
                  rhs: {($ VSub_Number '$4')}
                  spids: [854]
                )
              ]
              spids: [854]
            )
            (C {(test_tick)})
            (SimpleCommand
              words: [{(cat)}]
              redirects: [
                (Redir
                  op_id: Redir_DGreat
                  fd: 16777215
                  arg_word: {(DQ ($ VSub_Name '$my_append_to_file'))}
                  spids: [863]
                )
                (HereDoc
                  op_id: Redir_DLess
                  fd: 16777215
                  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: [868]
                )
              ]
            )
            (Assignment
              keyword: Assign_None
              pairs: [(assign_pair lhs:(LhsName name:my_i) op:Equal rhs:{(0)} spids:[890])]
              spids: [890]
            )
            (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: [909 916]
                              )
                            }
                          spids: [908]
                        )
                      ]
                      spids: [908]
                    )
                    (SimpleCommand
                      words: [{(cat)}]
                      redirects: [
                        (Redir
                          op_id: Redir_DGreat
                          fd: 16777215
                          arg_word: {(DQ ($ VSub_Name '$my_append_to_file'))}
                          spids: [921]
                        )
                        (HereDoc
                          op_id: Redir_DLess
                          fd: 16777215
                          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: [926]
                        )
                      ]
                    )
                  ]
                  spids: [905 941]
                )
            )
          ]
          spids: [839]
        )
      spids: [834 838]
    )
    (C {(rm)} {(input)} {(expect)})
    (Assignment
      keyword: Assign_None
      pairs: [(assign_pair lhs:(LhsName name:num_commits) op:Equal rhs:{(400)} spids:[953])]
      spids: [953]
    )
    (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:16777215 arg_word:{(input)} spids:[989])
        (HereDoc
          op_id: Redir_DLess
          fd: 16777215
          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: [992]
        )
      ]
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:i)
          op: Equal
          rhs: {($ VSub_Name '$num_commits')}
          spids: [1026]
        )
      ]
      spids: [1026]
    )
    (While
      cond: [(C {(test)} {($ VSub_Name '$i')} {(-gt)} {(0)})]
      body: 
        (DoGroup
          children: [
            (SimpleCommand
              words: [{(cat)}]
              redirects: [
                (Redir
                  op_id: Redir_DGreat
                  fd: 16777215
                  arg_word: {(expect)}
                  spids: [1044]
                )
                (HereDoc
                  op_id: Redir_DLess
                  fd: 16777215
                  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: [1047]
                )
              ]
            )
            (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: [1059 1066]
                      )
                    }
                  spids: [1058]
                )
              ]
              spids: [1058]
            )
          ]
          spids: [1039 1068]
        )
    )
    (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:16777215 arg_word:{(expect_non-note1)} spids:[1112])
        (HereDoc
          op_id: Redir_DLess
          fd: 16777215
          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: [1115]
        )
      ]
    )
    (SimpleCommand
      words: [{(cat)}]
      redirects: [
        (Redir op_id:Redir_DGreat fd:16777215 arg_word:{(expect_non-note2)} spids:[1124])
        (HereDoc
          op_id: Redir_DLess
          fd: 16777215
          body: {(DQ ('Non-note file\n'))}
          do_expansion: True
          here_end: EOF
          was_filled: True
          spids: [1127]
        )
      ]
    )
    (SimpleCommand
      words: [{(cat)}]
      redirects: [
        (Redir op_id:Redir_DGreat fd:16777215 arg_word:{(expect_non-note3)} spids:[1136])
        (HereDoc
          op_id: Redir_DLess
          fd: 16777215
          body: {(DQ ('Another non-note file\n'))}
          do_expansion: True
          here_end: EOF
          was_filled: True
          spids: [1139]
        )
      ]
    )
    (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:16777215 arg_word:{(input)} spids:[1172])
        (HereDoc
          op_id: Redir_DLess
          fd: 16777215
          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: [1175]
        )
      ]
    )
    (C {(rm)} {(expect)})
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:i)
          op: Equal
          rhs: {($ VSub_Name '$num_commits')}
          spids: [1196]
        )
      ]
      spids: [1196]
    )
    (Assignment
      keyword: Assign_None
      pairs: [(assign_pair lhs:(LhsName name:j) op:Equal rhs:{(0)} spids:[1199])]
      spids: [1199]
    )
    (While
      cond: [(C {(test)} {($ VSub_Name '$j')} {(-lt)} {(3)})]
      body: 
        (DoGroup
          children: [
            (SimpleCommand
              words: [{(cat)}]
              redirects: [
                (Redir
                  op_id: Redir_DGreat
                  fd: 16777215
                  arg_word: {(input)}
                  spids: [1217]
                )
                (HereDoc
                  op_id: Redir_DLess
                  fd: 16777215
                  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: [1220]
                )
              ]
            )
            (SimpleCommand
              words: [{(cat)}]
              redirects: [
                (Redir
                  op_id: Redir_DGreat
                  fd: 16777215
                  arg_word: {(expect)}
                  spids: [1235]
                )
                (HereDoc
                  op_id: Redir_DLess
                  fd: 16777215
                  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: [1238]
                )
              ]
            )
            (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: [1250 1257]
                      )
                    }
                  spids: [1249]
                )
              ]
              spids: [1249]
            )
            (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: [1261 1268]
                      )
                    }
                  spids: [1260]
                )
              ]
              spids: [1260]
            )
          ]
          spids: [1212 1270]
        )
    )
    (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:[1312])]
      spids: [1312]
    )
    (C {(test_tick)})
    (SimpleCommand
      words: [{(cat)}]
      redirects: [
        (Redir op_id:Redir_Great fd:16777215 arg_word:{(input)} spids:[1319])
        (HereDoc
          op_id: Redir_DLess
          fd: 16777215
          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: [1322]
        )
      ]
    )
    (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: [1342 1349]
              )
            }
          spids: [1341]
        )
      ]
      spids: [1341]
    )
    (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: [1357 1367]
          )
        }
      ]
      do_arg_iter: False
      body: 
        (DoGroup
          children: [
            (SimpleCommand
              words: [{(cat)}]
              redirects: [
                (Redir
                  op_id: Redir_DGreat
                  fd: 16777215
                  arg_word: {(input)}
                  spids: [1374]
                )
                (HereDoc
                  op_id: Redir_DLess
                  fd: 16777215
                  body: 
                    {
                      (DQ ('N 0000000000000000000000000000000000000000 ') ($ VSub_Name '$sha1') ('\n'))
                    }
                  do_expansion: True
                  here_end: INPUT_END
                  was_filled: True
                  spids: [1377]
                )
              ]
            )
          ]
          spids: [1369 1384]
        )
      spids: [1356 16777215]
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:i)
          op: Equal
          rhs: {($ VSub_Name '$num_commits')}
          spids: [1387]
        )
      ]
      spids: [1387]
    )
    (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: 16777215
                  arg_word: {(expect)}
                  spids: [1409]
                )
                (HereDoc
                  op_id: Redir_DLess
                  fd: 16777215
                  body: {(DQ ('    commit #') ($ VSub_Name '$i') ('\n'))}
                  do_expansion: True
                  here_end: EXPECT_END
                  was_filled: True
                  spids: [1412]
                )
              ]
            )
            (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: 16777215
                          arg_word: {(expect)}
                          spids: [1436]
                        )
                        (HereDoc
                          op_id: Redir_DLess
                          fd: 16777215
                          body: {(DQ ('    note for commit #') ($ VSub_Name '$i') ('\n'))}
                          do_expansion: True
                          here_end: EXPECT_END
                          was_filled: True
                          spids: [1439]
                        )
                      ]
                    )
                  ]
                  spids: [16777215 1431]
                )
              ]
              spids: [16777215 1447]
            )
            (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: [1451 1458]
                      )
                    }
                  spids: [1450]
                )
              ]
              spids: [1450]
            )
          ]
          spids: [1404 1460]
        )
    )
    (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:[1533])]
      spids: [1533]
    )
    (Assignment
      keyword: Assign_None
      pairs: [(assign_pair lhs:(LhsName name:num_commits) op:Equal rhs:{(16)} spids:[1536])]
      spids: [1536]
    )
    (Assignment
      keyword: Assign_None
      pairs: [(assign_pair lhs:(LhsName name:some_commits) op:Equal rhs:{(8)} spids:[1539])]
      spids: [1539]
    )
    (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:[1558])]
      spids: [1558]
    )
    (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: [1575 1582]
                      )
                    }
                  spids: [1574]
                )
              ]
              spids: [1574]
            )
            (C {(fast_import_notes)} {(DQ (refs/notes/more_notes_) ($ VSub_Name '$i'))} 
              {($ VSub_Name '$num_commits')} {(input)}
            )
          ]
          spids: [1571 1596]
        )
    )
    (Assignment
      keyword: Assign_None
      pairs: [(assign_pair lhs:(LhsName name:i) op:Equal rhs:{(0)} spids:[1601])]
      spids: [1601]
    )
    (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: [1618 1625]
                      )
                    }
                  spids: [1617]
                )
              ]
              spids: [1617]
            )
            (C {(fast_import_notes)} {(DQ (refs/notes/more_notes_) ($ VSub_Name '$i'))} 
              {($ VSub_Name '$some_commits')} {(input)} {(DQ (' (2)'))}
            )
          ]
          spids: [1614 1643]
        )
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:i)
          op: Equal
          rhs: {($ VSub_Name '$num_commits')}
          spids: [1648]
        )
      ]
      spids: [1648]
    )
    (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: [1664]
                )
              ]
              spids: [1664]
            )
            (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: [1685]
                        )
                      ]
                      spids: [1685]
                    )
                  ]
                  spids: [16777215 1682]
                )
              ]
              spids: [16777215 1692]
            )
            (SimpleCommand
              words: [{(cat)}]
              redirects: [
                (Redir
                  op_id: Redir_DGreat
                  fd: 16777215
                  arg_word: {(expect)}
                  spids: [1697]
                )
                (HereDoc
                  op_id: Redir_DLess
                  fd: 16777215
                  body: 
                    {
                      (DQ ('    commit #') ($ VSub_Name '$i') ('\n') ('    ') ($ VSub_Name '$note_data') 
                        ('\n')
                      )
                    }
                  do_expansion: True
                  here_end: EXPECT_END
                  was_filled: True
                  spids: [1700]
                )
              ]
            )
            (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: [1712 1719]
                      )
                    }
                  spids: [1711]
                )
              ]
              spids: [1711]
            )
          ]
          spids: [1661 1721]
        )
    )
    (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)})
  ]
)