(command.CommandList
  children: [
    (C {(Id.Lit_Other ':')} {(Included)} {(from)} {(t1000-read-tree-m-3way.sh)} {(and)} {(others)})
    (C {(mkdir)} {(Z)})
    (command.ForEach
      iter_name: a
      iter_words: [{(N)} {(D)} {(M)}]
      do_arg_iter: F
      body: 
        (command.DoGroup
          children: [
            (command.ForEach
              iter_name: b
              iter_words: [{(N)} {(D)} {(M)}]
              do_arg_iter: F
              body: 
                (command.DoGroup
                  children: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:p)
                          op: assign_op.Equal
                          rhs: {($ Id.VSub_DollarName '$a') ($ Id.VSub_DollarName '$b')}
                          spids: [50]
                        )
                      ]
                    )
                    (command.Simple
                      words: [
                        {(echo)}
                        {(This)}
                        {(is)}
                        {($ Id.VSub_DollarName '$p')}
                        {(from)}
                        {(the)}
                        {(original)}
                        {(tree.)}
                      ]
                      redirects: [
                        (redir.Redir
                          op: (Token id:Id.Redir_Great val:'>' span_id:71)
                          fd: -1
                          arg_word: {($ Id.VSub_DollarName '$p')}
                        )
                      ]
                    )
                    (command.Simple
                      words: [
                        {(echo)}
                        {(This)}
                        {(is)}
                        {(Z/) ($ Id.VSub_DollarName '$p')}
                        {(from)}
                        {(the)}
                        {(original)}
                        {(tree.)}
                      ]
                      redirects: [
                        (redir.Redir
                          op: (Token id:Id.Redir_Great val:'>' span_id:92)
                          fd: -1
                          arg_word: {(Z/) ($ Id.VSub_DollarName '$p')}
                        )
                      ]
                    )
                    (C {(test_expect_success)} 
                      {
                        (DQ ('adding test file ') ($ Id.VSub_DollarName '$p') (' and Z/') 
                          ($ Id.VSub_DollarName '$p')
                        )
                      } 
                      {
                        (SQ (Token id:Id.Lit_Chars val:'git update-index --add $p &&\n' span_id:111) 
                          (Token
                            id: Id.Lit_Chars
                            val: '\t    git update-index --add Z/$p'
                            span_id: 112
                          )
                        )
                      }
                    )
                  ]
                )
            )
          ]
        )
    )
    (command.Simple
      words: [{(echo)} {(This)} {(is)} {(SS)} {(from)} {(the)} {(original)} {(tree.)}]
      redirects: [(redir.Redir op:(Token id:Id.Redir_Great val:'>' span_id:136) fd:-1 arg_word:{(SS)})]
    )
    (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'adding test file SS' span_id:144))} 
      {(SQ (Token id:Id.Lit_Chars val:'git update-index --add SS' span_id:150))}
    )
    (command.Simple
      words: [{(cat)}]
      redirects: [
        (redir.Redir op:(Token id:Id.Redir_Great val:'>' span_id:155) fd:-1 arg_word:{(TT)})
        (redir.HereDoc
          op: (Token id:Id.Redir_DLess val:'<<' span_id:158)
          fd: -1
          here_begin: 
            {(word_part.EscapedLiteral token:(Token id:Id.Lit_EscapedChar val:'\\E' span_id:159)) 
              (OF)
            }
          here_end_span_id: 172
          stdin_parts: [
            ('This is a trivial merge sample text.\n')
            ('Branch A is expected to upcase this word, here.\n')
            ('There are some filler lines to avoid diff context\n')
            ('conflicts here,\n')
            ('like this one,\n')
            ('and this one,\n')
            ('and this one is yet another one of them.\n')
            ('At the very end, here comes another line, that is\n')
            ('the word, expected to be upcased by Branch B.\n')
            ('This concludes the trivial merge sample file.\n')
          ]
        )
      ]
    )
    (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'adding test file TT' span_id:178))} 
      {(SQ (Token id:Id.Lit_Chars val:'git update-index --add TT' span_id:184))}
    )
    (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'prepare initial tree' span_id:192))} 
      {(SQ (Token id:Id.Lit_Chars val:'tree_O=$(git write-tree)' span_id:198))}
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:to_remove)
          op: assign_op.Equal
          rhs: 
            {
              (command_sub
                left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:217)
                command_list: 
                  (command.CommandList
                    children: [(C {(echo)} {(D) (Id.Lit_QMark '?')} {(Z/D) (Id.Lit_QMark '?')})]
                  )
              )
            }
          spids: [216]
        )
      ]
    )
    (C {(rm)} {(-f)} {($ Id.VSub_DollarName '$to_remove')})
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'change in branch A (removal)' span_id:238))} {(SQ (Token id:Id.Lit_Chars val:'git update-index --remove $to_remove' span_id:244))}
    )
    (command.ForEach
      iter_name: p
      iter_words: [{(M) (Id.Lit_QMark '?')} {(Z/M) (Id.Lit_QMark '?')}]
      do_arg_iter: F
      body: 
        (command.DoGroup
          children: [
            (command.Simple
              words: [
                {(echo)}
                {(This)}
                {(is)}
                {(modified)}
                {($ Id.VSub_DollarName '$p')}
                {(Id.KW_In in)}
                {(the)}
                {(branch)}
                {(A.)}
              ]
              redirects: [
                (redir.Redir
                  op: (Token id:Id.Redir_Great val:'>' span_id:281)
                  fd: -1
                  arg_word: {($ Id.VSub_DollarName '$p')}
                )
              ]
            )
            (C {(test_expect_success)} 
              {(SQ (Token id:Id.Lit_Chars val:'change in branch A (modification)' span_id:290))} {(DQ ('git update-index ') ($ Id.VSub_DollarName '$p'))}
            )
          ]
        )
    )
    (command.ForEach
      iter_name: p
      iter_words: [{(AN)} {(AA)} {(Z/AN)} {(Z/AA)}]
      do_arg_iter: F
      body: 
        (command.DoGroup
          children: [
            (command.Simple
              words: [
                {(echo)}
                {(This)}
                {(is)}
                {(added)}
                {($ Id.VSub_DollarName '$p')}
                {(Id.KW_In in)}
                {(the)}
                {(branch)}
                {(A.)}
              ]
              redirects: [
                (redir.Redir
                  op: (Token id:Id.Redir_Great val:'>' span_id:338)
                  fd: -1
                  arg_word: {($ Id.VSub_DollarName '$p')}
                )
              ]
            )
            (C {(test_expect_success)} 
              {(SQ (Token id:Id.Lit_Chars val:'change in branch A (addition)' span_id:347))} {(DQ ('git update-index --add ') ($ Id.VSub_DollarName '$p'))}
            )
          ]
        )
    )
    (command.Simple
      words: [{(echo)} {(This)} {(is)} {(SS)} {(from)} {(the)} {(modified)} {(tree.)}]
      redirects: [(redir.Redir op:(Token id:Id.Redir_Great val:'>' span_id:376) fd:-1 arg_word:{(SS)})]
    )
    (command.Simple
      words: [{(echo)} {(This)} {(is)} {(LL)} {(from)} {(the)} {(modified)} {(tree.)}]
      redirects: [(redir.Redir op:(Token id:Id.Redir_Great val:'>' span_id:395) fd:-1 arg_word:{(LL)})]
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'change in branch A (addition)' span_id:403))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'git update-index --add LL &&\n' span_id:409) 
          (Token id:Id.Lit_Chars val:'     git update-index SS' span_id:410)
        )
      }
    )
    (C {(mv)} {(TT)} {(TT-)})
    (command.Simple
      words: [{(sed)} {(-e)} {(SQ (Token id:Id.Lit_Chars val:'/Branch A/s/word/WORD/g' span_id:424))}]
      redirects: [
        (redir.Redir op:(Token id:Id.Redir_Less val:'<' span_id:427) fd:-1 arg_word:{(TT-)})
        (redir.Redir op:(Token id:Id.Redir_Great val:'>' span_id:430) fd:-1 arg_word:{(TT)})
      ]
    )
    (C {(rm)} {(-f)} {(TT-)})
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'change in branch A (edit)' span_id:444))} {(SQ (Token id:Id.Lit_Chars val:'git update-index TT' span_id:450))}
    )
    (C {(mkdir)} {(DF)})
    (command.Simple
      words: [
        {(echo)}
        {(Branch)}
        {(A)}
        {(makes)}
        {(a)}
        {(file)}
        {(at)}
        {(DF/DF) (Id.Lit_Comma ',')}
        {(creating)}
        {(a)}
        {(directory)}
        {(DF.)}
      ]
      redirects: [
        (redir.Redir op:(Token id:Id.Redir_Great val:'>' span_id:483) fd:-1 arg_word:{(DF/DF)})
      ]
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'change in branch A (change file to directory)' span_id:491))} {(SQ (Token id:Id.Lit_Chars val:'git update-index --add DF/DF' span_id:497))}
    )
    (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'recording branch A tree' span_id:506))} 
      {(SQ (Token id:Id.Lit_Chars val:'tree_A=$(git write-tree)' span_id:512))}
    )
    (C {(rm)} {(-rf)} 
      {(Id.Lit_LBracket '[') (NDMASLT) (Id.Lit_RBracket ']') (Id.Lit_LBracket '[') (NDMASLT) 
        (Id.Lit_RBracket ']')
      } {(Z)} {(DF)}
    )
    (C {(mkdir)} {(Z)})
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'reading original tree and checking out' span_id:550))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'git read-tree $tree_O &&\n' span_id:556) 
          (Token id:Id.Lit_Chars val:'     git checkout-index -a' span_id:557)
        )
      }
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:to_remove)
          op: assign_op.Equal
          rhs: 
            {
              (command_sub
                left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:562)
                command_list: 
                  (command.CommandList
                    children: [(C {(echo)} {(Id.Lit_QMark '?') (D)} {(Z/) (Id.Lit_QMark '?') (D)})]
                  )
              )
            }
          spids: [561]
        )
      ]
    )
    (C {(rm)} {(-f)} {($ Id.VSub_DollarName '$to_remove')})
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'change in branch B (removal)' span_id:584))} {(DQ ('git update-index --remove ') ($ Id.VSub_DollarName '$to_remove'))}
    )
    (command.ForEach
      iter_name: p
      iter_words: [{(Id.Lit_QMark '?') (M)} {(Z/) (Id.Lit_QMark '?') (M)}]
      do_arg_iter: F
      body: 
        (command.DoGroup
          children: [
            (command.Simple
              words: [
                {(echo)}
                {(This)}
                {(is)}
                {(modified)}
                {($ Id.VSub_DollarName '$p')}
                {(Id.KW_In in)}
                {(the)}
                {(branch)}
                {(B.)}
              ]
              redirects: [
                (redir.Redir
                  op: (Token id:Id.Redir_Great val:'>' span_id:629)
                  fd: -1
                  arg_word: {($ Id.VSub_DollarName '$p')}
                )
              ]
            )
            (C {(test_expect_success)} 
              {(SQ (Token id:Id.Lit_Chars val:'change in branch B (modification)' span_id:638))} {(DQ ('git update-index ') ($ Id.VSub_DollarName '$p'))}
            )
          ]
        )
    )
    (command.ForEach
      iter_name: p
      iter_words: [{(NA)} {(AA)} {(Z/NA)} {(Z/AA)}]
      do_arg_iter: F
      body: 
        (command.DoGroup
          children: [
            (command.Simple
              words: [
                {(echo)}
                {(This)}
                {(is)}
                {(added)}
                {($ Id.VSub_DollarName '$p')}
                {(Id.KW_In in)}
                {(the)}
                {(branch)}
                {(B.)}
              ]
              redirects: [
                (redir.Redir
                  op: (Token id:Id.Redir_Great val:'>' span_id:686)
                  fd: -1
                  arg_word: {($ Id.VSub_DollarName '$p')}
                )
              ]
            )
            (C {(test_expect_success)} 
              {(SQ (Token id:Id.Lit_Chars val:'change in branch B (addition)' span_id:695))} {(DQ ('git update-index --add ') ($ Id.VSub_DollarName '$p'))}
            )
          ]
        )
    )
    (command.Simple
      words: [{(echo)} {(This)} {(is)} {(SS)} {(from)} {(the)} {(modified)} {(tree.)}]
      redirects: [(redir.Redir op:(Token id:Id.Redir_Great val:'>' span_id:723) fd:-1 arg_word:{(SS)})]
    )
    (command.Simple
      words: [{(echo)} {(This)} {(is)} {(LL)} {(from)} {(the)} {(modified)} {(tree.)}]
      redirects: [(redir.Redir op:(Token id:Id.Redir_Great val:'>' span_id:742) fd:-1 arg_word:{(LL)})]
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'change in branch B (addition and modification)' span_id:750))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'git update-index --add LL &&\n' span_id:756) 
          (Token id:Id.Lit_Chars val:'     git update-index SS' span_id:757)
        )
      }
    )
    (C {(mv)} {(TT)} {(TT-)})
    (command.Simple
      words: [{(sed)} {(-e)} {(SQ (Token id:Id.Lit_Chars val:'/Branch B/s/word/WORD/g' span_id:771))}]
      redirects: [
        (redir.Redir op:(Token id:Id.Redir_Less val:'<' span_id:774) fd:-1 arg_word:{(TT-)})
        (redir.Redir op:(Token id:Id.Redir_Great val:'>' span_id:777) fd:-1 arg_word:{(TT)})
      ]
    )
    (C {(rm)} {(-f)} {(TT-)})
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'change in branch B (modification)' span_id:791))} {(SQ (Token id:Id.Lit_Chars val:'git update-index TT' span_id:797))}
    )
    (command.Simple
      words: [{(echo)} {(Branch)} {(B)} {(makes)} {(a)} {(file)} {(at)} {(DF.)}]
      redirects: [(redir.Redir op:(Token id:Id.Redir_Great val:'>' span_id:817) fd:-1 arg_word:{(DF)})]
    )
    (C {(test_expect_success)} 
      {
        (SQ 
          (Token
            id: Id.Lit_Chars
            val: 'change in branch B (addition of a file to conflict with directory)'
            span_id: 825
          )
        )
      } {(SQ (Token id:Id.Lit_Chars val:'git update-index --add DF' span_id:831))}
    )
    (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'recording branch B tree' span_id:840))} 
      {(SQ (Token id:Id.Lit_Chars val:'tree_B=$(git write-tree)' span_id:846))}
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'keep contents of 3 trees for easy access' span_id:855))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'rm -f .git/index &&\n' span_id:861) 
          (Token id:Id.Lit_Chars val:'     git read-tree $tree_O &&\n' span_id:862) (Token id:Id.Lit_Chars val:'     mkdir .orig-O &&\n' span_id:863) 
          (Token
            id: Id.Lit_Chars
            val: '     git checkout-index --prefix=.orig-O/ -f -q -a &&\n'
            span_id: 864
          ) (Token id:Id.Lit_Chars val:'     rm -f .git/index &&\n' span_id:865) 
          (Token id:Id.Lit_Chars val:'     git read-tree $tree_A &&\n' span_id:866) (Token id:Id.Lit_Chars val:'     mkdir .orig-A &&\n' span_id:867) 
          (Token
            id: Id.Lit_Chars
            val: '     git checkout-index --prefix=.orig-A/ -f -q -a &&\n'
            span_id: 868
          ) (Token id:Id.Lit_Chars val:'     rm -f .git/index &&\n' span_id:869) 
          (Token id:Id.Lit_Chars val:'     git read-tree $tree_B &&\n' span_id:870) (Token id:Id.Lit_Chars val:'     mkdir .orig-B &&\n' span_id:871) 
          (Token
            id: Id.Lit_Chars
            val: '     git checkout-index --prefix=.orig-B/ -f -q -a'
            span_id: 872
          )
        )
      }
    )
  ]
)