(command.CommandList
  children: [
    (command.ShAssignment
      left: <Id.Lit_VarLike 'test_description='>
      pairs: [
        (AssignPair
          left: <Id.Lit_VarLike 'test_description='>
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'test_description='> name:test_description)
          op: assign_op.Equal
          rhs: {(SQ <'test git fast-import of notes objects'>)}
        )
      ]
      redirects: []
    )
    (command.Simple
      blame_tok: <.>
      more_env: []
      words: [{<.>} {<'./test-lib.sh'>}]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_tick>
      more_env: []
      words: [{<test_tick>}]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <cat>
      more_env: []
      words: [{<cat>}]
      redirects: [
        (Redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<input>})
        (Redir
          op: <Id.Redir_DLess '<<'>
          loc: (redir_loc.Fd fd:0)
          arg: 
            (redir_param.HereDoc
              here_begin: {<INPUT_END>}
              here_end_tok: <Id.Undefined_Tok ''>
              stdin_parts: [
                <'commit refs/heads/master\n'>
                <'committer '>
                ($ Id.VSub_DollarName GIT_COMMITTER_NAME)
                <' <'>
                ($ Id.VSub_DollarName GIT_COMMITTER_EMAIL)
                <'> '>
                ($ Id.VSub_DollarName 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 '>
                ($ Id.VSub_DollarName GIT_COMMITTER_NAME)
                <' <'>
                ($ Id.VSub_DollarName GIT_COMMITTER_EMAIL)
                <'> '>
                ($ Id.VSub_DollarName 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 '>
                ($ Id.VSub_DollarName GIT_COMMITTER_NAME)
                <' <'>
                ($ Id.VSub_DollarName GIT_COMMITTER_EMAIL)
                <'> '>
                ($ Id.VSub_DollarName 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 '>
                ($ Id.VSub_DollarName GIT_COMMITTER_NAME)
                <' <'>
                ($ Id.VSub_DollarName GIT_COMMITTER_EMAIL)
                <'> '>
                ($ Id.VSub_DollarName 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_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'set up master branch'>)}
        {(SQ <'\n'> <'\n'> <'\tgit fast-import <input &&\n'> <'\tgit whatchanged master\n'>)}
      ]
      redirects: []
      do_fork: T
    )
    (command.ShAssignment
      left: <Id.Lit_VarLike 'commit4='>
      pairs: [
        (AssignPair
          left: <Id.Lit_VarLike 'commit4='>
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'commit4='> name:commit4)
          op: assign_op.Equal
          rhs: 
            {
              (CommandSub
                left_token: <Id.Left_DollarParen '$('>
                child: 
                  (command.Simple
                    blame_tok: <git>
                    more_env: []
                    words: [{<git>} {<rev-parse>} {<'refs/heads/master'>}]
                    redirects: []
                    do_fork: T
                  )
                right: <Id.Eof_RParen _>
              )
            }
        )
      ]
      redirects: []
    )
    (command.ShAssignment
      left: <Id.Lit_VarLike 'commit3='>
      pairs: [
        (AssignPair
          left: <Id.Lit_VarLike 'commit3='>
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'commit3='> name:commit3)
          op: assign_op.Equal
          rhs: 
            {
              (CommandSub
                left_token: <Id.Left_DollarParen '$('>
                child: 
                  (command.Simple
                    blame_tok: <git>
                    more_env: []
                    words: [{<git>} {<rev-parse>} {(DQ ($ Id.VSub_DollarName commit4) <'^'>)}]
                    redirects: []
                    do_fork: T
                  )
                right: <Id.Eof_RParen _>
              )
            }
        )
      ]
      redirects: []
    )
    (command.ShAssignment
      left: <Id.Lit_VarLike 'commit2='>
      pairs: [
        (AssignPair
          left: <Id.Lit_VarLike 'commit2='>
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'commit2='> name:commit2)
          op: assign_op.Equal
          rhs: 
            {
              (CommandSub
                left_token: <Id.Left_DollarParen '$('>
                child: 
                  (command.Simple
                    blame_tok: <git>
                    more_env: []
                    words: [{<git>} {<rev-parse>} {(DQ ($ Id.VSub_DollarName commit4) <'~2'>)}]
                    redirects: []
                    do_fork: T
                  )
                right: <Id.Eof_RParen _>
              )
            }
        )
      ]
      redirects: []
    )
    (command.ShAssignment
      left: <Id.Lit_VarLike 'commit1='>
      pairs: [
        (AssignPair
          left: <Id.Lit_VarLike 'commit1='>
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'commit1='> name:commit1)
          op: assign_op.Equal
          rhs: 
            {
              (CommandSub
                left_token: <Id.Left_DollarParen '$('>
                child: 
                  (command.Simple
                    blame_tok: <git>
                    more_env: []
                    words: [{<git>} {<rev-parse>} {(DQ ($ Id.VSub_DollarName commit4) <'~3'>)}]
                    redirects: []
                    do_fork: T
                  )
                right: <Id.Eof_RParen _>
              )
            }
        )
      ]
      redirects: []
    )
    (command.Simple
      blame_tok: <test_tick>
      more_env: []
      words: [{<test_tick>}]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <cat>
      more_env: []
      words: [{<cat>}]
      redirects: [
        (Redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<input>})
        (Redir
          op: <Id.Redir_DLess '<<'>
          loc: (redir_loc.Fd fd:0)
          arg: 
            (redir_param.HereDoc
              here_begin: {<INPUT_END>}
              here_end_tok: <Id.Undefined_Tok ''>
              stdin_parts: [
                <'commit refs/notes/test\n'>
                <'committer '>
                ($ Id.VSub_DollarName GIT_COMMITTER_NAME)
                <' <'>
                ($ Id.VSub_DollarName GIT_COMMITTER_EMAIL)
                <'> '>
                ($ Id.VSub_DollarName GIT_COMMITTER_DATE)
                <'\n'>
                <'data <<COMMIT\n'>
                <'first notes commit\n'>
                <'COMMIT\n'>
                <'\n'>
                <'M 644 inline '>
                ($ Id.VSub_DollarName commit1)
                <'\n'>
                <'data <<EOF\n'>
                <'first note for first commit\n'>
                <'EOF\n'>
                <'\n'>
                <'M 755 inline '>
                ($ Id.VSub_DollarName commit2)
                <'\n'>
                <'data <<EOF\n'>
                <'first note for second commit\n'>
                <'EOF\n'>
                <'\n'>
              ]
            )
        )
      ]
      do_fork: T
    )
    (command.Simple
      blame_tok: <cat>
      more_env: []
      words: [{<cat>}]
      redirects: [
        (Redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expect>})
        (Redir
          op: <Id.Redir_DLess '<<'>
          loc: (redir_loc.Fd fd:0)
          arg: 
            (redir_param.HereDoc
              here_begin: {<EXPECT_END>}
              here_end_tok: <Id.Undefined_Tok ''>
              stdin_parts: [
                <'    fourth commit\n'>
                <'    third commit\n'>
                <'    second commit\n'>
                <'    first note for second commit\n'>
                <'    first commit\n'>
                <'    first note for first commit\n'>
              ]
            )
        )
      ]
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<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'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_tick>
      more_env: []
      words: [{<test_tick>}]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <cat>
      more_env: []
      words: [{<cat>}]
      redirects: [
        (Redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<input>})
        (Redir
          op: <Id.Redir_DLess '<<'>
          loc: (redir_loc.Fd fd:0)
          arg: 
            (redir_param.HereDoc
              here_begin: {<INPUT_END>}
              here_end_tok: <Id.Undefined_Tok ''>
              stdin_parts: [
                <'feature notes\n'>
                <'commit refs/notes/test\n'>
                <'committer '>
                ($ Id.VSub_DollarName GIT_COMMITTER_NAME)
                <' <'>
                ($ Id.VSub_DollarName GIT_COMMITTER_EMAIL)
                <'> '>
                ($ Id.VSub_DollarName GIT_COMMITTER_DATE)
                <'\n'>
                <'data <<COMMIT\n'>
                <'second notes commit\n'>
                <'COMMIT\n'>
                <'\n'>
                <'from refs/notes/test^0\n'>
                <'N inline '>
                ($ Id.VSub_DollarName commit3)
                <'\n'>
                <'data <<EOF\n'>
                <'first note for third commit\n'>
                <'EOF\n'>
                <'\n'>
                <'N inline '>
                ($ Id.VSub_DollarName commit4)
                <'\n'>
                <'data <<EOF\n'>
                <'first note for fourth commit\n'>
                <'EOF\n'>
                <'\n'>
              ]
            )
        )
      ]
      do_fork: T
    )
    (command.Simple
      blame_tok: <cat>
      more_env: []
      words: [{<cat>}]
      redirects: [
        (Redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expect>})
        (Redir
          op: <Id.Redir_DLess '<<'>
          loc: (redir_loc.Fd fd:0)
          arg: 
            (redir_param.HereDoc
              here_begin: {<EXPECT_END>}
              here_end_tok: <Id.Undefined_Tok ''>
              stdin_parts: [
                <'    fourth commit\n'>
                <'    first note for fourth commit\n'>
                <'    third commit\n'>
                <'    first note for third commit\n'>
                <'    second commit\n'>
                <'    first note for second commit\n'>
                <'    first commit\n'>
                <'    first note for first commit\n'>
              ]
            )
        )
      ]
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<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'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_tick>
      more_env: []
      words: [{<test_tick>}]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <cat>
      more_env: []
      words: [{<cat>}]
      redirects: [
        (Redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<input>})
        (Redir
          op: <Id.Redir_DLess '<<'>
          loc: (redir_loc.Fd fd:0)
          arg: 
            (redir_param.HereDoc
              here_begin: {<INPUT_END>}
              here_end_tok: <Id.Undefined_Tok ''>
              stdin_parts: [
                <'commit refs/notes/test\n'>
                <'committer '>
                ($ Id.VSub_DollarName GIT_COMMITTER_NAME)
                <' <'>
                ($ Id.VSub_DollarName GIT_COMMITTER_EMAIL)
                <'> '>
                ($ Id.VSub_DollarName GIT_COMMITTER_DATE)
                <'\n'>
                <'data <<COMMIT\n'>
                <'third notes commit\n'>
                <'COMMIT\n'>
                <'\n'>
                <'from refs/notes/test^0\n'>
                <'N inline '>
                ($ Id.VSub_DollarName commit1)
                <'\n'>
                <'data <<EOF\n'>
                <'second note for first commit\n'>
                <'EOF\n'>
                <'\n'>
                <'N inline '>
                ($ Id.VSub_DollarName commit2)
                <'\n'>
                <'data <<EOF\n'>
                <'second note for second commit\n'>
                <'EOF\n'>
                <'\n'>
                <'N inline '>
                ($ Id.VSub_DollarName commit3)
                <'\n'>
                <'data <<EOF\n'>
                <'second note for third commit\n'>
                <'EOF\n'>
                <'\n'>
                <'N inline '>
                ($ Id.VSub_DollarName commit4)
                <'\n'>
                <'data <<EOF\n'>
                <'second note for fourth commit\n'>
                <'EOF\n'>
                <'\n'>
              ]
            )
        )
      ]
      do_fork: T
    )
    (command.Simple
      blame_tok: <cat>
      more_env: []
      words: [{<cat>}]
      redirects: [
        (Redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expect>})
        (Redir
          op: <Id.Redir_DLess '<<'>
          loc: (redir_loc.Fd fd:0)
          arg: 
            (redir_param.HereDoc
              here_begin: {<EXPECT_END>}
              here_end_tok: <Id.Undefined_Tok ''>
              stdin_parts: [
                <'    fourth commit\n'>
                <'    second note for fourth commit\n'>
                <'    third commit\n'>
                <'    second note for third commit\n'>
                <'    second commit\n'>
                <'    second note for second commit\n'>
                <'    first commit\n'>
                <'    second note for first commit\n'>
              ]
            )
        )
      ]
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<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'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_tick>
      more_env: []
      words: [{<test_tick>}]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <cat>
      more_env: []
      words: [{<cat>}]
      redirects: [
        (Redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<input>})
        (Redir
          op: <Id.Redir_DLess '<<'>
          loc: (redir_loc.Fd fd:0)
          arg: 
            (redir_param.HereDoc
              here_begin: {<INPUT_END>}
              here_end_tok: <Id.Undefined_Tok ''>
              stdin_parts: [
                <'commit refs/notes/test\n'>
                <'committer '>
                ($ Id.VSub_DollarName GIT_COMMITTER_NAME)
                <' <'>
                ($ Id.VSub_DollarName GIT_COMMITTER_EMAIL)
                <'> '>
                ($ Id.VSub_DollarName GIT_COMMITTER_DATE)
                <'\n'>
                <'data <<COMMIT\n'>
                <'fourth notes commit\n'>
                <'COMMIT\n'>
                <'\n'>
                <'from refs/notes/test^0\n'>
                <'M 644 inline '>
                (CommandSub
                  left_token: <Id.Left_DollarParen '$('>
                  child: 
                    (command.Pipeline
                      children: [
                        (command.Simple
                          blame_tok: <echo>
                          more_env: []
                          words: [{<echo>} {(DQ ($ Id.VSub_DollarName commit3))}]
                          redirects: []
                          do_fork: T
                        )
                        (command.Simple
                          blame_tok: <sed>
                          more_env: []
                          words: [{<sed>} {(DQ <'s|^..|&/|'>)}]
                          redirects: []
                          do_fork: T
                        )
                      ]
                      ops: [<Id.Op_Pipe _>]
                    )
                  right: <Id.Eof_RParen _>
                )
                <'\n'>
                <'data <<EOF\n'>
                <'prefix of note for third commit\n'>
                <'EOF\n'>
                <'\n'>
                <'M 644 inline '>
                (CommandSub
                  left_token: <Id.Left_DollarParen '$('>
                  child: 
                    (command.Pipeline
                      children: [
                        (command.Simple
                          blame_tok: <echo>
                          more_env: []
                          words: [{<echo>} {(DQ ($ Id.VSub_DollarName commit4))}]
                          redirects: []
                          do_fork: T
                        )
                        (command.Simple
                          blame_tok: <sed>
                          more_env: []
                          words: [{<sed>} {(DQ <'s|^..|&/|'>)}]
                          redirects: []
                          do_fork: T
                        )
                      ]
                      ops: [<Id.Op_Pipe _>]
                    )
                  right: <Id.Eof_RParen _>
                )
                <'\n'>
                <'data <<EOF\n'>
                <'prefix of note for fourth commit\n'>
                <'EOF\n'>
                <'\n'>
                <'M 644 inline '>
                (CommandSub
                  left_token: <Id.Left_DollarParen '$('>
                  child: 
                    (command.Pipeline
                      children: [
                        (command.Simple
                          blame_tok: <echo>
                          more_env: []
                          words: [{<echo>} {(DQ ($ Id.VSub_DollarName commit4))}]
                          redirects: []
                          do_fork: T
                        )
                        (command.Simple
                          blame_tok: <sed>
                          more_env: []
                          words: [
                            {<sed>}
                            {
                              (DQ <'s|^'> <Id.Lit_BadBackslash '\\'> <'(..'> <Id.Lit_BadBackslash '\\'> 
                                <')'> <Id.Lit_BadBackslash '\\'> <'(..'> <Id.Lit_BadBackslash '\\'> <')|'> <Id.Lit_BadBackslash '\\'> <'1/'> 
                                <Id.Lit_BadBackslash '\\'> <'2/|'>
                              )
                            }
                          ]
                          redirects: []
                          do_fork: T
                        )
                      ]
                      ops: [<Id.Op_Pipe _>]
                    )
                  right: <Id.Eof_RParen _>
                )
                <'\n'>
                <'data <<EOF\n'>
                <'pre-prefix of note for fourth commit\n'>
                <'EOF\n'>
                <'\n'>
                <'N inline '>
                ($ Id.VSub_DollarName commit1)
                <'\n'>
                <'data <<EOF\n'>
                <'third note for first commit\n'>
                <'EOF\n'>
                <'\n'>
                <'N inline '>
                ($ Id.VSub_DollarName commit2)
                <'\n'>
                <'data <<EOF\n'>
                <'third note for second commit\n'>
                <'EOF\n'>
                <'\n'>
                <'N inline '>
                ($ Id.VSub_DollarName commit3)
                <'\n'>
                <'data <<EOF\n'>
                <'third note for third commit\n'>
                <'EOF\n'>
                <'\n'>
                <'N inline '>
                ($ Id.VSub_DollarName commit4)
                <'\n'>
                <'data <<EOF\n'>
                <'third note for fourth commit\n'>
                <'EOF\n'>
                <'\n'>
                <'\n'>
              ]
            )
        )
      ]
      do_fork: T
    )
    (command.ShAssignment
      left: <Id.Lit_VarLike 'whitespace='>
      pairs: [
        (AssignPair
          left: <Id.Lit_VarLike 'whitespace='>
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'whitespace='> name:whitespace)
          op: assign_op.Equal
          rhs: {(DQ <'    '>)}
        )
      ]
      redirects: []
    )
    (command.Simple
      blame_tok: <cat>
      more_env: []
      words: [{<cat>}]
      redirects: [
        (Redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expect>})
        (Redir
          op: <Id.Redir_DLess '<<'>
          loc: (redir_loc.Fd fd:0)
          arg: 
            (redir_param.HereDoc
              here_begin: {<EXPECT_END>}
              here_end_tok: <Id.Undefined_Tok ''>
              stdin_parts: [
                <'    fourth commit\n'>
                <'    pre-prefix of note for fourth commit\n'>
                ($ Id.VSub_DollarName whitespace)
                <'\n'>
                <'    prefix of note for fourth commit\n'>
                ($ Id.VSub_DollarName whitespace)
                <'\n'>
                <'    third note for fourth commit\n'>
                <'    third commit\n'>
                <'    prefix of note for third commit\n'>
                ($ Id.VSub_DollarName 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_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<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'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_tick>
      more_env: []
      words: [{<test_tick>}]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <cat>
      more_env: []
      words: [{<cat>}]
      redirects: [
        (Redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<input>})
        (Redir
          op: <Id.Redir_DLess '<<'>
          loc: (redir_loc.Fd fd:0)
          arg: 
            (redir_param.HereDoc
              here_begin: {<INPUT_END>}
              here_end_tok: <Id.Undefined_Tok ''>
              stdin_parts: [
                <'commit refs/notes/test\n'>
                <'committer '>
                ($ Id.VSub_DollarName GIT_COMMITTER_NAME)
                <' <'>
                ($ Id.VSub_DollarName GIT_COMMITTER_EMAIL)
                <'> '>
                ($ Id.VSub_DollarName GIT_COMMITTER_DATE)
                <'\n'>
                <'data <<COMMIT\n'>
                <'fifth notes commit\n'>
                <'COMMIT\n'>
                <'\n'>
                <'from refs/notes/test^0\n'>
                <'deleteall\n'>
                <'\n'>
              ]
            )
        )
      ]
      do_fork: T
    )
    (command.Simple
      blame_tok: <cat>
      more_env: []
      words: [{<cat>}]
      redirects: [
        (Redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expect>})
        (Redir
          op: <Id.Redir_DLess '<<'>
          loc: (redir_loc.Fd fd:0)
          arg: 
            (redir_param.HereDoc
              here_begin: {<EXPECT_END>}
              here_end_tok: <Id.Undefined_Tok ''>
              stdin_parts: [
                <'    fourth commit\n'>
                <'    third commit\n'>
                <'    second commit\n'>
                <'    first commit\n'>
              ]
            )
        )
      ]
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<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'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_tick>
      more_env: []
      words: [{<test_tick>}]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <cat>
      more_env: []
      words: [{<cat>}]
      redirects: [
        (Redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<input>})
        (Redir
          op: <Id.Redir_DLess '<<'>
          loc: (redir_loc.Fd fd:0)
          arg: 
            (redir_param.HereDoc
              here_begin: {<INPUT_END>}
              here_end_tok: <Id.Undefined_Tok ''>
              stdin_parts: [
                <'commit refs/notes/test\n'>
                <'committer '>
                ($ Id.VSub_DollarName GIT_COMMITTER_NAME)
                <' <'>
                ($ Id.VSub_DollarName GIT_COMMITTER_EMAIL)
                <'> '>
                ($ Id.VSub_DollarName GIT_COMMITTER_DATE)
                <'\n'>
                <'data <<COMMIT\n'>
                <'sixth notes commit\n'>
                <'COMMIT\n'>
                <'\n'>
                <'from refs/notes/test^0\n'>
                <'M 644 inline '>
                ($ Id.VSub_DollarName commit1)
                <'\n'>
                <'data <<EOF\n'>
                <'third note for first commit\n'>
                <'EOF\n'>
                <'\n'>
                <'M 644 inline '>
                ($ Id.VSub_DollarName commit3)
                <'\n'>
                <'data <<EOF\n'>
                <'third note for third commit\n'>
                <'EOF\n'>
                <'\n'>
                <'N inline '>
                ($ Id.VSub_DollarName commit1)
                <'\n'>
                <'data <<EOF\n'>
                <'fourth note for first commit\n'>
                <'EOF\n'>
                <'\n'>
                <'N inline '>
                ($ Id.VSub_DollarName commit3)
                <'\n'>
                <'data <<EOF\n'>
                <'fourth note for third commit\n'>
                <'EOF\n'>
                <'\n'>
              ]
            )
        )
      ]
      do_fork: T
    )
    (command.Simple
      blame_tok: <cat>
      more_env: []
      words: [{<cat>}]
      redirects: [
        (Redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expect>})
        (Redir
          op: <Id.Redir_DLess '<<'>
          loc: (redir_loc.Fd fd:0)
          arg: 
            (redir_param.HereDoc
              here_begin: {<EXPECT_END>}
              here_end_tok: <Id.Undefined_Tok ''>
              stdin_parts: [
                <'    fourth commit\n'>
                <'    third commit\n'>
                <'    fourth note for third commit\n'>
                <'    second commit\n'>
                <'    first commit\n'>
                <'    fourth note for first commit\n'>
              ]
            )
        )
      ]
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<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'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.ShFunction
      name_tok: <fast_import_commits>
      name: fast_import_commits
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (command.ShAssignment
              left: <Id.Lit_VarLike 'my_ref='>
              pairs: [
                (AssignPair
                  left: <Id.Lit_VarLike 'my_ref='>
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'my_ref='> name:my_ref)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_Number 1)}
                )
              ]
              redirects: []
            )
            (command.ShAssignment
              left: <Id.Lit_VarLike 'my_num_commits='>
              pairs: [
                (AssignPair
                  left: <Id.Lit_VarLike 'my_num_commits='>
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'my_num_commits='> name:my_num_commits)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_Number 2)}
                )
              ]
              redirects: []
            )
            (command.ShAssignment
              left: <Id.Lit_VarLike 'my_append_to_file='>
              pairs: [
                (AssignPair
                  left: <Id.Lit_VarLike 'my_append_to_file='>
                  lhs: 
                    (sh_lhs_expr.Name
                      left: <Id.Lit_VarLike 'my_append_to_file='>
                      name: my_append_to_file
                    )
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_Number 3)}
                )
              ]
              redirects: []
            )
            (command.ShAssignment
              left: <Id.Lit_VarLike 'my_i='>
              pairs: [
                (AssignPair
                  left: <Id.Lit_VarLike 'my_i='>
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'my_i='> name:my_i)
                  op: assign_op.Equal
                  rhs: {<0>}
                )
              ]
              redirects: []
            )
            (command.WhileUntil
              keyword: <Id.KW_While while>
              cond: 
                (condition.Shell
                  commands: [
                    (command.Simple
                      blame_tok: <test>
                      more_env: []
                      words: [
                        {<test>}
                        {($ Id.VSub_DollarName my_i)}
                        {<-lt>}
                        {($ Id.VSub_DollarName my_num_commits)}
                      ]
                      redirects: []
                      do_fork: T
                    )
                  ]
                )
              body: 
                (command.DoGroup
                  left: <Id.KW_Do do>
                  children: [
                    (command.ShAssignment
                      left: <Id.Lit_VarLike 'my_i='>
                      pairs: [
                        (AssignPair
                          left: <Id.Lit_VarLike 'my_i='>
                          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'my_i='> name:my_i)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (word_part.ArithSub
                                left: <Id.Left_DollarDParen '$(('>
                                anode: 
                                  (arith_expr.Binary
                                    op_id: Id.Arith_Plus
                                    left: {($ Id.VSub_DollarName my_i)}
                                    right: {<Id.Lit_Digits 1>}
                                  )
                                right: <Id.Right_DollarDParen _>
                              )
                            }
                        )
                      ]
                      redirects: []
                    )
                    (command.Simple
                      blame_tok: <test_tick>
                      more_env: []
                      words: [{<test_tick>}]
                      redirects: []
                      do_fork: T
                    )
                    (command.Simple
                      blame_tok: <cat>
                      more_env: []
                      words: [{<cat>}]
                      redirects: [
                        (Redir
                          op: <Id.Redir_DGreat '>>'>
                          loc: (redir_loc.Fd fd:1)
                          arg: {(DQ ($ Id.VSub_DollarName my_append_to_file))}
                        )
                        (Redir
                          op: <Id.Redir_DLess '<<'>
                          loc: (redir_loc.Fd fd:0)
                          arg: 
                            (redir_param.HereDoc
                              here_begin: {<INPUT_END>}
                              here_end_tok: <Id.Undefined_Tok ''>
                              stdin_parts: [
                                <'commit '>
                                ($ Id.VSub_DollarName my_ref)
                                <'\n'>
                                <'mark :'>
                                ($ Id.VSub_DollarName my_i)
                                <'\n'>
                                <'committer '>
                                ($ Id.VSub_DollarName GIT_COMMITTER_NAME)
                                <' <'>
                                ($ Id.VSub_DollarName GIT_COMMITTER_EMAIL)
                                <'> '>
                                ($ Id.VSub_DollarName GIT_COMMITTER_DATE)
                                <'\n'>
                                <'data <<COMMIT\n'>
                                <'commit #'>
                                ($ Id.VSub_DollarName my_i)
                                <'\n'>
                                <'COMMIT\n'>
                                <'\n'>
                                <'M 644 inline file\n'>
                                <'data <<EOF\n'>
                                <'file contents in commit #'>
                                ($ Id.VSub_DollarName my_i)
                                <'\n'>
                                <'EOF\n'>
                                <'\n'>
                              ]
                            )
                        )
                      ]
                      do_fork: T
                    )
                  ]
                  right: <Id.KW_Done done>
                )
              redirects: []
            )
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.ShFunction
      name_tok: <fast_import_notes>
      name: fast_import_notes
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (command.ShAssignment
              left: <Id.Lit_VarLike 'my_notes_ref='>
              pairs: [
                (AssignPair
                  left: <Id.Lit_VarLike 'my_notes_ref='>
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'my_notes_ref='> name:my_notes_ref)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_Number 1)}
                )
              ]
              redirects: []
            )
            (command.ShAssignment
              left: <Id.Lit_VarLike 'my_num_commits='>
              pairs: [
                (AssignPair
                  left: <Id.Lit_VarLike 'my_num_commits='>
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'my_num_commits='> name:my_num_commits)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_Number 2)}
                )
              ]
              redirects: []
            )
            (command.ShAssignment
              left: <Id.Lit_VarLike 'my_append_to_file='>
              pairs: [
                (AssignPair
                  left: <Id.Lit_VarLike 'my_append_to_file='>
                  lhs: 
                    (sh_lhs_expr.Name
                      left: <Id.Lit_VarLike 'my_append_to_file='>
                      name: my_append_to_file
                    )
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_Number 3)}
                )
              ]
              redirects: []
            )
            (command.ShAssignment
              left: <Id.Lit_VarLike 'my_note_append='>
              pairs: [
                (AssignPair
                  left: <Id.Lit_VarLike 'my_note_append='>
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'my_note_append='> name:my_note_append)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_Number 4)}
                )
              ]
              redirects: []
            )
            (command.Simple
              blame_tok: <test_tick>
              more_env: []
              words: [{<test_tick>}]
              redirects: []
              do_fork: T
            )
            (command.Simple
              blame_tok: <cat>
              more_env: []
              words: [{<cat>}]
              redirects: [
                (Redir
                  op: <Id.Redir_DGreat '>>'>
                  loc: (redir_loc.Fd fd:1)
                  arg: {(DQ ($ Id.VSub_DollarName my_append_to_file))}
                )
                (Redir
                  op: <Id.Redir_DLess '<<'>
                  loc: (redir_loc.Fd fd:0)
                  arg: 
                    (redir_param.HereDoc
                      here_begin: {<INPUT_END>}
                      here_end_tok: <Id.Undefined_Tok ''>
                      stdin_parts: [
                        <'commit '>
                        ($ Id.VSub_DollarName my_notes_ref)
                        <'\n'>
                        <'committer '>
                        ($ Id.VSub_DollarName GIT_COMMITTER_NAME)
                        <' <'>
                        ($ Id.VSub_DollarName GIT_COMMITTER_EMAIL)
                        <'> '>
                        ($ Id.VSub_DollarName GIT_COMMITTER_DATE)
                        <'\n'>
                        <'data <<COMMIT\n'>
                        <'committing '>
                        ($ Id.VSub_DollarName my_num_commits)
                        <' notes\n'>
                        <'COMMIT\n'>
                        <'\n'>
                      ]
                    )
                )
              ]
              do_fork: T
            )
            (command.ShAssignment
              left: <Id.Lit_VarLike 'my_i='>
              pairs: [
                (AssignPair
                  left: <Id.Lit_VarLike 'my_i='>
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'my_i='> name:my_i)
                  op: assign_op.Equal
                  rhs: {<0>}
                )
              ]
              redirects: []
            )
            (command.WhileUntil
              keyword: <Id.KW_While while>
              cond: 
                (condition.Shell
                  commands: [
                    (command.Simple
                      blame_tok: <test>
                      more_env: []
                      words: [
                        {<test>}
                        {($ Id.VSub_DollarName my_i)}
                        {<-lt>}
                        {($ Id.VSub_DollarName my_num_commits)}
                      ]
                      redirects: []
                      do_fork: T
                    )
                  ]
                )
              body: 
                (command.DoGroup
                  left: <Id.KW_Do do>
                  children: [
                    (command.ShAssignment
                      left: <Id.Lit_VarLike 'my_i='>
                      pairs: [
                        (AssignPair
                          left: <Id.Lit_VarLike 'my_i='>
                          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'my_i='> name:my_i)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (word_part.ArithSub
                                left: <Id.Left_DollarDParen '$(('>
                                anode: 
                                  (arith_expr.Binary
                                    op_id: Id.Arith_Plus
                                    left: {($ Id.VSub_DollarName my_i)}
                                    right: {<Id.Lit_Digits 1>}
                                  )
                                right: <Id.Right_DollarDParen _>
                              )
                            }
                        )
                      ]
                      redirects: []
                    )
                    (command.Simple
                      blame_tok: <cat>
                      more_env: []
                      words: [{<cat>}]
                      redirects: [
                        (Redir
                          op: <Id.Redir_DGreat '>>'>
                          loc: (redir_loc.Fd fd:1)
                          arg: {(DQ ($ Id.VSub_DollarName my_append_to_file))}
                        )
                        (Redir
                          op: <Id.Redir_DLess '<<'>
                          loc: (redir_loc.Fd fd:0)
                          arg: 
                            (redir_param.HereDoc
                              here_begin: {<INPUT_END>}
                              here_end_tok: <Id.Undefined_Tok ''>
                              stdin_parts: [
                                <'N inline :'>
                                ($ Id.VSub_DollarName my_i)
                                <'\n'>
                                <'data <<EOF\n'>
                                <'note for commit #'>
                                ($ Id.VSub_DollarName my_i)
                                ($ Id.VSub_DollarName my_note_append)
                                <'\n'>
                                <'EOF\n'>
                                <'\n'>
                              ]
                            )
                        )
                      ]
                      do_fork: T
                    )
                  ]
                  right: <Id.KW_Done done>
                )
              redirects: []
            )
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.Simple
      blame_tok: <rm>
      more_env: []
      words: [{<rm>} {<input>} {<expect>}]
      redirects: []
      do_fork: T
    )
    (command.ShAssignment
      left: <Id.Lit_VarLike 'num_commits='>
      pairs: [
        (AssignPair
          left: <Id.Lit_VarLike 'num_commits='>
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'num_commits='> name:num_commits)
          op: assign_op.Equal
          rhs: {<400>}
        )
      ]
      redirects: []
    )
    (command.Simple
      blame_tok: <fast_import_commits>
      more_env: []
      words: [
        {<fast_import_commits>}
        {(DQ <'refs/heads/many_commits'>)}
        {($ Id.VSub_DollarName num_commits)}
        {<input>}
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <fast_import_notes>
      more_env: []
      words: [
        {<fast_import_notes>}
        {(DQ <'refs/notes/many_notes'>)}
        {($ Id.VSub_DollarName num_commits)}
        {<input>}
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_tick>
      more_env: []
      words: [{<test_tick>}]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <cat>
      more_env: []
      words: [{<cat>}]
      redirects: [
        (Redir op:<Id.Redir_DGreat '>>'> loc:(redir_loc.Fd fd:1) arg:{<input>})
        (Redir
          op: <Id.Redir_DLess '<<'>
          loc: (redir_loc.Fd fd:0)
          arg: 
            (redir_param.HereDoc
              here_begin: {<INPUT_END>}
              here_end_tok: <Id.Undefined_Tok ''>
              stdin_parts: [
                <'commit refs/notes/many_notes\n'>
                <'committer '>
                ($ Id.VSub_DollarName GIT_COMMITTER_NAME)
                <' <'>
                ($ Id.VSub_DollarName GIT_COMMITTER_EMAIL)
                <'> '>
                ($ Id.VSub_DollarName 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_fork: T
    )
    (command.ShAssignment
      left: <Id.Lit_VarLike 'i='>
      pairs: [
        (AssignPair
          left: <Id.Lit_VarLike 'i='>
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'i='> name:i)
          op: assign_op.Equal
          rhs: {($ Id.VSub_DollarName num_commits)}
        )
      ]
      redirects: []
    )
    (command.WhileUntil
      keyword: <Id.KW_While while>
      cond: 
        (condition.Shell
          commands: [
            (command.Simple
              blame_tok: <test>
              more_env: []
              words: [{<test>} {($ Id.VSub_DollarName i)} {<-gt>} {<0>}]
              redirects: []
              do_fork: T
            )
          ]
        )
      body: 
        (command.DoGroup
          left: <Id.KW_Do do>
          children: [
            (command.Simple
              blame_tok: <cat>
              more_env: []
              words: [{<cat>}]
              redirects: [
                (Redir
                  op: <Id.Redir_DGreat '>>'>
                  loc: (redir_loc.Fd fd:1)
                  arg: {<expect>}
                )
                (Redir
                  op: <Id.Redir_DLess '<<'>
                  loc: (redir_loc.Fd fd:0)
                  arg: 
                    (redir_param.HereDoc
                      here_begin: {<EXPECT_END>}
                      here_end_tok: <Id.Undefined_Tok ''>
                      stdin_parts: [
                        <'    commit #'>
                        ($ Id.VSub_DollarName i)
                        <'\n'>
                        <'    note for commit #'>
                        ($ Id.VSub_DollarName i)
                        <'\n'>
                      ]
                    )
                )
              ]
              do_fork: T
            )
            (command.ShAssignment
              left: <Id.Lit_VarLike 'i='>
              pairs: [
                (AssignPair
                  left: <Id.Lit_VarLike 'i='>
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'i='> name:i)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (word_part.ArithSub
                        left: <Id.Left_DollarDParen '$(('>
                        anode: 
                          (arith_expr.Binary
                            op_id: Id.Arith_Minus
                            left: {($ Id.VSub_DollarName i)}
                            right: {<Id.Lit_Digits 1>}
                          )
                        right: <Id.Right_DollarDParen _>
                      )
                    }
                )
              ]
              redirects: []
            )
          ]
          right: <Id.KW_Done done>
        )
      redirects: []
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<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'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<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'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <cat>
      more_env: []
      words: [{<cat>}]
      redirects: [
        (Redir op:<Id.Redir_DGreat '>>'> loc:(redir_loc.Fd fd:1) arg:{<expect_non-note1>})
        (Redir
          op: <Id.Redir_DLess '<<'>
          loc: (redir_loc.Fd fd:0)
          arg: 
            (redir_param.HereDoc
              here_begin: {<EOF>}
              here_end_tok: <Id.Undefined_Tok ''>
              stdin_parts: [
                <'This is not a note, but rather a regular file residing in a notes tree\n'>
              ]
            )
        )
      ]
      do_fork: T
    )
    (command.Simple
      blame_tok: <cat>
      more_env: []
      words: [{<cat>}]
      redirects: [
        (Redir op:<Id.Redir_DGreat '>>'> loc:(redir_loc.Fd fd:1) arg:{<expect_non-note2>})
        (Redir
          op: <Id.Redir_DLess '<<'>
          loc: (redir_loc.Fd fd:0)
          arg: 
            (redir_param.HereDoc
              here_begin: {<EOF>}
              here_end_tok: <Id.Undefined_Tok ''>
              stdin_parts: [<'Non-note file\n'>]
            )
        )
      ]
      do_fork: T
    )
    (command.Simple
      blame_tok: <cat>
      more_env: []
      words: [{<cat>}]
      redirects: [
        (Redir op:<Id.Redir_DGreat '>>'> loc:(redir_loc.Fd fd:1) arg:{<expect_non-note3>})
        (Redir
          op: <Id.Redir_DLess '<<'>
          loc: (redir_loc.Fd fd:0)
          arg: 
            (redir_param.HereDoc
              here_begin: {<EOF>}
              here_end_tok: <Id.Undefined_Tok ''>
              stdin_parts: [<'Another non-note file\n'>]
            )
        )
      ]
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<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'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_tick>
      more_env: []
      words: [{<test_tick>}]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <cat>
      more_env: []
      words: [{<cat>}]
      redirects: [
        (Redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<input>})
        (Redir
          op: <Id.Redir_DLess '<<'>
          loc: (redir_loc.Fd fd:0)
          arg: 
            (redir_param.HereDoc
              here_begin: {<INPUT_END>}
              here_end_tok: <Id.Undefined_Tok ''>
              stdin_parts: [
                <'commit refs/notes/many_notes\n'>
                <'committer '>
                ($ Id.VSub_DollarName GIT_COMMITTER_NAME)
                <' <'>
                ($ Id.VSub_DollarName GIT_COMMITTER_EMAIL)
                <'> '>
                ($ Id.VSub_DollarName 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_fork: T
    )
    (command.Simple blame_tok:<rm> more_env:[] words:[{<rm>} {<expect>}] redirects:[] do_fork:T)
    (command.ShAssignment
      left: <Id.Lit_VarLike 'i='>
      pairs: [
        (AssignPair
          left: <Id.Lit_VarLike 'i='>
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'i='> name:i)
          op: assign_op.Equal
          rhs: {($ Id.VSub_DollarName num_commits)}
        )
      ]
      redirects: []
    )
    (command.ShAssignment
      left: <Id.Lit_VarLike 'j='>
      pairs: [
        (AssignPair
          left: <Id.Lit_VarLike 'j='>
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'j='> name:j)
          op: assign_op.Equal
          rhs: {<0>}
        )
      ]
      redirects: []
    )
    (command.WhileUntil
      keyword: <Id.KW_While while>
      cond: 
        (condition.Shell
          commands: [
            (command.Simple
              blame_tok: <test>
              more_env: []
              words: [{<test>} {($ Id.VSub_DollarName j)} {<-lt>} {<3>}]
              redirects: []
              do_fork: T
            )
          ]
        )
      body: 
        (command.DoGroup
          left: <Id.KW_Do do>
          children: [
            (command.Simple
              blame_tok: <cat>
              more_env: []
              words: [{<cat>}]
              redirects: [
                (Redir op:<Id.Redir_DGreat '>>'> loc:(redir_loc.Fd fd:1) arg:{<input>})
                (Redir
                  op: <Id.Redir_DLess '<<'>
                  loc: (redir_loc.Fd fd:0)
                  arg: 
                    (redir_param.HereDoc
                      here_begin: {<INPUT_END>}
                      here_end_tok: <Id.Undefined_Tok ''>
                      stdin_parts: [
                        <'N inline refs/heads/many_commits~'>
                        ($ Id.VSub_DollarName j)
                        <'\n'>
                        <'data <<EOF\n'>
                        <'changed note for commit #'>
                        ($ Id.VSub_DollarName i)
                        <'\n'>
                        <'EOF\n'>
                      ]
                    )
                )
              ]
              do_fork: T
            )
            (command.Simple
              blame_tok: <cat>
              more_env: []
              words: [{<cat>}]
              redirects: [
                (Redir
                  op: <Id.Redir_DGreat '>>'>
                  loc: (redir_loc.Fd fd:1)
                  arg: {<expect>}
                )
                (Redir
                  op: <Id.Redir_DLess '<<'>
                  loc: (redir_loc.Fd fd:0)
                  arg: 
                    (redir_param.HereDoc
                      here_begin: {<EXPECT_END>}
                      here_end_tok: <Id.Undefined_Tok ''>
                      stdin_parts: [
                        <'    commit #'>
                        ($ Id.VSub_DollarName i)
                        <'\n'>
                        <'    changed note for commit #'>
                        ($ Id.VSub_DollarName i)
                        <'\n'>
                      ]
                    )
                )
              ]
              do_fork: T
            )
            (command.ShAssignment
              left: <Id.Lit_VarLike 'i='>
              pairs: [
                (AssignPair
                  left: <Id.Lit_VarLike 'i='>
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'i='> name:i)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (word_part.ArithSub
                        left: <Id.Left_DollarDParen '$(('>
                        anode: 
                          (arith_expr.Binary
                            op_id: Id.Arith_Minus
                            left: {($ Id.VSub_DollarName i)}
                            right: {<Id.Lit_Digits 1>}
                          )
                        right: <Id.Right_DollarDParen _>
                      )
                    }
                )
              ]
              redirects: []
            )
            (command.ShAssignment
              left: <Id.Lit_VarLike 'j='>
              pairs: [
                (AssignPair
                  left: <Id.Lit_VarLike 'j='>
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'j='> name:j)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (word_part.ArithSub
                        left: <Id.Left_DollarDParen '$(('>
                        anode: 
                          (arith_expr.Binary
                            op_id: Id.Arith_Plus
                            left: {($ Id.VSub_DollarName j)}
                            right: {<Id.Lit_Digits 1>}
                          )
                        right: <Id.Right_DollarDParen _>
                      )
                    }
                )
              ]
              redirects: []
            )
          ]
          right: <Id.KW_Done done>
        )
      redirects: []
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<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'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<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'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.ShAssignment
      left: <Id.Lit_VarLike 'remaining_notes='>
      pairs: [
        (AssignPair
          left: <Id.Lit_VarLike 'remaining_notes='>
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'remaining_notes='> name:remaining_notes)
          op: assign_op.Equal
          rhs: {<10>}
        )
      ]
      redirects: []
    )
    (command.Simple
      blame_tok: <test_tick>
      more_env: []
      words: [{<test_tick>}]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <cat>
      more_env: []
      words: [{<cat>}]
      redirects: [
        (Redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<input>})
        (Redir
          op: <Id.Redir_DLess '<<'>
          loc: (redir_loc.Fd fd:0)
          arg: 
            (redir_param.HereDoc
              here_begin: {<INPUT_END>}
              here_end_tok: <Id.Undefined_Tok ''>
              stdin_parts: [
                <'commit refs/notes/many_notes\n'>
                <'committer '>
                ($ Id.VSub_DollarName GIT_COMMITTER_NAME)
                <' <'>
                ($ Id.VSub_DollarName GIT_COMMITTER_EMAIL)
                <'> '>
                ($ Id.VSub_DollarName GIT_COMMITTER_DATE)
                <'\n'>
                <'data <<COMMIT\n'>
                <'removing all notes but '>
                ($ Id.VSub_DollarName remaining_notes)
                <'\n'>
                <'COMMIT\n'>
                <'from refs/notes/many_notes^0\n'>
              ]
            )
        )
      ]
      do_fork: T
    )
    (command.ShAssignment
      left: <Id.Lit_VarLike 'i='>
      pairs: [
        (AssignPair
          left: <Id.Lit_VarLike 'i='>
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'i='> name:i)
          op: assign_op.Equal
          rhs: 
            {
              (word_part.ArithSub
                left: <Id.Left_DollarDParen '$(('>
                anode: 
                  (arith_expr.Binary
                    op_id: Id.Arith_Minus
                    left: {($ Id.VSub_DollarName num_commits)}
                    right: {($ Id.VSub_DollarName remaining_notes)}
                  )
                right: <Id.Right_DollarDParen _>
              )
            }
        )
      ]
      redirects: []
    )
    (command.ForEach
      keyword: <Id.KW_For for>
      iter_names: [sha1]
      iterable: 
        (for_iter.Words
          words: [
            {
              (CommandSub
                left_token: <Id.Left_DollarParen '$('>
                child: 
                  (command.Simple
                    blame_tok: <git>
                    more_env: []
                    words: [
                      {<git>}
                      {<rev-list>}
                      {<-n>}
                      {($ Id.VSub_DollarName i)}
                      {<'refs/heads/many_commits'>}
                    ]
                    redirects: []
                    do_fork: T
                  )
                right: <Id.Eof_RParen _>
              )
            }
          ]
        )
      body: 
        (command.DoGroup
          left: <Id.KW_Do do>
          children: [
            (command.Simple
              blame_tok: <cat>
              more_env: []
              words: [{<cat>}]
              redirects: [
                (Redir op:<Id.Redir_DGreat '>>'> loc:(redir_loc.Fd fd:1) arg:{<input>})
                (Redir
                  op: <Id.Redir_DLess '<<'>
                  loc: (redir_loc.Fd fd:0)
                  arg: 
                    (redir_param.HereDoc
                      here_begin: {<INPUT_END>}
                      here_end_tok: <Id.Undefined_Tok ''>
                      stdin_parts: [
                        <'N 0000000000000000000000000000000000000000 '>
                        ($ Id.VSub_DollarName sha1)
                        <'\n'>
                      ]
                    )
                )
              ]
              do_fork: T
            )
          ]
          right: <Id.KW_Done done>
        )
      redirects: []
    )
    (command.ShAssignment
      left: <Id.Lit_VarLike 'i='>
      pairs: [
        (AssignPair
          left: <Id.Lit_VarLike 'i='>
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'i='> name:i)
          op: assign_op.Equal
          rhs: {($ Id.VSub_DollarName num_commits)}
        )
      ]
      redirects: []
    )
    (command.Simple blame_tok:<rm> more_env:[] words:[{<rm>} {<expect>}] redirects:[] do_fork:T)
    (command.WhileUntil
      keyword: <Id.KW_While while>
      cond: 
        (condition.Shell
          commands: [
            (command.Simple
              blame_tok: <test>
              more_env: []
              words: [{<test>} {($ Id.VSub_DollarName i)} {<-gt>} {<0>}]
              redirects: []
              do_fork: T
            )
          ]
        )
      body: 
        (command.DoGroup
          left: <Id.KW_Do do>
          children: [
            (command.Simple
              blame_tok: <cat>
              more_env: []
              words: [{<cat>}]
              redirects: [
                (Redir
                  op: <Id.Redir_DGreat '>>'>
                  loc: (redir_loc.Fd fd:1)
                  arg: {<expect>}
                )
                (Redir
                  op: <Id.Redir_DLess '<<'>
                  loc: (redir_loc.Fd fd:0)
                  arg: 
                    (redir_param.HereDoc
                      here_begin: {<EXPECT_END>}
                      here_end_tok: <Id.Undefined_Tok ''>
                      stdin_parts: [<'    commit #'> ($ Id.VSub_DollarName i) <'\n'>]
                    )
                )
              ]
              do_fork: T
            )
            (command.If
              if_kw: <Id.KW_If if>
              arms: [
                (IfArm
                  keyword: <Id.KW_If if>
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Simple
                          blame_tok: <test>
                          more_env: []
                          words: [
                            {<test>}
                            {($ Id.VSub_DollarName i)}
                            {<-le>}
                            {($ Id.VSub_DollarName remaining_notes)}
                          ]
                          redirects: []
                          do_fork: T
                        )
                      ]
                    )
                  then_kw: <Id.KW_Then then>
                  action: [
                    (command.Simple
                      blame_tok: <cat>
                      more_env: []
                      words: [{<cat>}]
                      redirects: [
                        (Redir
                          op: <Id.Redir_DGreat '>>'>
                          loc: (redir_loc.Fd fd:1)
                          arg: {<expect>}
                        )
                        (Redir
                          op: <Id.Redir_DLess '<<'>
                          loc: (redir_loc.Fd fd:0)
                          arg: 
                            (redir_param.HereDoc
                              here_begin: {<EXPECT_END>}
                              here_end_tok: <Id.Undefined_Tok ''>
                              stdin_parts: [<'    note for commit #'> ($ Id.VSub_DollarName i) <'\n'>]
                            )
                        )
                      ]
                      do_fork: T
                    )
                  ]
                  spids: [1447 1458]
                )
              ]
              else_action: []
              fi_kw: <Id.KW_Fi fi>
              redirects: []
            )
            (command.ShAssignment
              left: <Id.Lit_VarLike 'i='>
              pairs: [
                (AssignPair
                  left: <Id.Lit_VarLike 'i='>
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'i='> name:i)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (word_part.ArithSub
                        left: <Id.Left_DollarDParen '$(('>
                        anode: 
                          (arith_expr.Binary
                            op_id: Id.Arith_Minus
                            left: {($ Id.VSub_DollarName i)}
                            right: {<Id.Lit_Digits 1>}
                          )
                        right: <Id.Right_DollarDParen _>
                      )
                    }
                )
              ]
              redirects: []
            )
          ]
          right: <Id.KW_Done done>
        )
      redirects: []
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<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'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<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'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<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'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <rm>
      more_env: []
      words: [{<rm>} {<input>} {<expect>}]
      redirects: []
      do_fork: T
    )
    (command.ShAssignment
      left: <Id.Lit_VarLike 'num_notes_refs='>
      pairs: [
        (AssignPair
          left: <Id.Lit_VarLike 'num_notes_refs='>
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'num_notes_refs='> name:num_notes_refs)
          op: assign_op.Equal
          rhs: {<10>}
        )
      ]
      redirects: []
    )
    (command.ShAssignment
      left: <Id.Lit_VarLike 'num_commits='>
      pairs: [
        (AssignPair
          left: <Id.Lit_VarLike 'num_commits='>
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'num_commits='> name:num_commits)
          op: assign_op.Equal
          rhs: {<16>}
        )
      ]
      redirects: []
    )
    (command.ShAssignment
      left: <Id.Lit_VarLike 'some_commits='>
      pairs: [
        (AssignPair
          left: <Id.Lit_VarLike 'some_commits='>
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'some_commits='> name:some_commits)
          op: assign_op.Equal
          rhs: {<8>}
        )
      ]
      redirects: []
    )
    (command.Simple
      blame_tok: <fast_import_commits>
      more_env: []
      words: [
        {<fast_import_commits>}
        {(DQ <'refs/heads/more_commits'>)}
        {($ Id.VSub_DollarName num_commits)}
        {<input>}
      ]
      redirects: []
      do_fork: T
    )
    (command.ShAssignment
      left: <Id.Lit_VarLike 'i='>
      pairs: [
        (AssignPair
          left: <Id.Lit_VarLike 'i='>
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'i='> name:i)
          op: assign_op.Equal
          rhs: {<0>}
        )
      ]
      redirects: []
    )
    (command.WhileUntil
      keyword: <Id.KW_While while>
      cond: 
        (condition.Shell
          commands: [
            (command.Simple
              blame_tok: <test>
              more_env: []
              words: [{<test>} {($ Id.VSub_DollarName i)} {<-lt>} {($ Id.VSub_DollarName num_notes_refs)}]
              redirects: []
              do_fork: T
            )
          ]
        )
      body: 
        (command.DoGroup
          left: <Id.KW_Do do>
          children: [
            (command.ShAssignment
              left: <Id.Lit_VarLike 'i='>
              pairs: [
                (AssignPair
                  left: <Id.Lit_VarLike 'i='>
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'i='> name:i)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (word_part.ArithSub
                        left: <Id.Left_DollarDParen '$(('>
                        anode: 
                          (arith_expr.Binary
                            op_id: Id.Arith_Plus
                            left: {($ Id.VSub_DollarName i)}
                            right: {<Id.Lit_Digits 1>}
                          )
                        right: <Id.Right_DollarDParen _>
                      )
                    }
                )
              ]
              redirects: []
            )
            (command.Simple
              blame_tok: <fast_import_notes>
              more_env: []
              words: [
                {<fast_import_notes>}
                {(DQ <'refs/notes/more_notes_'> ($ Id.VSub_DollarName i))}
                {($ Id.VSub_DollarName num_commits)}
                {<input>}
              ]
              redirects: []
              do_fork: T
            )
          ]
          right: <Id.KW_Done done>
        )
      redirects: []
    )
    (command.ShAssignment
      left: <Id.Lit_VarLike 'i='>
      pairs: [
        (AssignPair
          left: <Id.Lit_VarLike 'i='>
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'i='> name:i)
          op: assign_op.Equal
          rhs: {<0>}
        )
      ]
      redirects: []
    )
    (command.WhileUntil
      keyword: <Id.KW_While while>
      cond: 
        (condition.Shell
          commands: [
            (command.Simple
              blame_tok: <test>
              more_env: []
              words: [{<test>} {($ Id.VSub_DollarName i)} {<-lt>} {($ Id.VSub_DollarName num_notes_refs)}]
              redirects: []
              do_fork: T
            )
          ]
        )
      body: 
        (command.DoGroup
          left: <Id.KW_Do do>
          children: [
            (command.ShAssignment
              left: <Id.Lit_VarLike 'i='>
              pairs: [
                (AssignPair
                  left: <Id.Lit_VarLike 'i='>
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'i='> name:i)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (word_part.ArithSub
                        left: <Id.Left_DollarDParen '$(('>
                        anode: 
                          (arith_expr.Binary
                            op_id: Id.Arith_Plus
                            left: {($ Id.VSub_DollarName i)}
                            right: {<Id.Lit_Digits 1>}
                          )
                        right: <Id.Right_DollarDParen _>
                      )
                    }
                )
              ]
              redirects: []
            )
            (command.Simple
              blame_tok: <fast_import_notes>
              more_env: []
              words: [
                {<fast_import_notes>}
                {(DQ <'refs/notes/more_notes_'> ($ Id.VSub_DollarName i))}
                {($ Id.VSub_DollarName some_commits)}
                {<input>}
                {(DQ <' (2)'>)}
              ]
              redirects: []
              do_fork: T
            )
          ]
          right: <Id.KW_Done done>
        )
      redirects: []
    )
    (command.ShAssignment
      left: <Id.Lit_VarLike 'i='>
      pairs: [
        (AssignPair
          left: <Id.Lit_VarLike 'i='>
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'i='> name:i)
          op: assign_op.Equal
          rhs: {($ Id.VSub_DollarName num_commits)}
        )
      ]
      redirects: []
    )
    (command.WhileUntil
      keyword: <Id.KW_While while>
      cond: 
        (condition.Shell
          commands: [
            (command.Simple
              blame_tok: <test>
              more_env: []
              words: [{<test>} {($ Id.VSub_DollarName i)} {<-gt>} {<0>}]
              redirects: []
              do_fork: T
            )
          ]
        )
      body: 
        (command.DoGroup
          left: <Id.KW_Do do>
          children: [
            (command.ShAssignment
              left: <Id.Lit_VarLike 'note_data='>
              pairs: [
                (AssignPair
                  left: <Id.Lit_VarLike 'note_data='>
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'note_data='> name:note_data)
                  op: assign_op.Equal
                  rhs: {(DQ <'note for commit #'> ($ Id.VSub_DollarName i))}
                )
              ]
              redirects: []
            )
            (command.If
              if_kw: <Id.KW_If if>
              arms: [
                (IfArm
                  keyword: <Id.KW_If if>
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Simple
                          blame_tok: <test>
                          more_env: []
                          words: [
                            {<test>}
                            {($ Id.VSub_DollarName i)}
                            {<-le>}
                            {($ Id.VSub_DollarName some_commits)}
                          ]
                          redirects: []
                          do_fork: T
                        )
                      ]
                    )
                  then_kw: <Id.KW_Then then>
                  action: [
                    (command.ShAssignment
                      left: <Id.Lit_VarLike 'note_data='>
                      pairs: [
                        (AssignPair
                          left: <Id.Lit_VarLike 'note_data='>
                          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'note_data='> name:note_data)
                          op: assign_op.Equal
                          rhs: {(DQ ($ Id.VSub_DollarName note_data) <' (2)'>)}
                        )
                      ]
                      redirects: []
                    )
                  ]
                  spids: [1699 1710]
                )
              ]
              else_action: []
              fi_kw: <Id.KW_Fi fi>
              redirects: []
            )
            (command.Simple
              blame_tok: <cat>
              more_env: []
              words: [{<cat>}]
              redirects: [
                (Redir
                  op: <Id.Redir_DGreat '>>'>
                  loc: (redir_loc.Fd fd:1)
                  arg: {<expect>}
                )
                (Redir
                  op: <Id.Redir_DLess '<<'>
                  loc: (redir_loc.Fd fd:0)
                  arg: 
                    (redir_param.HereDoc
                      here_begin: {<EXPECT_END>}
                      here_end_tok: <Id.Undefined_Tok ''>
                      stdin_parts: [
                        <'    commit #'>
                        ($ Id.VSub_DollarName i)
                        <'\n'>
                        <'    '>
                        ($ Id.VSub_DollarName note_data)
                        <'\n'>
                      ]
                    )
                )
              ]
              do_fork: T
            )
            (command.ShAssignment
              left: <Id.Lit_VarLike 'i='>
              pairs: [
                (AssignPair
                  left: <Id.Lit_VarLike 'i='>
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'i='> name:i)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (word_part.ArithSub
                        left: <Id.Left_DollarDParen '$(('>
                        anode: 
                          (arith_expr.Binary
                            op_id: Id.Arith_Minus
                            left: {($ Id.VSub_DollarName i)}
                            right: {<Id.Lit_Digits 1>}
                          )
                        right: <Id.Right_DollarDParen _>
                      )
                    }
                )
              ]
              redirects: []
            )
          ]
          right: <Id.KW_Done done>
        )
      redirects: []
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {
          (DQ <'add notes to '> ($ Id.VSub_DollarName num_commits) <' commits in each of '> 
            ($ Id.VSub_DollarName 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'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_done>
      more_env: []
      words: [{<test_done>}]
      redirects: []
      do_fork: T
    )
  ]
)