(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 <'git rebase - test patch id computation'>)}
        )
      ]
      redirects: []
    )
    (command.Simple
      blame_tok: <.>
      more_env: []
      words: [{<.>} {<'./test-lib.sh'>}]
      redirects: []
      do_fork: T
    )
    (command.ShFunction
      name_tok: <count>
      name: count
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          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: {<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_Number 1)}]
                      redirects: []
                      do_fork: T
                    )
                  ]
                )
              body: 
                (command.DoGroup
                  left: <Id.KW_Do do>
                  children: [
                    (command.Simple
                      blame_tok: <echo>
                      more_env: []
                      words: [{<echo>} {(DQ ($ Id.VSub_DollarName i))}]
                      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: 
                            {
                              (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: []
                    )
                  ]
                  right: <Id.KW_Done done>
                )
              redirects: []
            )
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.ShFunction
      name_tok: <scramble>
      name: scramble
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          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: {<0>}
                )
              ]
              redirects: []
            )
            (command.WhileUntil
              keyword: <Id.KW_While while>
              cond: 
                (condition.Shell
                  commands: [
                    (command.Simple
                      blame_tok: <read>
                      more_env: []
                      words: [{<read>} {<x>}]
                      redirects: []
                      do_fork: T
                    )
                  ]
                )
              body: 
                (command.DoGroup
                  left: <Id.KW_Do do>
                  children: [
                    (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)} {<-ne>} {<0>}]
                                  redirects: []
                                  do_fork: T
                                )
                              ]
                            )
                          then_kw: <Id.KW_Then then>
                          action: [
                            (command.Simple
                              blame_tok: <echo>
                              more_env: []
                              words: [{<echo>} {(DQ ($ Id.VSub_DollarName x))}]
                              redirects: []
                              do_fork: T
                            )
                          ]
                          spids: [84 95]
                        )
                      ]
                      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_Percent
                                    left: 
                                      (arith_expr.Binary
                                        op_id: Id.Arith_Plus
                                        left: {($ Id.VSub_DollarName i)}
                                        right: {<Id.Lit_Digits 1>}
                                      )
                                    right: {<Id.Lit_Digits 10>}
                                  )
                                right: <Id.Right_DollarDParen _>
                              )
                            }
                        )
                      ]
                      redirects: []
                    )
                  ]
                  right: <Id.KW_Done done>
                )
              redirects: [
                (Redir
                  op: <Id.Redir_Less '<'>
                  loc: (redir_loc.Fd fd:0)
                  arg: {(DQ ($ Id.VSub_Number 1))}
                )
                (Redir
                  op: <Id.Redir_Great '>'>
                  loc: (redir_loc.Fd fd:1)
                  arg: {(DQ ($ Id.VSub_Number 1) <.new>)}
                )
              ]
            )
            (command.Simple
              blame_tok: <mv>
              more_env: []
              words: [{<mv>} {<-f>} {(DQ ($ Id.VSub_Number 1) <.new>)} {(DQ ($ Id.VSub_Number 1))}]
              redirects: []
              do_fork: T
            )
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.ShFunction
      name_tok: <run>
      name: run
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (command.Simple
              blame_tok: <echo>
              more_env: []
              words: [
                {<echo>}
                {(word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\$'> ch:'$')}
                {(DQ ($ Id.VSub_At '@'))}
              ]
              redirects: []
              do_fork: T
            )
            (command.Simple
              blame_tok: <'/usr/bin/time'>
              more_env: []
              words: [{<'/usr/bin/time'>} {(DQ ($ Id.VSub_At '@'))}]
              redirects: [(Redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<'/dev/null'>})]
              do_fork: T
            )
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <setup>)}
        {(SQ <'\n'> <'\tgit commit --allow-empty -m initial &&\n'> <'\tgit tag root\n'>)}
      ]
      redirects: []
      do_fork: T
    )
    (command.ShFunction
      name_tok: <do_tests>
      name: do_tests
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (command.ShAssignment
              left: <Id.Lit_VarLike 'nlines='>
              pairs: [
                (AssignPair
                  left: <Id.Lit_VarLike 'nlines='>
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'nlines='> name:nlines)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_Number 1)}
                )
                (AssignPair
                  left: <Id.Lit_VarLike 'pr='>
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'pr='> name:pr)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (BracedVarSub
                        left: <Id.Left_DollarBrace '${'>
                        token: <Id.VSub_Number 2>
                        var_name: 2
                        suffix_op: (suffix_op.Unary op:<Id.VTest_Hyphen _> arg_word:{})
                        right: <Id.Right_DollarBrace '}'>
                      )
                    }
                )
              ]
              redirects: []
            )
            (command.Simple
              blame_tok: <test_expect_success>
              more_env: []
              words: [
                {<test_expect_success>}
                {($ Id.VSub_DollarName pr)}
                {(DQ <'setup: '> ($ Id.VSub_DollarName nlines) <' lines'>)}
                {
                  (DQ <'\n'> <'\t\trm -f .gitattributes &&\n'> <'\t\tgit checkout -q -f master &&\n'> 
                    <'\t\tgit reset --hard root &&\n'> <'\t\tcount '> ($ Id.VSub_DollarName nlines) <' >file &&\n'> <'\t\tgit add file &&\n'> 
                    <'\t\tgit commit -q -m initial &&\n'> <'\t\tgit branch -f other &&\n'> <'\n'> <'\t\tscramble file &&\n'> <'\t\tgit add file &&\n'> 
                    <'\t\tgit commit -q -m \'change big file\' &&\n'> <'\n'> <'\t\tgit checkout -q other &&\n'> <'\t\t: >newfile &&\n'> <'\t\tgit add newfile &&\n'> 
                    <'\t\tgit commit -q -m \'add small file\' &&\n'> <'\n'> <'\t\tgit cherry-pick master >/dev/null 2>&1\n'> <'\t'>
                  )
                }
              ]
              redirects: []
              do_fork: T
            )
            (command.Simple
              blame_tok: <test_debug>
              more_env: []
              words: [
                {<test_debug>}
                {(DQ <'\n'> <'\t\trun git diff master^'> <Id.Lit_BadBackslash '\\'> <'!\n'> <'\t'>)}
              ]
              redirects: []
              do_fork: T
            )
            (command.Simple
              blame_tok: <test_expect_success>
              more_env: []
              words: [
                {<test_expect_success>}
                {($ Id.VSub_DollarName pr)}
                {(SQ <'setup attributes'>)}
                {(DQ <'\n'> <'\t\techo \'file binary\' >.gitattributes\n'> <'\t'>)}
              ]
              redirects: []
              do_fork: T
            )
            (command.Simple
              blame_tok: <test_debug>
              more_env: []
              words: [
                {<test_debug>}
                {
                  (DQ <'\n'> <'\t\trun git format-patch --stdout master &&\n'> 
                    <'\t\trun git format-patch --stdout --ignore-if-in-upstream master\n'> <'\t'>
                  )
                }
              ]
              redirects: []
              do_fork: T
            )
            (command.Simple
              blame_tok: <test_expect_success>
              more_env: []
              words: [
                {<test_expect_success>}
                {($ Id.VSub_DollarName pr)}
                {(SQ <'detect upstream patch'>)}
                {
                  (SQ <'\n'> <'\t\tgit checkout -q master &&\n'> <'\t\tscramble file &&\n'> 
                    <'\t\tgit add file &&\n'> <'\t\tgit commit -q -m "change big file again" &&\n'> <'\t\tgit checkout -q other^{} &&\n'> 
                    <'\t\tgit rebase master &&\n'> <'\t\ttest_must_fail test -n "$(git rev-list master...HEAD~)"\n'> <'\t'>
                  )
                }
              ]
              redirects: []
              do_fork: T
            )
            (command.Simple
              blame_tok: <test_expect_success>
              more_env: []
              words: [
                {<test_expect_success>}
                {($ Id.VSub_DollarName pr)}
                {(SQ <'do not drop patch'>)}
                {
                  (SQ <'\n'> <'\t\tgit branch -f squashed master &&\n'> 
                    <'\t\tgit checkout -q -f squashed &&\n'> <'\t\tgit reset -q --soft HEAD~2 &&\n'> <'\t\tgit commit -q -m squashed &&\n'> 
                    <'\t\tgit checkout -q other^{} &&\n'> <'\t\ttest_must_fail git rebase squashed &&\n'> <'\t\trm -rf .git/rebase-apply\n'> <'\t'>
                  )
                }
              ]
              redirects: []
              do_fork: T
            )
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.Simple
      blame_tok: <do_tests>
      more_env: []
      words: [{<do_tests>} {<500>}]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <do_tests>
      more_env: []
      words: [{<do_tests>} {<50000>} {<EXPENSIVE>}]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_done>
      more_env: []
      words: [{<test_done>}]
      redirects: []
      do_fork: T
    )
  ]
)