(CommandList
  children: [
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:test_description)
          op: Equal
          rhs: {(SQ <"test git fast-import of notes objects">)}
          spids: [13]
        )
      ]
      spids: [13]
    )
    (C {(.)} {(./test-lib.sh)})
    (C {(test_tick)})
    (SimpleCommand
      words: [{(cat)}]
      redirects: [
        (Redir op_id:Redir_Great fd:-1 arg_word:{(input)} spids:[28])
        (HereDoc
          op_id: Redir_DLess
          fd: -1
          body: 
            {
              (DQ ("commit refs/heads/master\n") ("committer ") ($ VSub_Name "$GIT_COMMITTER_NAME") 
                (" <") ($ VSub_Name "$GIT_COMMITTER_EMAIL") ("> ") ($ VSub_Name "$GIT_COMMITTER_DATE") ("\n") 
                ("data <<COMMIT\n") ("first commit\n") ("COMMIT\n") ("\n") ("M 644 inline foo\n") ("data <<EOF\n") 
                ("file foo in first commit\n") ("EOF\n") ("\n") ("M 755 inline bar\n") ("data <<EOF\n") ("file bar in first commit\n") ("EOF\n") ("\n") 
                ("M 644 inline baz/xyzzy\n") ("data <<EOF\n") ("file baz/xyzzy in first commit\n") ("EOF\n") ("\n") ("commit refs/heads/master\n") 
                ("committer ") ($ VSub_Name "$GIT_COMMITTER_NAME") (" <") ($ VSub_Name "$GIT_COMMITTER_EMAIL") ("> ") 
                ($ VSub_Name "$GIT_COMMITTER_DATE") ("\n") ("data <<COMMIT\n") ("second commit\n") ("COMMIT\n") ("\n") ("M 644 inline foo\n") ("data <<EOF\n") 
                ("file foo in second commit\n") ("EOF\n") ("\n") ("M 755 inline baz/xyzzy\n") ("data <<EOF\n") ("file baz/xyzzy in second commit\n") 
                ("EOF\n") ("\n") ("commit refs/heads/master\n") ("committer ") ($ VSub_Name "$GIT_COMMITTER_NAME") (" <") 
                ($ VSub_Name "$GIT_COMMITTER_EMAIL") ("> ") ($ VSub_Name "$GIT_COMMITTER_DATE") ("\n") ("data <<COMMIT\n") ("third commit\n") ("COMMIT\n") 
                ("\n") ("M 644 inline foo\n") ("data <<EOF\n") ("file foo in third commit\n") ("EOF\n") ("\n") 
                ("commit refs/heads/master\n") ("committer ") ($ VSub_Name "$GIT_COMMITTER_NAME") (" <") ($ VSub_Name "$GIT_COMMITTER_EMAIL") ("> ") 
                ($ VSub_Name "$GIT_COMMITTER_DATE") ("\n") ("data <<COMMIT\n") ("fourth commit\n") ("COMMIT\n") ("\n") ("M 755 inline bar\n") ("data <<EOF\n") 
                ("file bar in fourth commit\n") ("EOF\n") ("\n")
              )
            }
          do_expansion: True
          here_end: INPUT_END
          was_filled: True
          spids: [31]
        )
      ]
    )
    (C {(test_expect_success)} {(SQ <"set up master branch">)} 
      {(SQ <"\n"> <"\n"> <"\tgit fast-import <input &&\n"> <"\tgit whatchanged master\n">)}
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:commit4)
          op: Equal
          rhs: 
            {
              (CommandSubPart
                command_list: 
                  (CommandList
                    children: [(C {(git)} {(rev-parse)} {(refs/heads/master)})]
                  )
                left_token: <Left_CommandSub "$(">
                spids: [133 139]
              )
            }
          spids: [132]
        )
      ]
      spids: [132]
    )
    (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: [142 151]
              )
            }
          spids: [141]
        )
      ]
      spids: [141]
    )
    (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: [154 163]
              )
            }
          spids: [153]
        )
      ]
      spids: [153]
    )
    (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: [166 175]
              )
            }
          spids: [165]
        )
      ]
      spids: [165]
    )
    (C {(test_tick)})
    (SimpleCommand
      words: [{(cat)}]
      redirects: [
        (Redir op_id:Redir_Great fd:-1 arg_word:{(input)} spids:[182])
        (HereDoc
          op_id: Redir_DLess
          fd: -1
          body: 
            {
              (DQ ("commit refs/notes/test\n") ("committer ") ($ VSub_Name "$GIT_COMMITTER_NAME") (" <") 
                ($ VSub_Name "$GIT_COMMITTER_EMAIL") ("> ") ($ VSub_Name "$GIT_COMMITTER_DATE") ("\n") ("data <<COMMIT\n") ("first notes commit\n") 
                ("COMMIT\n") ("\n") ("M 644 inline ") ($ VSub_Name "$commit1") ("\n") ("data <<EOF\n") 
                ("first note for first commit\n") ("EOF\n") ("\n") ("M 755 inline ") ($ VSub_Name "$commit2") ("\n") ("data <<EOF\n") 
                ("first note for second commit\n") ("EOF\n") ("\n")
              )
            }
          do_expansion: True
          here_end: INPUT_END
          was_filled: True
          spids: [185]
        )
      ]
    )
    (SimpleCommand
      words: [{(cat)}]
      redirects: [
        (Redir op_id:Redir_Great fd:-1 arg_word:{(expect)} spids:[217])
        (HereDoc
          op_id: Redir_DLess
          fd: -1
          body: 
            {
              (DQ ("    fourth commit\n") ("    third commit\n") ("    second commit\n") 
                ("    first note for second commit\n") ("    first commit\n") ("    first note for first commit\n")
              )
            }
          do_expansion: True
          here_end: EXPECT_END
          was_filled: True
          spids: [220]
        )
      ]
    )
    (C {(test_expect_success)} {(SQ <"add notes with simple M command">)} 
      {
        (SQ <"\n"> <"\n"> <"\tgit fast-import <input &&\n"> 
          <"\tGIT_NOTES_REF=refs/notes/test git log | grep \"^    \" > actual &&\n"> <"\ttest_cmp expect actual\n"> <"\n">
        )
      }
    )
    (C {(test_tick)})
    (SimpleCommand
      words: [{(cat)}]
      redirects: [
        (Redir op_id:Redir_Great fd:-1 arg_word:{(input)} spids:[250])
        (HereDoc
          op_id: Redir_DLess
          fd: -1
          body: 
            {
              (DQ ("feature notes\n") ("commit refs/notes/test\n") ("committer ") 
                ($ VSub_Name "$GIT_COMMITTER_NAME") (" <") ($ VSub_Name "$GIT_COMMITTER_EMAIL") ("> ") ($ VSub_Name "$GIT_COMMITTER_DATE") ("\n") 
                ("data <<COMMIT\n") ("second notes commit\n") ("COMMIT\n") ("\n") ("from refs/notes/test^0\n") ("N inline ") 
                ($ VSub_Name "$commit3") ("\n") ("data <<EOF\n") ("first note for third commit\n") ("EOF\n") ("\n") ("N inline ") 
                ($ VSub_Name "$commit4") ("\n") ("data <<EOF\n") ("first note for fourth commit\n") ("EOF\n") ("\n")
              )
            }
          do_expansion: True
          here_end: INPUT_END
          was_filled: True
          spids: [253]
        )
      ]
    )
    (SimpleCommand
      words: [{(cat)}]
      redirects: [
        (Redir op_id:Redir_Great fd:-1 arg_word:{(expect)} spids:[287])
        (HereDoc
          op_id: Redir_DLess
          fd: -1
          body: 
            {
              (DQ ("    fourth commit\n") ("    first note for fourth commit\n") ("    third commit\n") 
                ("    first note for third commit\n") ("    second commit\n") ("    first note for second commit\n") ("    first commit\n") 
                ("    first note for first commit\n")
              )
            }
          do_expansion: True
          here_end: EXPECT_END
          was_filled: True
          spids: [290]
        )
      ]
    )
    (C {(test_expect_success)} {(SQ <"add notes with simple N command">)} 
      {
        (SQ <"\n"> <"\n"> <"\tgit fast-import <input &&\n"> 
          <"\tGIT_NOTES_REF=refs/notes/test git log | grep \"^    \" > actual &&\n"> <"\ttest_cmp expect actual\n"> <"\n">
        )
      }
    )
    (C {(test_tick)})
    (SimpleCommand
      words: [{(cat)}]
      redirects: [
        (Redir op_id:Redir_Great fd:-1 arg_word:{(input)} spids:[322])
        (HereDoc
          op_id: Redir_DLess
          fd: -1
          body: 
            {
              (DQ ("commit refs/notes/test\n") ("committer ") ($ VSub_Name "$GIT_COMMITTER_NAME") (" <") 
                ($ VSub_Name "$GIT_COMMITTER_EMAIL") ("> ") ($ VSub_Name "$GIT_COMMITTER_DATE") ("\n") ("data <<COMMIT\n") ("third notes commit\n") 
                ("COMMIT\n") ("\n") ("from refs/notes/test^0\n") ("N inline ") ($ VSub_Name "$commit1") ("\n") ("data <<EOF\n") 
                ("second note for first commit\n") ("EOF\n") ("\n") ("N inline ") ($ VSub_Name "$commit2") ("\n") ("data <<EOF\n") 
                ("second note for second commit\n") ("EOF\n") ("\n") ("N inline ") ($ VSub_Name "$commit3") ("\n") ("data <<EOF\n") 
                ("second note for third commit\n") ("EOF\n") ("\n") ("N inline ") ($ VSub_Name "$commit4") ("\n") ("data <<EOF\n") 
                ("second note for fourth commit\n") ("EOF\n") ("\n")
              )
            }
          do_expansion: True
          here_end: INPUT_END
          was_filled: True
          spids: [325]
        )
      ]
    )
    (SimpleCommand
      words: [{(cat)}]
      redirects: [
        (Redir op_id:Redir_Great fd:-1 arg_word:{(expect)} spids:[372])
        (HereDoc
          op_id: Redir_DLess
          fd: -1
          body: 
            {
              (DQ ("    fourth commit\n") ("    second note for fourth commit\n") 
                ("    third commit\n") ("    second note for third commit\n") ("    second commit\n") ("    second note for second commit\n") 
                ("    first commit\n") ("    second note for first commit\n")
              )
            }
          do_expansion: True
          here_end: EXPECT_END
          was_filled: True
          spids: [375]
        )
      ]
    )
    (C {(test_expect_success)} {(SQ <"update existing notes with N command">)} 
      {
        (SQ <"\n"> <"\n"> <"\tgit fast-import <input &&\n"> 
          <"\tGIT_NOTES_REF=refs/notes/test git log | grep \"^    \" > actual &&\n"> <"\ttest_cmp expect actual\n"> <"\n">
        )
      }
    )
    (C {(test_tick)})
    (SimpleCommand
      words: [{(cat)}]
      redirects: [
        (Redir op_id:Redir_Great fd:-1 arg_word:{(input)} spids:[407])
        (HereDoc
          op_id: Redir_DLess
          fd: -1
          body: 
            {
              (DQ ("commit refs/notes/test\n") ("committer ") ($ VSub_Name "$GIT_COMMITTER_NAME") (" <") 
                ($ VSub_Name "$GIT_COMMITTER_EMAIL") ("> ") ($ VSub_Name "$GIT_COMMITTER_DATE") ("\n") ("data <<COMMIT\n") ("fourth notes commit\n") 
                ("COMMIT\n") ("\n") ("from refs/notes/test^0\n") ("M 644 inline ") 
                (CommandSubPart
                  command_list: 
                    (CommandList
                      children: [
                        (Pipeline
                          children: [
                            (C {(echo)} {(DQ ($ VSub_Name "$commit3"))})
                            (C {(sed)} {(DQ ("s|^..|&/|"))})
                          ]
                          negated: False
                        )
                      ]
                    )
                  left_token: <Left_CommandSub "$(">
                  spids: [427 441]
                ) ("\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: [448 462]
                ) ("\n") ("data <<EOF\n") ("prefix of note for fourth commit\n") ("EOF\n") ("\n") ("M 644 inline ") 
                (CommandSubPart
                  command_list: 
                    (CommandList
                      children: [
                        (Pipeline
                          children: [
                            (C {(echo)} {(DQ ($ VSub_Name "$commit4"))})
                            (C {(sed)} 
                              {
                                (DQ ("s|^") (EscapedLiteralPart token:<Lit_EscapedChar "\\(">) (..) 
                                  (EscapedLiteralPart
                                    token: <Lit_EscapedChar "\\)">
                                  ) (EscapedLiteralPart token:<Lit_EscapedChar "\\(">) (..) 
                                  (EscapedLiteralPart
                                    token: <Lit_EscapedChar "\\)">
                                  ) ("|") (EscapedLiteralPart token:<Lit_EscapedChar "\\1">) (/) 
                                  (EscapedLiteralPart
                                    token: <Lit_EscapedChar "\\2">
                                  ) ("/|")
                                )
                              }
                            )
                          ]
                          negated: False
                        )
                      ]
                    )
                  left_token: <Left_CommandSub "$(">
                  spids: [469 494]
                ) ("\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: [410]
        )
      ]
    )
    (Assignment
      keyword: Assign_None
      pairs: [(assign_pair lhs:(LhsName name:whitespace) op:Equal rhs:{(DQ ("    "))} spids:[530])]
      spids: [530]
    )
    (SimpleCommand
      words: [{(cat)}]
      redirects: [
        (Redir op_id:Redir_Great fd:-1 arg_word:{(expect)} spids:[538])
        (HereDoc
          op_id: Redir_DLess
          fd: -1
          body: 
            {
              (DQ ("    fourth commit\n") ("    pre-prefix of note for fourth commit\n") 
                ($ VSub_Name "$whitespace") ("\n") ("    prefix of note for fourth commit\n") ($ VSub_Name "$whitespace") ("\n") 
                ("    third note for fourth commit\n") ("    third commit\n") ("    prefix of note for third commit\n") ($ VSub_Name "$whitespace") ("\n") 
                ("    third note for third commit\n") ("    second commit\n") ("    third note for second commit\n") ("    first commit\n") 
                ("    third note for first commit\n")
              )
            }
          do_expansion: True
          here_end: EXPECT_END
          was_filled: True
          spids: [541]
        )
      ]
    )
    (C {(test_expect_success)} {(SQ <"add concatentation notes with M command">)} 
      {
        (SQ <"\n"> <"\n"> <"\tgit fast-import <input &&\n"> 
          <"\tGIT_NOTES_REF=refs/notes/test git log | grep \"^    \" > actual &&\n"> <"\ttest_cmp expect actual\n"> <"\n">
        )
      }
    )
    (C {(test_tick)})
    (SimpleCommand
      words: [{(cat)}]
      redirects: [
        (Redir op_id:Redir_Great fd:-1 arg_word:{(input)} spids:[582])
        (HereDoc
          op_id: Redir_DLess
          fd: -1
          body: 
            {
              (DQ ("commit refs/notes/test\n") ("committer ") ($ VSub_Name "$GIT_COMMITTER_NAME") (" <") 
                ($ VSub_Name "$GIT_COMMITTER_EMAIL") ("> ") ($ VSub_Name "$GIT_COMMITTER_DATE") ("\n") ("data <<COMMIT\n") ("fifth notes commit\n") 
                ("COMMIT\n") ("\n") ("from refs/notes/test^0\n") ("deleteall\n") ("\n")
              )
            }
          do_expansion: True
          here_end: INPUT_END
          was_filled: True
          spids: [585]
        )
      ]
    )
    (SimpleCommand
      words: [{(cat)}]
      redirects: [
        (Redir op_id:Redir_Great fd:-1 arg_word:{(expect)} spids:[606])
        (HereDoc
          op_id: Redir_DLess
          fd: -1
          body: 
            {
              (DQ ("    fourth commit\n") ("    third commit\n") ("    second commit\n") 
                ("    first commit\n")
              )
            }
          do_expansion: True
          here_end: EXPECT_END
          was_filled: True
          spids: [609]
        )
      ]
    )
    (C {(test_expect_success)} {(SQ <"verify that deleteall also removes notes">)} 
      {
        (SQ <"\n"> <"\n"> <"\tgit fast-import <input &&\n"> 
          <"\tGIT_NOTES_REF=refs/notes/test git log | grep \"^    \" > actual &&\n"> <"\ttest_cmp expect actual\n"> <"\n">
        )
      }
    )
    (C {(test_tick)})
    (SimpleCommand
      words: [{(cat)}]
      redirects: [
        (Redir op_id:Redir_Great fd:-1 arg_word:{(input)} spids:[637])
        (HereDoc
          op_id: Redir_DLess
          fd: -1
          body: 
            {
              (DQ ("commit refs/notes/test\n") ("committer ") ($ VSub_Name "$GIT_COMMITTER_NAME") (" <") 
                ($ VSub_Name "$GIT_COMMITTER_EMAIL") ("> ") ($ VSub_Name "$GIT_COMMITTER_DATE") ("\n") ("data <<COMMIT\n") ("sixth notes commit\n") 
                ("COMMIT\n") ("\n") ("from refs/notes/test^0\n") ("M 644 inline ") ($ VSub_Name "$commit1") ("\n") ("data <<EOF\n") 
                ("third note for first commit\n") ("EOF\n") ("\n") ("M 644 inline ") ($ VSub_Name "$commit3") ("\n") ("data <<EOF\n") 
                ("third note for third commit\n") ("EOF\n") ("\n") ("N inline ") ($ VSub_Name "$commit1") ("\n") ("data <<EOF\n") 
                ("fourth note for first commit\n") ("EOF\n") ("\n") ("N inline ") ($ VSub_Name "$commit3") ("\n") ("data <<EOF\n") 
                ("fourth note for third commit\n") ("EOF\n") ("\n")
              )
            }
          do_expansion: True
          here_end: INPUT_END
          was_filled: True
          spids: [640]
        )
      ]
    )
    (SimpleCommand
      words: [{(cat)}]
      redirects: [
        (Redir op_id:Redir_Great fd:-1 arg_word:{(expect)} spids:[687])
        (HereDoc
          op_id: Redir_DLess
          fd: -1
          body: 
            {
              (DQ ("    fourth commit\n") ("    third commit\n") ("    fourth note for third commit\n") 
                ("    second commit\n") ("    first commit\n") ("    fourth note for first commit\n")
              )
            }
          do_expansion: True
          here_end: EXPECT_END
          was_filled: True
          spids: [690]
        )
      ]
    )
    (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: [727]
                )
              ]
              spids: [727]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:my_num_commits)
                  op: Equal
                  rhs: {($ VSub_Number "$2")}
                  spids: [731]
                )
              ]
              spids: [731]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:my_append_to_file)
                  op: Equal
                  rhs: {($ VSub_Number "$3")}
                  spids: [735]
                )
              ]
              spids: [735]
            )
            (Assignment
              keyword: Assign_None
              pairs: [(assign_pair lhs:(LhsName name:my_i) op:Equal rhs:{(0)} spids:[739])]
              spids: [739]
            )
            (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: [758 765]
                              )
                            }
                          spids: [757]
                        )
                      ]
                      spids: [757]
                    )
                    (C {(test_tick)})
                    (SimpleCommand
                      words: [{(cat)}]
                      redirects: [
                        (Redir
                          op_id: Redir_DGreat
                          fd: -1
                          arg_word: {(DQ ($ VSub_Name "$my_append_to_file"))}
                          spids: [773]
                        )
                        (HereDoc
                          op_id: Redir_DLess
                          fd: -1
                          body: 
                            {
                              (DQ ("commit ") ($ VSub_Name "$my_ref") ("\n") ("mark :") 
                                ($ VSub_Name "$my_i") ("\n") ("committer ") ($ VSub_Name "$GIT_COMMITTER_NAME") (" <") ($ VSub_Name "$GIT_COMMITTER_EMAIL") 
                                ("> ") ($ VSub_Name "$GIT_COMMITTER_DATE") ("\n") ("data <<COMMIT\n") ("commit #") ($ VSub_Name "$my_i") ("\n") 
                                ("COMMIT\n") ("\n") ("M 644 inline file\n") ("data <<EOF\n") ("file contents in commit #") ($ VSub_Name "$my_i") ("\n") 
                                ("EOF\n") ("\n")
                              )
                            }
                          do_expansion: True
                          here_end: INPUT_END
                          was_filled: True
                          spids: [778]
                        )
                      ]
                    )
                  ]
                  spids: [754 808]
                )
            )
          ]
          spids: [724]
        )
      spids: [719 723]
    )
    (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: [827]
                )
              ]
              spids: [827]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:my_num_commits)
                  op: Equal
                  rhs: {($ VSub_Number "$2")}
                  spids: [831]
                )
              ]
              spids: [831]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:my_append_to_file)
                  op: Equal
                  rhs: {($ VSub_Number "$3")}
                  spids: [835]
                )
              ]
              spids: [835]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:my_note_append)
                  op: Equal
                  rhs: {($ VSub_Number "$4")}
                  spids: [839]
                )
              ]
              spids: [839]
            )
            (C {(test_tick)})
            (SimpleCommand
              words: [{(cat)}]
              redirects: [
                (Redir
                  op_id: Redir_DGreat
                  fd: -1
                  arg_word: {(DQ ($ VSub_Name "$my_append_to_file"))}
                  spids: [848]
                )
                (HereDoc
                  op_id: Redir_DLess
                  fd: -1
                  body: 
                    {
                      (DQ ("commit ") ($ VSub_Name "$my_notes_ref") ("\n") ("committer ") 
                        ($ VSub_Name "$GIT_COMMITTER_NAME") (" <") ($ VSub_Name "$GIT_COMMITTER_EMAIL") ("> ") ($ VSub_Name "$GIT_COMMITTER_DATE") ("\n") 
                        ("data <<COMMIT\n") ("committing ") ($ VSub_Name "$my_num_commits") (" notes\n") ("COMMIT\n") ("\n")
                      )
                    }
                  do_expansion: True
                  here_end: INPUT_END
                  was_filled: True
                  spids: [853]
                )
              ]
            )
            (Assignment
              keyword: Assign_None
              pairs: [(assign_pair lhs:(LhsName name:my_i) op:Equal rhs:{(0)} spids:[874])]
              spids: [874]
            )
            (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: [893 900]
                              )
                            }
                          spids: [892]
                        )
                      ]
                      spids: [892]
                    )
                    (SimpleCommand
                      words: [{(cat)}]
                      redirects: [
                        (Redir
                          op_id: Redir_DGreat
                          fd: -1
                          arg_word: {(DQ ($ VSub_Name "$my_append_to_file"))}
                          spids: [905]
                        )
                        (HereDoc
                          op_id: Redir_DLess
                          fd: -1
                          body: 
                            {
                              (DQ ("N inline :") ($ VSub_Name "$my_i") ("\n") ("data <<EOF\n") 
                                ("note for commit #") ($ VSub_Name "$my_i") ($ VSub_Name "$my_note_append") ("\n") ("EOF\n") ("\n")
                              )
                            }
                          do_expansion: True
                          here_end: INPUT_END
                          was_filled: True
                          spids: [910]
                        )
                      ]
                    )
                  ]
                  spids: [889 924]
                )
            )
          ]
          spids: [824]
        )
      spids: [819 823]
    )
    (C {(rm)} {(input)} {(expect)})
    (Assignment
      keyword: Assign_None
      pairs: [(assign_pair lhs:(LhsName name:num_commits) op:Equal rhs:{(400)} spids:[936])]
      spids: [936]
    )
    (C {(fast_import_commits)} {(DQ (refs/heads/many_commits))} {($ VSub_Name "$num_commits")} {(input)})
    (C {(fast_import_notes)} {(DQ (refs/notes/many_notes))} {($ VSub_Name "$num_commits")} {(input)})
    (C {(test_tick)})
    (SimpleCommand
      words: [{(cat)}]
      redirects: [
        (Redir op_id:Redir_DGreat fd:-1 arg_word:{(input)} spids:[972])
        (HereDoc
          op_id: Redir_DLess
          fd: -1
          body: 
            {
              (DQ ("commit refs/notes/many_notes\n") ("committer ") ($ VSub_Name "$GIT_COMMITTER_NAME") 
                (" <") ($ VSub_Name "$GIT_COMMITTER_EMAIL") ("> ") ($ VSub_Name "$GIT_COMMITTER_DATE") ("\n") 
                ("data <<COMMIT\n") ("committing some non-notes to the notes tree\n") ("COMMIT\n") ("\n") 
                ("M 755 inline foobar/non-note.txt\n") ("data <<EOF\n") ("This is not a note, but rather a regular file residing in a notes tree\n") ("EOF\n") 
                ("\n") ("M 644 inline deadbeef\n") ("data <<EOF\n") ("Non-note file\n") ("EOF\n") ("\n") 
                ("M 644 inline de/adbeef\n") ("data <<EOF\n") ("Another non-note file\n") ("EOF\n") ("\n")
              )
            }
          do_expansion: True
          here_end: INPUT_END
          was_filled: True
          spids: [975]
        )
      ]
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:i)
          op: Equal
          rhs: {($ VSub_Name "$num_commits")}
          spids: [1008]
        )
      ]
      spids: [1008]
    )
    (While
      cond: [(C {(test)} {($ VSub_Name "$i")} {(-gt)} {(0)})]
      body: 
        (DoGroup
          children: [
            (SimpleCommand
              words: [{(cat)}]
              redirects: [
                (Redir op_id:Redir_DGreat fd:-1 arg_word:{(expect)} spids:[1026])
                (HereDoc
                  op_id: Redir_DLess
                  fd: -1
                  body: 
                    {
                      (DQ ("    commit #") ($ VSub_Name "$i") ("\n") ("    note for commit #") 
                        ($ VSub_Name "$i") ("\n")
                      )
                    }
                  do_expansion: True
                  here_end: EXPECT_END
                  was_filled: True
                  spids: [1029]
                )
              ]
            )
            (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: [1040 1047]
                      )
                    }
                  spids: [1039]
                )
              ]
              spids: [1039]
            )
          ]
          spids: [1021 1049]
        )
    )
    (C {(test_expect_success)} {(SQ <"add lots of commits and notes">)} 
      {
        (SQ <"\n"> <"\n"> <"\tgit fast-import <input &&\n"> 
          <"\tGIT_NOTES_REF=refs/notes/many_notes git log refs/heads/many_commits |\n"> <"\t    grep \"^    \" > actual &&\n"> <"\ttest_cmp expect actual\n"> <"\n">
        )
      }
    )
    (C {(test_expect_success)} {(SQ <"verify that lots of notes trigger a fanout scheme">)} 
      {
        (SQ <"\n"> <"\n"> 
          <"\t# None of the entries in the top-level notes tree should be a full SHA1\n"> <"\tgit ls-tree --name-only refs/notes/many_notes |\n"> <"\twhile read path\n"> <"\tdo\n"> 
          <"\t\tif test $(expr length \"$path\") -ge 40\n"> <"\t\tthen\n"> <"\t\t\treturn 1\n"> <"\t\tfi\n"> <"\tdone\n"> <"\n">
        )
      }
    )
    (SimpleCommand
      words: [{(cat)}]
      redirects: [
        (Redir op_id:Redir_DGreat fd:-1 arg_word:{(expect_non-note1)} spids:[1093])
        (HereDoc
          op_id: Redir_DLess
          fd: -1
          body: {(DQ ("This is not a note, but rather a regular file residing in a notes tree\n"))}
          do_expansion: True
          here_end: EOF
          was_filled: True
          spids: [1096]
        )
      ]
    )
    (SimpleCommand
      words: [{(cat)}]
      redirects: [
        (Redir op_id:Redir_DGreat fd:-1 arg_word:{(expect_non-note2)} spids:[1104])
        (HereDoc
          op_id: Redir_DLess
          fd: -1
          body: {(DQ ("Non-note file\n"))}
          do_expansion: True
          here_end: EOF
          was_filled: True
          spids: [1107]
        )
      ]
    )
    (SimpleCommand
      words: [{(cat)}]
      redirects: [
        (Redir op_id:Redir_DGreat fd:-1 arg_word:{(expect_non-note3)} spids:[1115])
        (HereDoc
          op_id: Redir_DLess
          fd: -1
          body: {(DQ ("Another non-note file\n"))}
          do_expansion: True
          here_end: EOF
          was_filled: True
          spids: [1118]
        )
      ]
    )
    (C {(test_expect_success)} {(SQ <"verify that non-notes are untouched by a fanout change">)} 
      {
        (SQ <"\n"> <"\n"> <"\tgit cat-file -p refs/notes/many_notes:foobar/non-note.txt > actual &&\n"> 
          <"\ttest_cmp expect_non-note1 actual &&\n"> <"\tgit cat-file -p refs/notes/many_notes:deadbeef > actual &&\n"> 
          <"\ttest_cmp expect_non-note2 actual &&\n"> <"\tgit cat-file -p refs/notes/many_notes:de/adbeef > actual &&\n"> 
          <"\ttest_cmp expect_non-note3 actual\n"> <"\n">
        )
      }
    )
    (C {(test_tick)})
    (SimpleCommand
      words: [{(cat)}]
      redirects: [
        (Redir op_id:Redir_Great fd:-1 arg_word:{(input)} spids:[1150])
        (HereDoc
          op_id: Redir_DLess
          fd: -1
          body: 
            {
              (DQ ("commit refs/notes/many_notes\n") ("committer ") ($ VSub_Name "$GIT_COMMITTER_NAME") 
                (" <") ($ VSub_Name "$GIT_COMMITTER_EMAIL") ("> ") ($ VSub_Name "$GIT_COMMITTER_DATE") ("\n") 
                ("data <<COMMIT\n") ("changing notes for the top three commits\n") ("COMMIT\n") ("from refs/notes/many_notes^0\n")
              )
            }
          do_expansion: True
          here_end: INPUT_END
          was_filled: True
          spids: [1153]
        )
      ]
    )
    (C {(rm)} {(expect)})
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:i)
          op: Equal
          rhs: {($ VSub_Name "$num_commits")}
          spids: [1173]
        )
      ]
      spids: [1173]
    )
    (Assignment
      keyword: Assign_None
      pairs: [(assign_pair lhs:(LhsName name:j) op:Equal rhs:{(0)} spids:[1176])]
      spids: [1176]
    )
    (While
      cond: [(C {(test)} {($ VSub_Name "$j")} {(-lt)} {(3)})]
      body: 
        (DoGroup
          children: [
            (SimpleCommand
              words: [{(cat)}]
              redirects: [
                (Redir op_id:Redir_DGreat fd:-1 arg_word:{(input)} spids:[1194])
                (HereDoc
                  op_id: Redir_DLess
                  fd: -1
                  body: 
                    {
                      (DQ ("N inline refs/heads/many_commits~") ($ VSub_Name "$j") ("\n") 
                        ("data <<EOF\n") ("changed note for commit #") ($ VSub_Name "$i") ("\n") ("EOF\n")
                      )
                    }
                  do_expansion: True
                  here_end: INPUT_END
                  was_filled: True
                  spids: [1197]
                )
              ]
            )
            (SimpleCommand
              words: [{(cat)}]
              redirects: [
                (Redir op_id:Redir_DGreat fd:-1 arg_word:{(expect)} spids:[1211])
                (HereDoc
                  op_id: Redir_DLess
                  fd: -1
                  body: 
                    {
                      (DQ ("    commit #") ($ VSub_Name "$i") ("\n") ("    changed note for commit #") 
                        ($ VSub_Name "$i") ("\n")
                      )
                    }
                  do_expansion: True
                  here_end: EXPECT_END
                  was_filled: True
                  spids: [1214]
                )
              ]
            )
            (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: [1225 1232]
                      )
                    }
                  spids: [1224]
                )
              ]
              spids: [1224]
            )
            (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: [1236 1243]
                      )
                    }
                  spids: [1235]
                )
              ]
              spids: [1235]
            )
          ]
          spids: [1189 1245]
        )
    )
    (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:[1287])]
      spids: [1287]
    )
    (C {(test_tick)})
    (SimpleCommand
      words: [{(cat)}]
      redirects: [
        (Redir op_id:Redir_Great fd:-1 arg_word:{(input)} spids:[1294])
        (HereDoc
          op_id: Redir_DLess
          fd: -1
          body: 
            {
              (DQ ("commit refs/notes/many_notes\n") ("committer ") ($ VSub_Name "$GIT_COMMITTER_NAME") 
                (" <") ($ VSub_Name "$GIT_COMMITTER_EMAIL") ("> ") ($ VSub_Name "$GIT_COMMITTER_DATE") ("\n") 
                ("data <<COMMIT\n") ("removing all notes but ") ($ VSub_Name "$remaining_notes") ("\n") ("COMMIT\n") 
                ("from refs/notes/many_notes^0\n")
              )
            }
          do_expansion: True
          here_end: INPUT_END
          was_filled: True
          spids: [1297]
        )
      ]
    )
    (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: [1316 1323]
              )
            }
          spids: [1315]
        )
      ]
      spids: [1315]
    )
    (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: [1331 1341]
          )
        }
      ]
      do_arg_iter: False
      body: 
        (DoGroup
          children: [
            (SimpleCommand
              words: [{(cat)}]
              redirects: [
                (Redir op_id:Redir_DGreat fd:-1 arg_word:{(input)} spids:[1348])
                (HereDoc
                  op_id: Redir_DLess
                  fd: -1
                  body: 
                    {
                      (DQ ("N 0000000000000000000000000000000000000000 ") ($ VSub_Name "$sha1") ("\n"))
                    }
                  do_expansion: True
                  here_end: INPUT_END
                  was_filled: True
                  spids: [1351]
                )
              ]
            )
          ]
          spids: [1343 1357]
        )
      spids: [1330 -1]
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:i)
          op: Equal
          rhs: {($ VSub_Name "$num_commits")}
          spids: [1360]
        )
      ]
      spids: [1360]
    )
    (C {(rm)} {(expect)})
    (While
      cond: [(C {(test)} {($ VSub_Name "$i")} {(-gt)} {(0)})]
      body: 
        (DoGroup
          children: [
            (SimpleCommand
              words: [{(cat)}]
              redirects: [
                (Redir op_id:Redir_DGreat fd:-1 arg_word:{(expect)} spids:[1382])
                (HereDoc
                  op_id: Redir_DLess
                  fd: -1
                  body: {(DQ ("    commit #") ($ VSub_Name "$i") ("\n"))}
                  do_expansion: True
                  here_end: EXPECT_END
                  was_filled: True
                  spids: [1385]
                )
              ]
            )
            (If
              arms: [
                (if_arm
                  cond: [(C {(test)} {($ VSub_Name "$i")} {(-le)} {($ VSub_Name "$remaining_notes")})]
                  action: [
                    (SimpleCommand
                      words: [{(cat)}]
                      redirects: [
                        (Redir
                          op_id: Redir_DGreat
                          fd: -1
                          arg_word: {(expect)}
                          spids: [1408]
                        )
                        (HereDoc
                          op_id: Redir_DLess
                          fd: -1
                          body: {(DQ ("    note for commit #") ($ VSub_Name "$i") ("\n"))}
                          do_expansion: True
                          here_end: EXPECT_END
                          was_filled: True
                          spids: [1411]
                        )
                      ]
                    )
                  ]
                  spids: [-1 1403]
                )
              ]
              spids: [-1 1418]
            )
            (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: [1422 1429]
                      )
                    }
                  spids: [1421]
                )
              ]
              spids: [1421]
            )
          ]
          spids: [1377 1431]
        )
    )
    (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:[1504])]
      spids: [1504]
    )
    (Assignment
      keyword: Assign_None
      pairs: [(assign_pair lhs:(LhsName name:num_commits) op:Equal rhs:{(16)} spids:[1507])]
      spids: [1507]
    )
    (Assignment
      keyword: Assign_None
      pairs: [(assign_pair lhs:(LhsName name:some_commits) op:Equal rhs:{(8)} spids:[1510])]
      spids: [1510]
    )
    (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:[1529])]
      spids: [1529]
    )
    (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: [1546 1553]
                      )
                    }
                  spids: [1545]
                )
              ]
              spids: [1545]
            )
            (C {(fast_import_notes)} {(DQ (refs/notes/more_notes_) ($ VSub_Name "$i"))} 
              {($ VSub_Name "$num_commits")} {(input)}
            )
          ]
          spids: [1542 1567]
        )
    )
    (Assignment
      keyword: Assign_None
      pairs: [(assign_pair lhs:(LhsName name:i) op:Equal rhs:{(0)} spids:[1572])]
      spids: [1572]
    )
    (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: [1589 1596]
                      )
                    }
                  spids: [1588]
                )
              ]
              spids: [1588]
            )
            (C {(fast_import_notes)} {(DQ (refs/notes/more_notes_) ($ VSub_Name "$i"))} 
              {($ VSub_Name "$some_commits")} {(input)} {(DQ (" (2)"))}
            )
          ]
          spids: [1585 1614]
        )
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:i)
          op: Equal
          rhs: {($ VSub_Name "$num_commits")}
          spids: [1619]
        )
      ]
      spids: [1619]
    )
    (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: [1635]
                )
              ]
              spids: [1635]
            )
            (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: [1656]
                        )
                      ]
                      spids: [1656]
                    )
                  ]
                  spids: [-1 1653]
                )
              ]
              spids: [-1 1663]
            )
            (SimpleCommand
              words: [{(cat)}]
              redirects: [
                (Redir op_id:Redir_DGreat fd:-1 arg_word:{(expect)} spids:[1668])
                (HereDoc
                  op_id: Redir_DLess
                  fd: -1
                  body: 
                    {
                      (DQ ("    commit #") ($ VSub_Name "$i") ("\n") ("    ") ($ VSub_Name "$note_data") 
                        ("\n")
                      )
                    }
                  do_expansion: True
                  here_end: EXPECT_END
                  was_filled: True
                  spids: [1671]
                )
              ]
            )
            (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: [1682 1689]
                      )
                    }
                  spids: [1681]
                )
              ]
              spids: [1681]
            )
          ]
          spids: [1632 1691]
        )
    )
    (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)})
  ]
)