(command.CommandList
  children: [
    (command.ShAssignment
      left: <Id.Lit_VarLike 'bases='>
      pairs: [
        (AssignPair
          left: <Id.Lit_VarLike 'bases='>
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'bases='> name:bases)
          op: assign_op.Equal
          rhs: (rhs_word__Empty)
        )
        (AssignPair
          left: <Id.Lit_VarLike 'head='>
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'head='> name:head)
          op: assign_op.Equal
          rhs: (rhs_word__Empty)
        )
        (AssignPair
          left: <Id.Lit_VarLike 'remotes='>
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'remotes='> name:remotes)
          op: assign_op.Equal
          rhs: (rhs_word__Empty)
        )
        (AssignPair
          left: <Id.Lit_VarLike 'sep_seen='>
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'sep_seen='> name:sep_seen)
          op: assign_op.Equal
          rhs: (rhs_word__Empty)
        )
      ]
      redirects: []
    )
    (command.ForEach
      keyword: <Id.KW_For for>
      iter_names: [arg]
      iterable: (for_iter__Args)
      body: 
        (command.DoGroup
          left: <Id.KW_Do do>
          children: [
            (command.Case
              case_kw: <Id.KW_Case case>
              to_match: 
                (case_arg.Word
                  w: 
                    {
                      (DQ <','> ($ Id.VSub_DollarName sep_seen) <','> ($ Id.VSub_DollarName head) <','> 
                        ($ Id.VSub_DollarName arg) <','>
                      )
                    }
                )
              arms_start: <Id.KW_In in>
              arms: [
                (CaseArm
                  left: <Id.Lit_Star '*'>
                  pattern: 
                    (pat.Words
                      words: [{<Id.Lit_Star '*'> <Id.Lit_Comma ','> <--> <Id.Lit_Comma ','>}]
                    )
                  middle: <Id.Right_CasePat _>
                  action: [
                    (command.ShAssignment
                      left: <Id.Lit_VarLike 'sep_seen='>
                      pairs: [
                        (AssignPair
                          left: <Id.Lit_VarLike 'sep_seen='>
                          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'sep_seen='> name:sep_seen)
                          op: assign_op.Equal
                          rhs: {<yes>}
                        )
                      ]
                      redirects: []
                    )
                  ]
                  right: <Id.Op_DSemi _>
                )
                (CaseArm
                  left: <Id.Lit_Comma ','>
                  pattern: 
                    (pat.Words
                      words: [
                        {<Id.Lit_Comma ','> <yes> <Id.Lit_Comma ','> <Id.Lit_Comma ','> 
                          <Id.Lit_Star '*'>
                        }
                      ]
                    )
                  middle: <Id.Right_CasePat _>
                  action: [
                    (command.ShAssignment
                      left: <Id.Lit_VarLike 'head='>
                      pairs: [
                        (AssignPair
                          left: <Id.Lit_VarLike 'head='>
                          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'head='> name:head)
                          op: assign_op.Equal
                          rhs: {($ Id.VSub_DollarName arg)}
                        )
                      ]
                      redirects: []
                    )
                  ]
                  right: <Id.Op_DSemi _>
                )
                (CaseArm
                  left: <Id.Lit_Comma ','>
                  pattern: 
                    (pat.Words
                      words: [{<Id.Lit_Comma ','> <yes> <Id.Lit_Comma ','> <Id.Lit_Star '*'>}]
                    )
                  middle: <Id.Right_CasePat _>
                  action: [
                    (command.ShAssignment
                      left: <Id.Lit_VarLike 'remotes='>
                      pairs: [
                        (AssignPair
                          left: <Id.Lit_VarLike 'remotes='>
                          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'remotes='> name:remotes)
                          op: assign_op.Equal
                          rhs: {(DQ ($ Id.VSub_DollarName remotes) ($ Id.VSub_DollarName arg) <' '>)}
                        )
                      ]
                      redirects: []
                    )
                  ]
                  right: <Id.Op_DSemi _>
                )
                (CaseArm
                  left: <Id.Lit_Star '*'>
                  pattern: (pat.Words words:[{<Id.Lit_Star '*'>}])
                  middle: <Id.Right_CasePat _>
                  action: [
                    (command.ShAssignment
                      left: <Id.Lit_VarLike 'bases='>
                      pairs: [
                        (AssignPair
                          left: <Id.Lit_VarLike 'bases='>
                          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'bases='> name:bases)
                          op: assign_op.Equal
                          rhs: {(DQ ($ Id.VSub_DollarName bases) ($ Id.VSub_DollarName arg) <' '>)}
                        )
                      ]
                      redirects: []
                    )
                  ]
                  right: <Id.Op_DSemi _>
                )
              ]
              arms_end: <Id.KW_Esac esac>
              redirects: []
            )
          ]
          right: <Id.KW_Done done>
        )
      redirects: []
    )
    (command.Case
      case_kw: <Id.KW_Case case>
      to_match: (case_arg.Word w:{(DQ ($ Id.VSub_DollarName remotes))})
      arms_start: <Id.KW_In in>
      arms: [
        (CaseArm
          left: <Id.Lit_QMark '?'>
          pattern: 
            (pat.Words
              words: [
                {<Id.Lit_QMark '?'> <Id.Lit_Star '*'> (SQ <' '>) <Id.Lit_QMark '?'> <Id.Lit_Star '*'>}
              ]
            )
          middle: <Id.Right_CasePat _>
          action: [(command.ControlFlow keyword:<Id.ControlFlow_Exit exit> arg_word:{<2>})]
          right: <Id.Op_DSemi _>
        )
      ]
      arms_end: <Id.KW_Esac esac>
      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>} {(SQ )} {<Id.Lit_Equals '='>} {(DQ ($ Id.VSub_DollarName bases))}]
                  redirects: []
                  do_fork: T
                )
              ]
            )
          then_kw: <Id.KW_Then then>
          action: [(command.ControlFlow keyword:<Id.ControlFlow_Exit exit> arg_word:{<2>})]
          spids: [152 165]
        )
      ]
      else_action: []
      fi_kw: <Id.KW_Fi fi>
      redirects: []
    )
    (command.Simple
      blame_tok: <git>
      more_env: []
      words: [{<git>} {<update-index>} {<-q>} {<--refresh>}]
      redirects: []
      do_fork: T
    )
    (command.AndOr
      children: [
        (command.Simple
          blame_tok: <git>
          more_env: []
          words: [
            {<git>}
            {<read-tree>}
            {<-u>}
            {<-m>}
            {<--aggressive>}
            {($ Id.VSub_DollarName bases)}
            {($ Id.VSub_DollarName head)}
            {($ Id.VSub_DollarName remotes)}
          ]
          redirects: []
          do_fork: T
        )
        (command.ControlFlow keyword:<Id.ControlFlow_Exit exit> arg_word:{<2>})
      ]
      ops: [<Id.Op_DPipe _>]
    )
    (command.Simple
      blame_tok: <echo>
      more_env: []
      words: [{<echo>} {(DQ <'Trying simple merge.'>)}]
      redirects: []
      do_fork: T
    )
    (command.If
      if_kw: <Id.KW_If if>
      arms: [
        (IfArm
          keyword: <Id.KW_If if>
          cond: 
            (condition.Shell
              commands: [
                (command.ShAssignment
                  left: <Id.Lit_VarLike 'result_tree='>
                  pairs: [
                    (AssignPair
                      left: <Id.Lit_VarLike 'result_tree='>
                      lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'result_tree='> name:result_tree)
                      op: assign_op.Equal
                      rhs: 
                        {
                          (CommandSub
                            left_token: <Id.Left_DollarParen '$('>
                            child: 
                              (command.Simple
                                blame_tok: <git>
                                more_env: []
                                words: [{<git>} {<write-tree>}]
                                redirects: [
                                  (Redir
                                    op: <Id.Redir_Great '2>'>
                                    loc: (redir_loc.Fd fd:2)
                                    arg: {<'/dev/null'>}
                                  )
                                ]
                                do_fork: T
                              )
                            right: <Id.Eof_RParen _>
                          )
                        }
                    )
                  ]
                  redirects: []
                )
              ]
            )
          then_kw: <Id.KW_Then then>
          action: [(command.ControlFlow keyword:<Id.ControlFlow_Exit exit> arg_word:{<0>})]
          spids: [211 223]
        )
      ]
      else_kw: <Id.KW_Else else>
      else_action: [
        (command.Simple
          blame_tok: <echo>
          more_env: []
          words: [{<echo>} {(DQ <'Simple merge failed, trying Automatic merge.'>)}]
          redirects: []
          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: <git-merge-index>
                      more_env: []
                      words: [{<git-merge-index>} {<-o>} {<git-merge-one-file>} {<-a>}]
                      redirects: []
                      do_fork: T
                    )
                  ]
                )
              then_kw: <Id.KW_Then then>
              action: [(command.ControlFlow keyword:<Id.ControlFlow_Exit exit> arg_word:{<0>})]
              spids: [240 251]
            )
          ]
          else_kw: <Id.KW_Else else>
          else_action: [(command.ControlFlow keyword:<Id.ControlFlow_Exit exit> arg_word:{<1>})]
          fi_kw: <Id.KW_Fi fi>
          redirects: []
        )
      ]
      fi_kw: <Id.KW_Fi fi>
      redirects: []
    )
  ]
)