(command.CommandList
  children: [
    (C {<Id.Lit_Colon ':'>} {<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
                          op: <Id.Redir_Great '>'>
                          loc: (redir_loc.Fd fd:1)
                          arg: {($ Id.VSub_DollarName '$p')}
                        )
                      ]
                      do_fork: T
                    )
                    (command.Simple
                      words: [
                        {<echo>}
                        {<This>}
                        {<is>}
                        {<'Z/'> ($ Id.VSub_DollarName '$p')}
                        {<from>}
                        {<the>}
                        {<original>}
                        {<tree.>}
                      ]
                      redirects: [
                        (redir
                          op: <Id.Redir_Great '>'>
                          loc: (redir_loc.Fd fd:1)
                          arg: {<'Z/'> ($ Id.VSub_DollarName '$p')}
                        )
                      ]
                      do_fork: T
                    )
                    (C {<test_expect_success>} 
                      {
                        (DQ <'adding test file '> ($ Id.VSub_DollarName '$p') <' and Z/'> 
                          ($ Id.VSub_DollarName '$p')
                        )
                      } {(SQ <'git update-index --add $p &&\n'> <'\t    git update-index --add Z/$p'>)}
                    )
                  ]
                )
            )
          ]
        )
    )
    (command.Simple
      words: [{<echo>} {<This>} {<is>} {<SS>} {<from>} {<the>} {<original>} {<tree.>}]
      redirects: [(redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<SS>})]
      do_fork: T
    )
    (C {<test_expect_success>} {(SQ <'adding test file SS'>)} {(SQ <'git update-index --add SS'>)})
    (command.Simple
      words: [{<cat>}]
      redirects: [
        (redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<TT>})
        (redir
          op: <Id.Redir_DLess '<<'>
          loc: (redir_loc.Fd fd:0)
          arg: 
            (redir_param.MultiLine
              here_begin: {(word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\E'>) <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'>
              ]
            )
        )
      ]
      do_fork: T
    )
    (C {<test_expect_success>} {(SQ <'adding test file TT'>)} {(SQ <'git update-index --add TT'>)})
    (C {<test_expect_success>} {(SQ <'prepare initial tree'>)} {(SQ <'tree_O=$(git write-tree)'>)})
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:to_remove)
          op: assign_op.Equal
          rhs: 
            {
              (command_sub
                left_token: <Id.Left_DollarParen '$('>
                child: (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 <'change in branch A (removal)'>)} 
      {(SQ <'git update-index --remove $to_remove'>)}
    )
    (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
                  op: <Id.Redir_Great '>'>
                  loc: (redir_loc.Fd fd:1)
                  arg: {($ Id.VSub_DollarName '$p')}
                )
              ]
              do_fork: T
            )
            (C {<test_expect_success>} {(SQ <'change in branch A (modification)'>)} 
              {(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
                  op: <Id.Redir_Great '>'>
                  loc: (redir_loc.Fd fd:1)
                  arg: {($ Id.VSub_DollarName '$p')}
                )
              ]
              do_fork: T
            )
            (C {<test_expect_success>} {(SQ <'change in branch A (addition)'>)} 
              {(DQ <'git update-index --add '> ($ Id.VSub_DollarName '$p'))}
            )
          ]
        )
    )
    (command.Simple
      words: [{<echo>} {<This>} {<is>} {<SS>} {<from>} {<the>} {<modified>} {<tree.>}]
      redirects: [(redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<SS>})]
      do_fork: T
    )
    (command.Simple
      words: [{<echo>} {<This>} {<is>} {<LL>} {<from>} {<the>} {<modified>} {<tree.>}]
      redirects: [(redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<LL>})]
      do_fork: T
    )
    (C {<test_expect_success>} {(SQ <'change in branch A (addition)'>)} 
      {(SQ <'git update-index --add LL &&\n'> <'     git update-index SS'>)}
    )
    (C {<mv>} {<TT>} {<TT->})
    (command.Simple
      words: [{<sed>} {<-e>} {(SQ <'/Branch A/s/word/WORD/g'>)}]
      redirects: [
        (redir op:<Id.Redir_Less '<'> loc:(redir_loc.Fd fd:0) arg:{<TT->})
        (redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<TT>})
      ]
      do_fork: T
    )
    (C {<rm>} {<-f>} {<TT->})
    (C {<test_expect_success>} {(SQ <'change in branch A (edit)'>)} {(SQ <'git update-index TT'>)})
    (C {<mkdir>} {<DF>})
    (command.Simple
      words: [
        {<echo>}
        {<Branch>}
        {<A>}
        {<makes>}
        {<a>}
        {<file>}
        {<at>}
        {<'DF/DF'> <Id.Lit_Comma ','>}
        {<creating>}
        {<a>}
        {<directory>}
        {<DF.>}
      ]
      redirects: [(redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<'DF/DF'>})]
      do_fork: T
    )
    (C {<test_expect_success>} {(SQ <'change in branch A (change file to directory)'>)} 
      {(SQ <'git update-index --add DF/DF'>)}
    )
    (C {<test_expect_success>} {(SQ <'recording branch A tree'>)} {(SQ <'tree_A=$(git write-tree)'>)})
    (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 <'reading original tree and checking out'>)} 
      {(SQ <'git read-tree $tree_O &&\n'> <'     git checkout-index -a'>)}
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:to_remove)
          op: assign_op.Equal
          rhs: 
            {
              (command_sub
                left_token: <Id.Left_DollarParen '$('>
                child: (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 <'change in branch B (removal)'>)} 
      {(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
                  op: <Id.Redir_Great '>'>
                  loc: (redir_loc.Fd fd:1)
                  arg: {($ Id.VSub_DollarName '$p')}
                )
              ]
              do_fork: T
            )
            (C {<test_expect_success>} {(SQ <'change in branch B (modification)'>)} 
              {(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
                  op: <Id.Redir_Great '>'>
                  loc: (redir_loc.Fd fd:1)
                  arg: {($ Id.VSub_DollarName '$p')}
                )
              ]
              do_fork: T
            )
            (C {<test_expect_success>} {(SQ <'change in branch B (addition)'>)} 
              {(DQ <'git update-index --add '> ($ Id.VSub_DollarName '$p'))}
            )
          ]
        )
    )
    (command.Simple
      words: [{<echo>} {<This>} {<is>} {<SS>} {<from>} {<the>} {<modified>} {<tree.>}]
      redirects: [(redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<SS>})]
      do_fork: T
    )
    (command.Simple
      words: [{<echo>} {<This>} {<is>} {<LL>} {<from>} {<the>} {<modified>} {<tree.>}]
      redirects: [(redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<LL>})]
      do_fork: T
    )
    (C {<test_expect_success>} {(SQ <'change in branch B (addition and modification)'>)} 
      {(SQ <'git update-index --add LL &&\n'> <'     git update-index SS'>)}
    )
    (C {<mv>} {<TT>} {<TT->})
    (command.Simple
      words: [{<sed>} {<-e>} {(SQ <'/Branch B/s/word/WORD/g'>)}]
      redirects: [
        (redir op:<Id.Redir_Less '<'> loc:(redir_loc.Fd fd:0) arg:{<TT->})
        (redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<TT>})
      ]
      do_fork: T
    )
    (C {<rm>} {<-f>} {<TT->})
    (C {<test_expect_success>} {(SQ <'change in branch B (modification)'>)} 
      {(SQ <'git update-index TT'>)}
    )
    (command.Simple
      words: [{<echo>} {<Branch>} {<B>} {<makes>} {<a>} {<file>} {<at>} {<DF.>}]
      redirects: [(redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<DF>})]
      do_fork: T
    )
    (C {<test_expect_success>} 
      {(SQ <'change in branch B (addition of a file to conflict with directory)'>)} {(SQ <'git update-index --add DF'>)}
    )
    (C {<test_expect_success>} {(SQ <'recording branch B tree'>)} {(SQ <'tree_B=$(git write-tree)'>)})
    (C {<test_expect_success>} {(SQ <'keep contents of 3 trees for easy access'>)} 
      {
        (SQ <'rm -f .git/index &&\n'> <'     git read-tree $tree_O &&\n'> <'     mkdir .orig-O &&\n'> 
          <'     git checkout-index --prefix=.orig-O/ -f -q -a &&\n'> <'     rm -f .git/index &&\n'> <'     git read-tree $tree_A &&\n'> <'     mkdir .orig-A &&\n'> 
          <'     git checkout-index --prefix=.orig-A/ -f -q -a &&\n'> <'     rm -f .git/index &&\n'> <'     git read-tree $tree_B &&\n'> <'     mkdir .orig-B &&\n'> 
          <'     git checkout-index --prefix=.orig-B/ -f -q -a'>
        )
      }
    )
  ]
)