(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_EDITOR, core.editor, and stuff'>)}
        )
      ]
      redirects: []
    )
    (command.Simple
      blame_tok: <.>
      more_env: []
      words: [{<.>} {<'./test-lib.sh'>}]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <unset>
      more_env: []
      words: [{<unset>} {<EDITOR>} {<VISUAL>} {<GIT_EDITOR>}]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'determine default editor'>)}
        {
          (SQ <'\n'> <'\n'> <'\tvi=$(TERM=vt100 git var GIT_EDITOR) &&\n'> <'\ttest -n "$vi"\n'> <'\n'>)
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.If
      if_kw: <Id.KW_If if>
      arms: [
        (IfArm
          keyword: <Id.KW_If if>
          cond: 
            (condition.Shell
              commands: [
                (command.Pipeline
                  negated: <Id.KW_Bang '!'>
                  children: [
                    (command.Simple
                      blame_tok: <expr>
                      more_env: []
                      words: [
                        {<expr>}
                        {(DQ ($ Id.VSub_DollarName vi))}
                        {<Id.Lit_Colon ':'>}
                        {(SQ <'[a-z]*$'>)}
                      ]
                      redirects: [
                        (Redir
                          op: <Id.Redir_Great '>'>
                          loc: (redir_loc.Fd fd:1)
                          arg: {<'/dev/null'>}
                        )
                      ]
                      do_fork: T
                    )
                  ]
                  ops: []
                )
              ]
            )
          then_kw: <Id.KW_Then then>
          action: [
            (command.ShAssignment
              left: <Id.Lit_VarLike 'vi='>
              pairs: [
                (AssignPair
                  left: <Id.Lit_VarLike 'vi='>
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'vi='> name:vi)
                  op: assign_op.Equal
                  rhs: (rhs_word__Empty)
                )
              ]
              redirects: []
            )
          ]
          spids: [39 58]
        )
      ]
      else_action: []
      fi_kw: <Id.KW_Fi fi>
      redirects: []
    )
    (command.ForEach
      keyword: <Id.KW_For for>
      iter_names: [i]
      iterable: 
        (for_iter.Words
          words: [{<GIT_EDITOR>} {<core_editor>} {<EDITOR>} {<VISUAL>} {($ Id.VSub_DollarName vi)}]
        )
      body: 
        (command.DoGroup
          left: <Id.KW_Do do>
          children: [
            (command.Simple
              blame_tok: <cat>
              more_env: []
              words: [{<cat>}]
              redirects: [
                (Redir
                  op: <Id.Redir_Great '>'>
                  loc: (redir_loc.Fd fd:1)
                  arg: {<e-> ($ Id.VSub_DollarName i) <.sh>}
                )
                (Redir
                  op: <Id.Redir_DLessDash '<<-'>
                  loc: (redir_loc.Fd fd:0)
                  arg: 
                    (redir_param.HereDoc
                      here_begin: {<EOF>}
                      here_end_tok: <Id.Undefined_Tok ''>
                      stdin_parts: [
                        <'#!'>
                        ($ Id.VSub_DollarName SHELL_PATH)
                        <'\n'>
                        <'echo '>
                        <Id.Right_DoubleQuote '"'>
                        <'Edited by '>
                        ($ Id.VSub_DollarName i)
                        <Id.Right_DoubleQuote '"'>
                        <' >'>
                        <Id.Right_DoubleQuote '"'>
                        (word_part.EscapedLiteral
                          token: <Id.Lit_EscapedChar '\\$'>
                          ch: '$'
                        )
                        <1>
                        <Id.Right_DoubleQuote '"'>
                        <'\n'>
                      ]
                    )
                )
              ]
              do_fork: T
            )
            (command.Simple
              blame_tok: <chmod>
              more_env: []
              words: [{<chmod>} {<Id.Lit_Other '+'> <x>} {<e-> ($ Id.VSub_DollarName i) <.sh>}]
              redirects: []
              do_fork: T
            )
          ]
          right: <Id.KW_Done done>
        )
      redirects: []
    )
    (command.If
      if_kw: <Id.KW_If if>
      arms: [
        (IfArm
          keyword: <Id.KW_If if>
          cond: 
            (condition.Shell
              commands: [
                (command.Pipeline
                  negated: <Id.KW_Bang '!'>
                  children: [
                    (command.Simple
                      blame_tok: <test>
                      more_env: []
                      words: [{<test>} {<-z>} {(DQ ($ Id.VSub_DollarName vi))}]
                      redirects: []
                      do_fork: T
                    )
                  ]
                  ops: []
                )
              ]
            )
          then_kw: <Id.KW_Then then>
          action: [
            (command.Simple
              blame_tok: <mv>
              more_env: []
              words: [{<mv>} {<e-> ($ Id.VSub_DollarName vi) <.sh>} {($ Id.VSub_DollarName vi)}]
              redirects: []
              do_fork: T
            )
          ]
          spids: [124 136]
        )
      ]
      else_action: []
      fi_kw: <Id.KW_Fi fi>
      redirects: []
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {<setup>}
        {
          (SQ <'\n'> <'\n'> <'\tmsg="Hand-edited" &&\n'> <'\ttest_commit "$msg" &&\n'> 
            <'\techo "$msg" >expect &&\n'> <'\tgit show -s --format=%s > actual &&\n'> <'\ttest_cmp actual expect\n'> <'\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.ShAssignment
      left: <Id.Lit_VarLike 'TERM='>
      pairs: [
        (AssignPair
          left: <Id.Lit_VarLike 'TERM='>
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'TERM='> name:TERM)
          op: assign_op.Equal
          rhs: {<dumb>}
        )
      ]
      redirects: []
    )
    (command.Simple
      blame_tok: <export>
      more_env: []
      words: [{<export>} {<TERM>}]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'dumb should error out when falling back on vi'>)}
        {
          (SQ <'\n'> <'\n'> <'\tif git commit --amend\n'> <'\tthen\n'> <'\t\techo "Oops?"\n'> 
            <'\t\tfalse\n'> <'\telse\n'> <'\t\t: happy\n'> <'\tfi\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'dumb should prefer EDITOR to VISUAL'>)}
        {
          (SQ <'\n'> <'\n'> <'\tEDITOR=./e-EDITOR.sh &&\n'> <'\tVISUAL=./e-VISUAL.sh &&\n'> 
            <'\texport EDITOR VISUAL &&\n'> <'\tgit commit --amend &&\n'> <'\ttest "$(git show -s --format=%s)" = "Edited by EDITOR"\n'> <'\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.ShAssignment
      left: <Id.Lit_VarLike 'TERM='>
      pairs: [
        (AssignPair
          left: <Id.Lit_VarLike 'TERM='>
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'TERM='> name:TERM)
          op: assign_op.Equal
          rhs: {<vt100>}
        )
      ]
      redirects: []
    )
    (command.Simple
      blame_tok: <export>
      more_env: []
      words: [{<export>} {<TERM>}]
      redirects: []
      do_fork: T
    )
    (command.ForEach
      keyword: <Id.KW_For for>
      iter_names: [i]
      iterable: 
        (for_iter.Words
          words: [{($ Id.VSub_DollarName vi)} {<EDITOR>} {<VISUAL>} {<core_editor>} {<GIT_EDITOR>}]
        )
      body: 
        (command.DoGroup
          left: <Id.KW_Do do>
          children: [
            (command.Simple
              blame_tok: <echo>
              more_env: []
              words: [{<echo>} {(DQ <'Edited by '> ($ Id.VSub_DollarName i))}]
              redirects: [(Redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expect>})]
              do_fork: T
            )
            (command.Simple
              blame_tok: <unset>
              more_env: []
              words: [{<unset>} {<EDITOR>} {<VISUAL>} {<GIT_EDITOR>}]
              redirects: []
              do_fork: T
            )
            (command.Simple
              blame_tok: <git>
              more_env: []
              words: [{<git>} {<config>} {<--unset-all>} {<core.editor>}]
              redirects: []
              do_fork: T
            )
            (command.Case
              case_kw: <Id.KW_Case case>
              to_match: (case_arg.Word w:{(DQ ($ Id.VSub_DollarName i))})
              arms_start: <Id.KW_In in>
              arms: [
                (CaseArm
                  left: <core_editor>
                  pattern: (pat.Words words:[{<core_editor>}])
                  middle: <Id.Right_CasePat _>
                  action: [
                    (command.Simple
                      blame_tok: <git>
                      more_env: []
                      words: [{<git>} {<config>} {<core.editor>} {<'./e-core_editor.sh'>}]
                      redirects: []
                      do_fork: T
                    )
                  ]
                  right: <Id.Op_DSemi _>
                )
                (CaseArm
                  left: <Id.Lit_LBracket '['>
                  pattern: 
                    (pat.Words
                      words: [{<Id.Lit_LBracket '['> <A-Z> <Id.Lit_RBracket ']'> <Id.Lit_Star '*'>}]
                    )
                  middle: <Id.Right_CasePat _>
                  action: [
                    (command.Simple
                      blame_tok: <eval>
                      more_env: []
                      words: [
                        {<eval>}
                        {(DQ ($ Id.VSub_DollarName i) <'=./e-'> ($ Id.VSub_DollarName i) <.sh>)}
                      ]
                      redirects: []
                      do_fork: T
                    )
                    (command.Simple
                      blame_tok: <export>
                      more_env: []
                      words: [{<export>} {($ Id.VSub_DollarName i)}]
                      redirects: []
                      do_fork: T
                    )
                  ]
                  right: <Id.Op_DSemi _>
                )
              ]
              arms_end: <Id.KW_Esac esac>
              redirects: []
            )
            (command.Simple
              blame_tok: <test_expect_success>
              more_env: []
              words: [
                {<test_expect_success>}
                {(DQ <'Using '> ($ Id.VSub_DollarName i))}
                {
                  (SQ <'\n'> <'\t\tgit --exec-path=. commit --amend &&\n'> 
                    <'\t\tgit show -s --pretty=oneline |\n'> <'\t\tsed -e "s/^[0-9a-f]* //" >actual &&\n'> <'\t\ttest_cmp actual expect\n'> <'\t'>
                  )
                }
              ]
              redirects: []
              do_fork: T
            )
          ]
          right: <Id.KW_Done done>
        )
      redirects: []
    )
    (command.Simple
      blame_tok: <unset>
      more_env: []
      words: [{<unset>} {<EDITOR>} {<VISUAL>} {<GIT_EDITOR>}]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <git>
      more_env: []
      words: [{<git>} {<config>} {<--unset-all>} {<core.editor>}]
      redirects: []
      do_fork: T
    )
    (command.ForEach
      keyword: <Id.KW_For for>
      iter_names: [i]
      iterable: 
        (for_iter.Words
          words: [{($ Id.VSub_DollarName vi)} {<EDITOR>} {<VISUAL>} {<core_editor>} {<GIT_EDITOR>}]
        )
      body: 
        (command.DoGroup
          left: <Id.KW_Do do>
          children: [
            (command.Simple
              blame_tok: <echo>
              more_env: []
              words: [{<echo>} {(DQ <'Edited by '> ($ Id.VSub_DollarName i))}]
              redirects: [(Redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expect>})]
              do_fork: T
            )
            (command.Case
              case_kw: <Id.KW_Case case>
              to_match: (case_arg.Word w:{(DQ ($ Id.VSub_DollarName i))})
              arms_start: <Id.KW_In in>
              arms: [
                (CaseArm
                  left: <core_editor>
                  pattern: (pat.Words words:[{<core_editor>}])
                  middle: <Id.Right_CasePat _>
                  action: [
                    (command.Simple
                      blame_tok: <git>
                      more_env: []
                      words: [{<git>} {<config>} {<core.editor>} {<'./e-core_editor.sh'>}]
                      redirects: []
                      do_fork: T
                    )
                  ]
                  right: <Id.Op_DSemi _>
                )
                (CaseArm
                  left: <Id.Lit_LBracket '['>
                  pattern: 
                    (pat.Words
                      words: [{<Id.Lit_LBracket '['> <A-Z> <Id.Lit_RBracket ']'> <Id.Lit_Star '*'>}]
                    )
                  middle: <Id.Right_CasePat _>
                  action: [
                    (command.Simple
                      blame_tok: <eval>
                      more_env: []
                      words: [
                        {<eval>}
                        {(DQ ($ Id.VSub_DollarName i) <'=./e-'> ($ Id.VSub_DollarName i) <.sh>)}
                      ]
                      redirects: []
                      do_fork: T
                    )
                    (command.Simple
                      blame_tok: <export>
                      more_env: []
                      words: [{<export>} {($ Id.VSub_DollarName i)}]
                      redirects: []
                      do_fork: T
                    )
                  ]
                  right: <Id.Op_DSemi _>
                )
              ]
              arms_end: <Id.KW_Esac esac>
              redirects: []
            )
            (command.Simple
              blame_tok: <test_expect_success>
              more_env: []
              words: [
                {<test_expect_success>}
                {(DQ <'Using '> ($ Id.VSub_DollarName i) <' (override)'>)}
                {
                  (SQ <'\n'> <'\t\tgit --exec-path=. commit --amend &&\n'> 
                    <'\t\tgit show -s --pretty=oneline |\n'> <'\t\tsed -e "s/^[0-9a-f]* //" >actual &&\n'> <'\t\ttest_cmp actual expect\n'> <'\t'>
                  )
                }
              ]
              redirects: []
              do_fork: T
            )
          ]
          right: <Id.KW_Done done>
        )
      redirects: []
    )
    (command.If
      if_kw: <Id.KW_If if>
      arms: [
        (IfArm
          keyword: <Id.KW_If if>
          cond: 
            (condition.Shell
              commands: [
                (command.Simple
                  blame_tok: <echo>
                  more_env: []
                  words: [{<echo>} {(SQ <'echo space > "$1"'>)}]
                  redirects: [
                    (Redir
                      op: <Id.Redir_Great '>'>
                      loc: (redir_loc.Fd fd:1)
                      arg: {(DQ <'e space.sh'>)}
                    )
                  ]
                  do_fork: T
                )
              ]
            )
          then_kw: <Id.KW_Then then>
          action: [
            (command.Simple
              blame_tok: <test_set_prereq>
              more_env: []
              words: [{<test_set_prereq>} {<SPACES_IN_FILENAMES>}]
              redirects: []
              do_fork: T
            )
          ]
          spids: [456 470]
        )
      ]
      else_action: []
      fi_kw: <Id.KW_Fi fi>
      redirects: []
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {<SPACES_IN_FILENAMES>}
        {(SQ <'editor with a space'>)}
        {
          (SQ <'\n'> <'\n'> <'\tchmod a+x "e space.sh" &&\n'> 
            <'\tGIT_EDITOR="./e\\ space.sh" git commit --amend &&\n'> <'\ttest space = "$(git show -s --pretty=format:%s)"\n'> <'\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <unset>
      more_env: []
      words: [{<unset>} {<GIT_EDITOR>}]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {<SPACES_IN_FILENAMES>}
        {(SQ <'core.editor with a space'>)}
        {
          (SQ <'\n'> <'\n'> <'\tgit config core.editor \\"./e\\ space.sh\\" &&\n'> 
            <'\tgit commit --amend &&\n'> <'\ttest space = "$(git show -s --pretty=format:%s)"\n'> <'\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_done>
      more_env: []
      words: [{<test_done>}]
      redirects: []
      do_fork: T
    )
  ]
)