(command.CommandList
  children: [
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:gitref)
          op: assign_op.Equal
          rhs: 
            {
              (braced_var_sub
                token: <Id.VSub_Number 1>
                suffix_op: (suffix_op.Unary tok:<Id.VTest_ColonHyphen ':-'> arg_word:{<HEAD>})
              )
            }
          spids: [14]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:ver)
          op: assign_op.Equal
          rhs: 
            {
              (command_sub
                left_token: <Id.Left_DollarParen '$('>
                child: (C {<git>} {<show>} {(DQ ($ Id.VSub_DollarName '$gitref') <':VERSION'>)})
              )
            }
          spids: [22]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:major)
          op: assign_op.Equal
          rhs: 
            {
              (command_sub
                left_token: <Id.Left_DollarParen '$('>
                child: 
                  (command.Pipeline
                    children: [
                      (C {<echo>} {($ Id.VSub_DollarName '$ver')})
                      (C {<cut>} {<-f>} {<1>} {<-d>} {<.>})
                    ]
                    negated: F
                  )
              )
            }
          spids: [34]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:minor)
          op: assign_op.Equal
          rhs: 
            {
              (command_sub
                left_token: <Id.Left_DollarParen '$('>
                child: 
                  (command.Pipeline
                    children: [
                      (C {<echo>} {($ Id.VSub_DollarName '$ver')})
                      (C {<cut>} {<-f>} {<2>} {<-d>} {<.>})
                    ]
                    negated: F
                  )
              )
            }
          spids: [53]
        )
      ]
    )
    (command.If
      arms: [
        (if_arm
          cond: 
            (condition.Shell
              commands: [
                (command.Sentence
                  child: 
                    (C {<Id.Lit_LBracket '['>} {($ Id.VSub_DollarName '$major')} {<Id.Lit_Equals '='>} 
                      {<0>} {<-a>} {($ Id.VSub_DollarName '$minor')} {<-lt>} {<5>} {<Id.Lit_RBracket ']'>}
                    )
                  terminator: <Id.Op_Semi _>
                )
              ]
            )
          action: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:last_tag)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: <Id.Left_DollarParen '$('>
                        child: 
                          (C {<git>} {<describe>} {<--tags>} {<--abbrev> <Id.Lit_Equals '='> <0>} 
                            {(DQ ($ Id.VSub_DollarName '$gitref'))}
                          )
                      )
                    }
                  spids: [101]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:nb)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: <Id.Left_DollarParen '$('>
                        child: 
                          (C {<git>} {<rev-list>} {<--count>} {(DQ ($ Id.VSub_DollarName '$gitref'))} 
                            {(DQ <'^'> ($ Id.VSub_DollarName '$last_tag'))}
                          )
                      )
                    }
                  spids: [119]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (C {<Id.Lit_LBracket '['>} {($ Id.VSub_DollarName '$nb')} 
                              {<Id.Lit_Equals '='>} {<0>} {<Id.Lit_RBracket ']'>}
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [(C {<echo>} {($ Id.VSub_DollarName '$ver')})]
                  spids: [138 151]
                )
              ]
              else_action: [
                (C {<echo>} {(DQ ($ Id.VSub_DollarName '$ver') <'+'> ($ Id.VSub_DollarName '$nb'))})
              ]
            )
          ]
          spids: [73 94]
        )
      ]
      else_action: [
        (command.ShAssignment
          pairs: [
            (assign_pair
              lhs: (sh_lhs_expr.Name name:topdir)
              op: assign_op.Equal
              rhs: 
                {
                  (command_sub
                    left_token: <Id.Left_DollarParen '$('>
                    child: (C {<git>} {<rev-parse>} {<--show-toplevel>})
                  )
                }
              spids: [176]
            )
          ]
        )
        (command.ShAssignment
          pairs: [
            (assign_pair
              lhs: (sh_lhs_expr.Name name:verchanged)
              op: assign_op.Equal
              rhs: 
                {
                  (command_sub
                    left_token: <Id.Left_DollarParen '$('>
                    child: 
                      (command.Pipeline
                        children: [
                          (C {<git>} {<blame>} {<-L>} {<Id.Lit_Comma ','> <1>} {<-sl>} 
                            {($ Id.VSub_DollarName '$gitref')} {<-->} {(DQ ($ Id.VSub_DollarName '$topdir') <'/VERSION'>)}
                          )
                          (C {<cut>} {<-f>} {<1>} {<-d>} {(DQ <' '>)})
                        ]
                        negated: F
                      )
                  )
                }
              spids: [186]
            )
          ]
        )
        (command.ShAssignment
          pairs: [
            (assign_pair
              lhs: (sh_lhs_expr.Name name:nb)
              op: assign_op.Equal
              rhs: 
                {
                  (command_sub
                    left_token: <Id.Left_DollarParen '$('>
                    child: 
                      (C {<git>} {<rev-list>} {<--count>} {(DQ ($ Id.VSub_DollarName '$gitref'))} 
                        {(DQ <'^'> ($ Id.VSub_DollarName '$verchanged'))}
                      )
                  )
                }
              spids: [224]
            )
          ]
        )
        (command.ShAssignment
          pairs: [
            (assign_pair
              lhs: (sh_lhs_expr.Name name:pre)
              op: assign_op.Equal
              rhs: 
                {
                  (command_sub
                    left_token: <Id.Left_DollarParen '$('>
                    child: 
                      (command.Pipeline
                        children: [
                          (C {<echo>} {($ Id.VSub_DollarName '$ver')})
                          (C {<cut>} {<-s>} {<-f>} {<2>} {<-d>} {(DQ <->)})
                        ]
                        negated: F
                      )
                  )
                }
              spids: [243]
            )
          ]
        )
        (command.If
          arms: [
            (if_arm
              cond: 
                (condition.Shell
                  commands: [
                    (command.Sentence
                      child: 
                        (C {<Id.Lit_LBracket '['>} {($ Id.VSub_DollarName '$ver')} {<Id.Lit_Equals '='>} 
                          {(DQ <0.5.0-dev>)} {<Id.Lit_RBracket ']'>}
                        )
                      terminator: <Id.Op_Semi _>
                    )
                  ]
                )
              action: [
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:nb)
                      op: assign_op.Equal
                      rhs: 
                        {
                          (command_sub
                            left_token: <Id.Left_DollarParen '$('>
                            child: 
                              (C {<expr>} {($ Id.VSub_DollarName '$nb')} {<Id.Lit_Other '+'>} {<1>})
                          )
                        }
                      spids: [289]
                    )
                  ]
                )
              ]
              spids: [267 282]
            )
            (if_arm
              cond: 
                (condition.Shell
                  commands: [
                    (command.Sentence
                      child: 
                        (C {<Id.Lit_LBracket '['>} {($ Id.VSub_DollarName '$ver')} {<Id.Lit_Equals '='>} 
                          {(DQ <0.5.0-pre>)} {<Id.Lit_RBracket ']'>}
                        )
                      terminator: <Id.Op_Semi _>
                    )
                  ]
                )
              action: [
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:nb)
                      op: assign_op.Equal
                      rhs: 
                        {
                          (command_sub
                            left_token: <Id.Left_DollarParen '$('>
                            child: 
                              (C {<expr>} {($ Id.VSub_DollarName '$nb')} {<Id.Lit_Other '+'>} {<5578>})
                          )
                        }
                      spids: [323]
                    )
                  ]
                )
              ]
              spids: [301 316]
            )
          ]
        )
        (command.If
          arms: [
            (if_arm
              cond: 
                (condition.Shell
                  commands: [
                    (command.Sentence
                      child: 
                        (C {<Id.Lit_LBracket '['>} {<-n>} {(DQ ($ Id.VSub_DollarName '$pre'))} 
                          {<Id.Lit_RBracket ']'>}
                        )
                      terminator: <Id.Op_Semi _>
                    )
                  ]
                )
              action: [
                (command.If
                  arms: [
                    (if_arm
                      cond: 
                        (condition.Shell
                          commands: [
                            (command.Sentence
                              child: 
                                (C {<Id.Lit_LBracket '['>} {($ Id.VSub_DollarName '$major')} 
                                  {<Id.Lit_Equals '='>} {<0>} {<-a>} {($ Id.VSub_DollarName '$minor')} {<-le>} {<5>} {<Id.Lit_RBracket ']'>}
                                )
                              terminator: <Id.Op_Semi _>
                            )
                          ]
                        )
                      action: [
                        (C {<echo>} 
                          {(DQ ($ Id.VSub_DollarName '$ver') <'+'> ($ Id.VSub_DollarName '$nb'))}
                        )
                      ]
                      spids: [354 375]
                    )
                  ]
                  else_action: [
                    (C {<echo>} {(DQ ($ Id.VSub_DollarName '$ver') <.> ($ Id.VSub_DollarName '$nb'))})
                  ]
                )
              ]
              spids: [338 351]
            )
          ]
          else_action: [(C {<echo>} {($ Id.VSub_DollarName '$ver')})]
        )
      ]
    )
  ]
)