(command.CommandList
  children: [
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:GRAFTS_FILE)
          op: assign_op.Equal
          rhs: 
            {
              (DQ 
                (braced_var_sub
                  token: <Id.VSub_Name GIT_DIR>
                  suffix_op: (suffix_op.Unary op_id:Id.VTest_ColonHyphen arg_word:{<.git>})
                ) </info/grafts>
              )
            }
          spids: [11]
        )
      ]
    )
    (C {<.>} 
      {
        (command_sub
          left_token: <Id.Left_DollarParen '$('>
          command_list: (command.CommandList children:[(C {<git>} {<--exec-path>})])
        ) </git-sh-setup>
      }
    )
    (command.AndOr
      ops: [Id.Op_DPipe]
      children: [
        (C {<test>} {<-f>} {(DQ ($ Id.VSub_DollarName '$GRAFTS_FILE'))})
        (C {<die>} {(DQ <"Could not find graft file: '"> ($ Id.VSub_DollarName '$GRAFTS_FILE') <"'">)})
      ]
    )
    (command.Pipeline
      children: [
        (C {<grep>} {(SQ <'^[^# ]'>)} {(DQ ($ Id.VSub_DollarName '$GRAFTS_FILE'))})
        (command.WhileUntil
          keyword: <Id.KW_While while>
          cond: [(C {<read>} {<definition>})]
          body: 
            (command.DoGroup
              children: [
                (command.If
                  arms: [
                    (if_arm
                      cond: [(C {<test>} {<-n>} {(DQ ($ Id.VSub_DollarName '$definition'))})]
                      action: [
                        (C {<echo>} {(DQ <'Converting: '> ($ Id.VSub_DollarName '$definition'))})
                        (command.AndOr
                          ops: [Id.Op_DPipe]
                          children: [
                            (C {<git>} {<replace>} {<--graft>} {($ Id.VSub_DollarName '$definition')})
                            (C {<die>} 
                              {(DQ <'Conversion failed for: '> ($ Id.VSub_DollarName '$definition'))}
                            )
                          ]
                        )
                      ]
                      spids: [72 83]
                    )
                  ]
                )
              ]
            )
        )
      ]
      negated: F
    )
    (command.AndOr
      ops: [Id.Op_DPipe]
      children: [
        (C {<mv>} {(DQ ($ Id.VSub_DollarName '$GRAFTS_FILE'))} 
          {(DQ ($ Id.VSub_DollarName '$GRAFTS_FILE') <.bak>)}
        )
        (C {<die>} 
          {
            (DQ <"Could not rename '"> ($ Id.VSub_DollarName '$GRAFTS_FILE') <"' to '"> 
              ($ Id.VSub_DollarName '$GRAFTS_FILE') <".bak'">
            )
          }
        )
      ]
    )
    (C {<echo>} {(DQ <'Success!'>)})
    (C {<echo>} 
      {
        (DQ <"All the grafts in '"> ($ Id.VSub_DollarName '$GRAFTS_FILE') 
          <"' have been converted to replace refs!">
        )
      }
    )
    (C {<echo>} 
      {
        (DQ <"The grafts file '"> ($ Id.VSub_DollarName '$GRAFTS_FILE') <"' has been renamed: '"> 
          ($ Id.VSub_DollarName '$GRAFTS_FILE') <".bak'">
        )
      }
    )
  ]
)