(command.CommandList
  children: [
    (command.Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (lhs_expr.LhsName name:test_description)
          op: Equal
          rhs: {(SQ <'Test commit notes index (expensive!)'>)}
        )
      ]
    )
    (C {(.)} {(./test-lib.sh)})
    (command.FuncDef
      name: create_repo
      body: 
        (command.BraceGroup
          children: [
            (command.Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (lhs_expr.LhsName name:number_of_commits)
                  op: Equal
                  rhs: {($ VSub_Number '$1')}
                )
              ]
            )
            (command.Assignment
              keyword: Assign_None
              pairs: [(assign_pair lhs:(lhs_expr.LhsName name:nr) op:Equal rhs:{(0)})]
            )
            (command.AndOr
              ops: [Op_DPipe]
              children: [
                (C {(test)} {(-d)} {(.git)})
                (command.BraceGroup
                  children: [
                    (command.AndOr
                      ops: [Op_DAmp Op_DAmp]
                      children: [
                        (C {(git)} {(init)})
                        (command.Pipeline
                          children: [
                            (command.Subshell
                              command_list: 
                                (command.CommandList
                                  children: [
                                    (command.AndOr
                                      ops: [Op_DAmp Op_DAmp Op_DAmp]
                                      children: [
                                        (command.WhileUntil
                                          keyword: <KW_While while>
                                          cond: [
                                            (C {(test)} {($ VSub_DollarName '$nr')} {(-lt)} 
                                              {($ VSub_DollarName '$number_of_commits')}
                                            )
                                          ]
                                          body: 
                                            (command.DoGroup
                                              children: [
                                                (command.Assignment
                                                  keyword: Assign_None
                                                  pairs: [
                                                    (assign_pair
                                                      lhs: (lhs_expr.LhsName name:nr)
                                                      op: Equal
                                                      rhs: 
                                                        {
                                                          (word_part.ArithSubPart
                                                            anode: 
                                                              (arith_expr.ArithBinary
                                                                op_id: Arith_Plus
                                                                left: 
                                                                  (arith_expr.ArithWord
                                                                    w: {($ VSub_DollarName '$nr')}
                                                                  )
                                                                right: 
                                                                  (arith_expr.ArithWord
                                                                    w: {(Lit_Digits 1)}
                                                                  )
                                                              )
                                                          )
                                                        }
                                                    )
                                                  ]
                                                )
                                                (command.Assignment
                                                  keyword: Assign_None
                                                  pairs: [
                                                    (assign_pair
                                                      lhs: (lhs_expr.LhsName name:mark)
                                                      op: Equal
                                                      rhs: 
                                                        {
                                                          (word_part.ArithSubPart
                                                            anode: 
                                                              (arith_expr.ArithBinary
                                                                op_id: Arith_Plus
                                                                left: 
                                                                  (arith_expr.ArithWord
                                                                    w: {($ VSub_DollarName '$nr')}
                                                                  )
                                                                right: 
                                                                  (arith_expr.ArithWord
                                                                    w: {($ VSub_DollarName '$nr')}
                                                                  )
                                                              )
                                                          )
                                                        }
                                                    )
                                                  ]
                                                )
                                                (command.Assignment
                                                  keyword: Assign_None
                                                  pairs: [
                                                    (assign_pair
                                                      lhs: (lhs_expr.LhsName name:notemark)
                                                      op: Equal
                                                      rhs: 
                                                        {
                                                          (word_part.ArithSubPart
                                                            anode: 
                                                              (arith_expr.ArithBinary
                                                                op_id: Arith_Plus
                                                                left: 
                                                                  (arith_expr.ArithWord
                                                                    w: {($ VSub_DollarName '$mark')}
                                                                  )
                                                                right: 
                                                                  (arith_expr.ArithWord
                                                                    w: {(Lit_Digits 1)}
                                                                  )
                                                              )
                                                          )
                                                        }
                                                    )
                                                  ]
                                                )
                                                (command.AndOr
                                                  ops: [Op_DAmp Op_DAmp]
                                                  children: [
                                                    (C {(test_tick)})
                                                    (command.SimpleCommand
                                                      words: [{(cat)}]
                                                      redirects: [
                                                        (redir.HereDoc
                                                          op: <Redir_DLessDash '<<-'>
                                                          fd: 16777215
                                                          here_begin: {(INPUT_END)}
                                                          here_end_span_id: 149
                                                          stdin_parts: [
                                                            ('commit refs/heads/master\n')
                                                            ('mark :')
                                                            ($ VSub_DollarName '$mark')
                                                            ('\n')
                                                            ('committer ')
                                                            ($ VSub_DollarName '$GIT_COMMITTER_NAME')
                                                            (' <')
                                                            ($ VSub_DollarName '$GIT_COMMITTER_EMAIL')
                                                            ('> ')
                                                            ($ VSub_DollarName '$GIT_COMMITTER_DATE')
                                                            ('\n')
                                                            ('data <<COMMIT\n')
                                                            ('commit #')
                                                            ($ VSub_DollarName '$nr')
                                                            ('\n')
                                                            ('COMMIT\n')
                                                            ('\n')
                                                            ('M 644 inline file\n')
                                                            ('data <<EOF\n')
                                                            ('file in commit #')
                                                            ($ VSub_DollarName '$nr')
                                                            ('\n')
                                                            ('EOF\n')
                                                            ('\n')
                                                            ('blob\n')
                                                            ('mark :')
                                                            ($ VSub_DollarName '$notemark')
                                                            ('\n')
                                                            ('data <<EOF\n')
                                                            ('note for commit #')
                                                            ($ VSub_DollarName '$nr')
                                                            ('\n')
                                                            ('EOF\n')
                                                            ('\n')
                                                          ]
                                                        )
                                                      ]
                                                    )
                                                    (command.SimpleCommand
                                                      words: [
                                                        {(echo)}
                                                        {
                                                          (DQ ('N :') ($ VSub_DollarName '$notemark') 
                                                            (' :') ($ VSub_DollarName '$mark')
                                                          )
                                                        }
                                                      ]
                                                      redirects: [
                                                        (redir.Redir
                                                          op: <Redir_DGreat '>>'>
                                                          fd: 16777215
                                                          arg_word: {(note_commit)}
                                                        )
                                                      ]
                                                    )
                                                  ]
                                                )
                                              ]
                                            )
                                        )
                                        (C {(test_tick)})
                                        (command.SimpleCommand
                                          words: [{(cat)}]
                                          redirects: [
                                            (redir.HereDoc
                                              op: <Redir_DLessDash '<<-'>
                                              fd: 16777215
                                              here_begin: {(INPUT_END)}
                                              here_end_span_id: 194
                                              stdin_parts: [
                                                ('commit refs/notes/commits\n')
                                                ('committer ')
                                                ($ VSub_DollarName '$GIT_COMMITTER_NAME')
                                                (' <')
                                                ($ VSub_DollarName '$GIT_COMMITTER_EMAIL')
                                                ('> ')
                                                ($ VSub_DollarName '$GIT_COMMITTER_DATE')
                                                ('\n')
                                                ('data <<COMMIT\n')
                                                ('notes\n')
                                                ('COMMIT\n')
                                                ('\n')
                                              ]
                                            )
                                          ]
                                        )
                                        (C {(cat)} {(note_commit)})
                                      ]
                                    )
                                  ]
                                )
                            )
                            (C {(git)} {(fast-import)} {(--quiet)})
                          ]
                          negated: F
                        )
                        (C {(git)} {(config)} {(core.notesRef)} {(refs/notes/commits)})
                      ]
                    )
                  ]
                )
              ]
            )
          ]
        )
    )
    (command.FuncDef
      name: test_notes
      body: 
        (command.BraceGroup
          children: [
            (command.AndOr
              ops: [Op_DAmp Op_DAmp Op_DAmp Op_DAmp Op_DAmp]
              children: [
                (command.Assignment
                  keyword: Assign_None
                  pairs: [
                    (assign_pair
                      lhs: (lhs_expr.LhsName name:count)
                      op: Equal
                      rhs: {($ VSub_Number '$1')}
                    )
                  ]
                )
                (C {(git)} {(config)} {(core.notesRef)} {(refs/notes/commits)})
                (command.Pipeline
                  children: [
                    (C {(git)} {(log)})
                    (command.SimpleCommand
                      words: [{(grep)} {(DQ ('^    '))}]
                      redirects: [(redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(output)})]
                    )
                  ]
                  negated: F
                )
                (command.Assignment
                  keyword: Assign_None
                  pairs: [
                    (assign_pair
                      lhs: (lhs_expr.LhsName name:i)
                      op: Equal
                      rhs: {($ VSub_DollarName '$count')}
                    )
                  ]
                )
                (command.WhileUntil
                  keyword: <KW_While while>
                  cond: [(C {(test)} {($ VSub_DollarName '$i')} {(-gt)} {(0)})]
                  body: 
                    (command.DoGroup
                      children: [
                        (command.AndOr
                          ops: [Op_DAmp Op_DAmp]
                          children: [
                            (C {(echo)} {(DQ ('    commit #') ($ VSub_DollarName '$i'))})
                            (C {(echo)} {(DQ ('    note for commit #') ($ VSub_DollarName '$i'))})
                            (command.Assignment
                              keyword: Assign_None
                              pairs: [
                                (assign_pair
                                  lhs: (lhs_expr.LhsName name:i)
                                  op: Equal
                                  rhs: 
                                    {
                                      (word_part.ArithSubPart
                                        anode: 
                                          (arith_expr.ArithBinary
                                            op_id: Arith_Minus
                                            left: (arith_expr.ArithWord w:{($ VSub_DollarName '$i')})
                                            right: (arith_expr.ArithWord w:{(Lit_Digits 1)})
                                          )
                                      )
                                    }
                                )
                              ]
                            )
                          ]
                        )
                      ]
                    )
                  redirects: [(redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(expect)})]
                )
                (C {(test_cmp)} {(expect)} {(output)})
              ]
            )
          ]
        )
    )
    (command.SimpleCommand
      words: [{(write_script)} {(time_notes)}]
      redirects: [
        (redir.HereDoc
          op: <Redir_DLess '<<'>
          fd: 16777215
          here_begin: {(word_part.EscapedLiteralPart token:<Lit_EscapedChar '\\E'>) (OF)}
          here_end_span_id: 363
          stdin_parts: [
            ('\tmode=$1\n')
            ('\ti=1\n')
            ('\twhile test $i -lt $2\n')
            ('\tdo\n')
            ('\t\tcase $1 in\n')
            ('\t\tno-notes)\n')
            ('\t\t\tGIT_NOTES_REF=non-existing\n')
            ('\t\t\texport GIT_NOTES_REF\n')
            ('\t\t\t;;\n')
            ('\t\tnotes)\n')
            ('\t\t\tunset GIT_NOTES_REF\n')
            ('\t\t\t;;\n')
            ('\t\tesac\n')
            ('\t\tgit log\n')
            ('\t\ti=$(($i+1))\n')
            ('\tdone >/dev/null\n')
          ]
        )
      ]
    )
    (command.FuncDef
      name: time_notes
      body: 
        (command.BraceGroup
          children: [
            (command.ForEach
              iter_name: mode
              iter_words: [{(no-notes)} {(notes)}]
              do_arg_iter: F
              body: 
                (command.DoGroup
                  children: [
                    (C {(echo)} {($ VSub_DollarName '$mode')})
                    (C {(/usr/bin/time)} {(../time_notes)} {($ VSub_DollarName '$mode')} 
                      {($ VSub_Number '$1')}
                    )
                  ]
                )
            )
          ]
        )
    )
    (command.FuncDef
      name: do_tests
      body: 
        (command.BraceGroup
          children: [
            (command.Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (lhs_expr.LhsName name:count)
                  op: Equal
                  rhs: {($ VSub_Number '$1')}
                )
                (assign_pair
                  lhs: (lhs_expr.LhsName name:pr)
                  op: Equal
                  rhs: 
                    {
                      (word_part.BracedVarSub
                        token: <VSub_Number 2>
                        suffix_op: (suffix_op.StringUnary op_id:VTest_Hyphen arg_word:{})
                      )
                    }
                )
              ]
            )
            (C {(test_expect_success)} {($ VSub_DollarName '$pr')} 
              {(DQ ('setup ') ($ VSub_DollarName '$count'))} 
              {
                (SQ <'\n'> <'\t\tmkdir "$count" &&\n'> <'\t\t(\n'> <'\t\t\tcd "$count" &&\n'> 
                  <'\t\t\tcreate_repo "$count"\n'> <'\t\t)\n'> <'\t'>
                )
              }
            )
            (C {(test_expect_success)} {($ VSub_DollarName '$pr')} {(SQ <'notes work'>)} 
              {
                (SQ <'\n'> <'\t\t(\n'> <'\t\t\tcd "$count" &&\n'> <'\t\t\ttest_notes "$count"\n'> 
                  <'\t\t)\n'> <'\t'>
                )
              }
            )
            (C {(test_expect_success)} 
              {
                (DQ (USR_BIN_TIME) 
                  (word_part.BracedVarSub
                    token: <VSub_Name pr>
                    suffix_op: 
                      (suffix_op.StringUnary
                        op_id: VTest_ColonPlus
                        arg_word: {(',') ($ VSub_DollarName '$pr')}
                      )
                  )
                )
              } {(SQ <'notes timing with /usr/bin/time'>)} 
              {
                (SQ <'\n'> <'\t\t(\n'> <'\t\t\tcd "$count" &&\n'> <'\t\t\ttime_notes 100\n'> <'\t\t)\n'> 
                  <'\t'>
                )
              }
            )
          ]
        )
    )
    (C {(do_tests)} {(10)})
    (command.ForEach
      iter_name: count
      iter_words: [{(100)} {(1000)} {(10000)}]
      do_arg_iter: F
      body: 
        (command.DoGroup
          children: [(C {(do_tests)} {(DQ ($ VSub_DollarName '$count'))} {(EXPENSIVE)})]
        )
    )
    (C {(test_done)})
  ]
)