(CommandList
  children: [
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:GRAFTS_FILE)
          op: Equal
          rhs: 
            {
              (DQ 
                (BracedVarSub
                  token: <VSub_Name GIT_DIR>
                  suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(.git)})
                  spids: [13 17]
                ) (/info/grafts)
              )
            }
          spids: [11]
        )
      ]
      spids: [11]
    )
    (C {(.)} 
      {
        (CommandSubPart
          command_list: (CommandList children:[(C {(git)} {(--exec-path)})])
          left_token: <Left_CommandSub '$('>
          spids: [24 28]
        ) (/git-sh-setup)
      }
    )
    (AndOr
      ops: [Op_DPipe]
      children: [
        (C {(test)} {(-f)} {(DQ ($ VSub_Name '$GRAFTS_FILE'))})
        (C {(die)} {(DQ ("Could not find graft file: '") ($ VSub_Name '$GRAFTS_FILE') ("'"))})
      ]
    )
    (Pipeline
      children: [
        (C {(grep)} {(SQ <'^[^# ]'>)} {(DQ ($ VSub_Name '$GRAFTS_FILE'))})
        (While
          cond: [(C {(read)} {(definition)})]
          body: 
            (DoGroup
              children: [
                (If
                  arms: [
                    (if_arm
                      cond: [(C {(test)} {(-n)} {(DQ ($ VSub_Name '$definition'))})]
                      action: [
                        (C {(echo)} {(DQ ('Converting: ') ($ VSub_Name '$definition'))})
                        (AndOr
                          ops: [Op_DPipe]
                          children: [
                            (C {(git)} {(replace)} {(--graft)} {($ VSub_Name '$definition')})
                            (C {(die)} {(DQ ('Conversion failed for: ') ($ VSub_Name '$definition'))})
                          ]
                        )
                      ]
                      spids: [16777215 83]
                    )
                  ]
                  spids: [16777215 113]
                )
              ]
              spids: [69 115]
            )
        )
      ]
      negated: F
    )
    (AndOr
      ops: [Op_DPipe]
      children: [
        (C {(mv)} {(DQ ($ VSub_Name '$GRAFTS_FILE'))} {(DQ ($ VSub_Name '$GRAFTS_FILE') (.bak))})
        (C {(die)} 
          {
            (DQ ("Could not rename '") ($ VSub_Name '$GRAFTS_FILE') ("' to '") 
              ($ VSub_Name '$GRAFTS_FILE') (".bak'")
            )
          }
        )
      ]
    )
    (C {(echo)} {(DQ ('Success!'))})
    (C {(echo)} 
      {
        (DQ ("All the grafts in '") ($ VSub_Name '$GRAFTS_FILE') 
          ("' have been converted to replace refs!")
        )
      }
    )
    (C {(echo)} 
      {
        (DQ ("The grafts file '") ($ VSub_Name '$GRAFTS_FILE') ("' has been renamed: '") 
          ($ VSub_Name '$GRAFTS_FILE') (".bak'")
        )
      }
    )
  ]
)