(CommandList
  children: [
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:test_description spids:[13])
          op: Equal
          rhs: {(SQ <'Test commit notes index (expensive!)'>)}
          spids: [13]
        )
      ]
      spids: [13]
    )
    (C {(.)} {(./test-lib.sh)})
    (FuncDef
      name: create_repo
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:number_of_commits spids:[32])
                  op: Equal
                  rhs: {($ VSub_Number '$1')}
                  spids: [32]
                )
              ]
              spids: [32]
            )
            (Assignment
              keyword: Assign_None
              pairs: [(assign_pair lhs:(LhsName name:nr spids:[36]) op:Equal rhs:{(0)} spids:[36])]
              spids: [36]
            )
            (AndOr
              ops: [Op_DPipe]
              children: [
                (C {(test)} {(-d)} {(.git)})
                (BraceGroup
                  children: [
                    (AndOr
                      ops: [Op_DAmp Op_DAmp]
                      children: [
                        (C {(git)} {(init)})
                        (Pipeline
                          children: [
                            (Subshell
                              child: 
                                (AndOr
                                  ops: [Op_DAmp Op_DAmp Op_DAmp]
                                  children: [
                                    (WhileUntil
                                      keyword: <KW_While while>
                                      cond: [
                                        (C {(test)} {($ VSub_Name '$nr')} {(-lt)} 
                                          {($ VSub_Name '$number_of_commits')}
                                        )
                                      ]
                                      body: 
                                        (DoGroup
                                          children: [
                                            (Assignment
                                              keyword: Assign_None
                                              pairs: [
                                                (assign_pair
                                                  lhs: (LhsName name:nr spids:[75])
                                                  op: Equal
                                                  rhs: 
                                                    {
                                                      (ArithSubPart
                                                        anode: 
                                                          (ArithBinary
                                                            op_id: Arith_Plus
                                                            left: (ArithWord w:{($ VSub_Name '$nr')})
                                                            right: (ArithWord w:{(Lit_Digits 1)})
                                                          )
                                                        spids: [76 81]
                                                      )
                                                    }
                                                  spids: [75]
                                                )
                                              ]
                                              spids: [75]
                                            )
                                            (Assignment
                                              keyword: Assign_None
                                              pairs: [
                                                (assign_pair
                                                  lhs: (LhsName name:mark spids:[84])
                                                  op: Equal
                                                  rhs: 
                                                    {
                                                      (ArithSubPart
                                                        anode: 
                                                          (ArithBinary
                                                            op_id: Arith_Plus
                                                            left: (ArithWord w:{($ VSub_Name '$nr')})
                                                            right: (ArithWord w:{($ VSub_Name '$nr')})
                                                          )
                                                        spids: [85 90]
                                                      )
                                                    }
                                                  spids: [84]
                                                )
                                              ]
                                              spids: [84]
                                            )
                                            (Assignment
                                              keyword: Assign_None
                                              pairs: [
                                                (assign_pair
                                                  lhs: (LhsName name:notemark spids:[93])
                                                  op: Equal
                                                  rhs: 
                                                    {
                                                      (ArithSubPart
                                                        anode: 
                                                          (ArithBinary
                                                            op_id: Arith_Plus
                                                            left: (ArithWord w:{($ VSub_Name '$mark')})
                                                            right: (ArithWord w:{(Lit_Digits 1)})
                                                          )
                                                        spids: [94 99]
                                                      )
                                                    }
                                                  spids: [93]
                                                )
                                              ]
                                              spids: [93]
                                            )
                                            (AndOr
                                              ops: [Op_DAmp Op_DAmp]
                                              children: [
                                                (C {(test_tick)})
                                                (SimpleCommand
                                                  words: [{(cat)}]
                                                  redirects: [
                                                    (HereDoc
                                                      op: <Redir_DLessDash '<<-'>
                                                      fd: 16777215
                                                      here_begin: {(INPUT_END)}
                                                      here_end_span_id: 149
                                                      stdin_parts: [
                                                        ('commit refs/heads/master\n')
                                                        ('mark :')
                                                        ($ VSub_Name '$mark')
                                                        ('\n')
                                                        ('committer ')
                                                        ($ VSub_Name '$GIT_COMMITTER_NAME')
                                                        (' <')
                                                        ($ VSub_Name '$GIT_COMMITTER_EMAIL')
                                                        ('> ')
                                                        ($ VSub_Name '$GIT_COMMITTER_DATE')
                                                        ('\n')
                                                        ('data <<COMMIT\n')
                                                        ('commit #')
                                                        ($ VSub_Name '$nr')
                                                        ('\n')
                                                        ('COMMIT\n')
                                                        ('\n')
                                                        ('M 644 inline file\n')
                                                        ('data <<EOF\n')
                                                        ('file in commit #')
                                                        ($ VSub_Name '$nr')
                                                        ('\n')
                                                        ('EOF\n')
                                                        ('\n')
                                                        ('blob\n')
                                                        ('mark :')
                                                        ($ VSub_Name '$notemark')
                                                        ('\n')
                                                        ('data <<EOF\n')
                                                        ('note for commit #')
                                                        ($ VSub_Name '$nr')
                                                        ('\n')
                                                        ('EOF\n')
                                                        ('\n')
                                                      ]
                                                    )
                                                  ]
                                                )
                                                (SimpleCommand
                                                  words: [
                                                    {(echo)}
                                                    {
                                                      (DQ ('N :') ($ VSub_Name '$notemark') (' :') 
                                                        ($ VSub_Name '$mark')
                                                      )
                                                    }
                                                  ]
                                                  redirects: [
                                                    (Redir
                                                      op: <Redir_DGreat '>>'>
                                                      fd: 16777215
                                                      arg_word: {(note_commit)}
                                                    )
                                                  ]
                                                )
                                              ]
                                            )
                                          ]
                                          spids: [72 164]
                                        )
                                    )
                                    (C {(test_tick)})
                                    (SimpleCommand
                                      words: [{(cat)}]
                                      redirects: [
                                        (HereDoc
                                          op: <Redir_DLessDash '<<-'>
                                          fd: 16777215
                                          here_begin: {(INPUT_END)}
                                          here_end_span_id: 194
                                          stdin_parts: [
                                            ('commit refs/notes/commits\n')
                                            ('committer ')
                                            ($ VSub_Name '$GIT_COMMITTER_NAME')
                                            (' <')
                                            ($ VSub_Name '$GIT_COMMITTER_EMAIL')
                                            ('> ')
                                            ($ VSub_Name '$GIT_COMMITTER_DATE')
                                            ('\n')
                                            ('data <<COMMIT\n')
                                            ('notes\n')
                                            ('COMMIT\n')
                                            ('\n')
                                          ]
                                        )
                                      ]
                                    )
                                    (C {(cat)} {(note_commit)})
                                  ]
                                )
                              spids: [58 202]
                            )
                            (C {(git)} {(fast-import)} {(--quiet)})
                          ]
                          negated: F
                        )
                        (C {(git)} {(config)} {(core.notesRef)} {(refs/notes/commits)})
                      ]
                    )
                  ]
                  spids: [48]
                )
              ]
            )
          ]
          spids: [29]
        )
      spids: [24 28]
    )
    (FuncDef
      name: test_notes
      body: 
        (BraceGroup
          children: [
            (AndOr
              ops: [Op_DAmp Op_DAmp Op_DAmp Op_DAmp Op_DAmp]
              children: [
                (Assignment
                  keyword: Assign_None
                  pairs: [
                    (assign_pair
                      lhs: (LhsName name:count spids:[238])
                      op: Equal
                      rhs: {($ VSub_Number '$1')}
                      spids: [238]
                    )
                  ]
                  spids: [238]
                )
                (C {(git)} {(config)} {(core.notesRef)} {(refs/notes/commits)})
                (Pipeline
                  children: [
                    (C {(git)} {(log)})
                    (SimpleCommand
                      words: [{(grep)} {(DQ ('^    '))}]
                      redirects: [(Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(output)})]
                    )
                  ]
                  negated: F
                )
                (Assignment
                  keyword: Assign_None
                  pairs: [
                    (assign_pair
                      lhs: (LhsName name:i spids:[273])
                      op: Equal
                      rhs: {($ VSub_Name '$count')}
                      spids: [273]
                    )
                  ]
                  spids: [273]
                )
                (WhileUntil
                  keyword: <KW_While while>
                  cond: [(C {(test)} {($ VSub_Name '$i')} {(-gt)} {(0)})]
                  body: 
                    (DoGroup
                      children: [
                        (AndOr
                          ops: [Op_DAmp Op_DAmp]
                          children: [
                            (C {(echo)} {(DQ ('    commit #') ($ VSub_Name '$i'))})
                            (C {(echo)} {(DQ ('    note for commit #') ($ VSub_Name '$i'))})
                            (Assignment
                              keyword: Assign_None
                              pairs: [
                                (assign_pair
                                  lhs: (LhsName name:i spids:[313])
                                  op: Equal
                                  rhs: 
                                    {
                                      (ArithSubPart
                                        anode: 
                                          (ArithBinary
                                            op_id: Arith_Minus
                                            left: (ArithWord w:{($ VSub_Name '$i')})
                                            right: (ArithWord w:{(Lit_Digits 1)})
                                          )
                                        spids: [314 319]
                                      )
                                    }
                                  spids: [313]
                                )
                              ]
                              spids: [313]
                            )
                          ]
                        )
                      ]
                      spids: [290 322]
                    )
                  redirects: [(Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(expect)})]
                )
                (C {(test_cmp)} {(expect)} {(output)})
              ]
            )
          ]
          spids: [235]
        )
      spids: [230 234]
    )
    (SimpleCommand
      words: [{(write_script)} {(time_notes)}]
      redirects: [
        (HereDoc
          op: <Redir_DLess '<<'>
          fd: 16777215
          here_begin: {(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')
          ]
        )
      ]
    )
    (FuncDef
      name: time_notes
      body: 
        (BraceGroup
          children: [
            (ForEach
              iter_name: mode
              iter_words: [{(no-notes)} {(notes)}]
              do_arg_iter: F
              body: 
                (DoGroup
                  children: [
                    (C {(echo)} {($ VSub_Name '$mode')})
                    (C {(/usr/bin/time)} {(../time_notes)} {($ VSub_Name '$mode')} {($ VSub_Number '$1')})
                  ]
                  spids: [384 401]
                )
              spids: [378 16777215]
            )
          ]
          spids: [370]
        )
      spids: [365 369]
    )
    (FuncDef
      name: do_tests
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:count spids:[414])
                  op: Equal
                  rhs: {($ VSub_Number '$1')}
                  spids: [414]
                )
                (assign_pair
                  lhs: (LhsName name:pr spids:[417])
                  op: Equal
                  rhs: 
                    {
                      (BracedVarSub
                        token: <VSub_Number 2>
                        suffix_op: (StringUnary op_id:VTest_Hyphen arg_word:{})
                        spids: [418 421]
                      )
                    }
                  spids: [417]
                )
              ]
              spids: [414]
            )
            (C {(test_expect_success)} {($ VSub_Name '$pr')} {(DQ ('setup ') ($ VSub_Name '$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_Name '$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) 
                  (BracedVarSub
                    token: <VSub_Name pr>
                    suffix_op: (StringUnary op_id:VTest_ColonPlus arg_word:{(',') ($ VSub_Name '$pr')})
                    spids: [469 474]
                  )
                )
              } {(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'>
                )
              }
            )
          ]
          spids: [411]
        )
      spids: [406 410]
    )
    (C {(do_tests)} {(10)})
    (ForEach
      iter_name: count
      iter_words: [{(100)} {(1000)} {(10000)}]
      do_arg_iter: F
      body: 
        (DoGroup
          children: [(C {(do_tests)} {(DQ ($ VSub_Name '$count'))} {(EXPENSIVE)})]
          spids: [509 520]
        )
      spids: [502 16777215]
    )
    (C {(test_done)})
  ]
)