(command.CommandList
  children: [
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:gitref)
          op: assign_op.Equal
          rhs: 
            {
              (braced_var_sub
                token: (Token id:Id.VSub_Number val:1 span_id:16)
                suffix_op: (suffix_op.Unary op_id: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: (Token id:Id.Left_DollarParen val:'$(' span_id:23)
                command_list: 
                  (command.CommandList
                    children: [(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: (Token id:Id.Left_DollarParen val:'$(' span_id:35)
                command_list: 
                  (command.CommandList
                    children: [
                      (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: (Token id:Id.Left_DollarParen val:'$(' span_id:54)
                command_list: 
                  (command.CommandList
                    children: [
                      (command.Pipeline
                        children: [
                          (C {(echo)} {($ Id.VSub_DollarName '$ver')})
                          (C {(cut)} {(-f)} {(2)} {(-d)} {(.)})
                        ]
                        negated: F
                      )
                    ]
                  )
              )
            }
          spids: [53]
        )
      ]
    )
    (command.If
      arms: [
        (if_arm
          cond: [
            (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: (Token id:Id.Op_Semi val:';' span_id:92)
            )
          ]
          action: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:last_tag)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:102)
                        command_list: 
                          (command.CommandList
                            children: [
                              (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: (Token id:Id.Left_DollarParen val:'$(' span_id:120)
                        command_list: 
                          (command.CommandList
                            children: [
                              (C {(git)} {(rev-list)} {(--count)} {(DQ ($ Id.VSub_DollarName '$gitref'))} 
                                {(DQ ('^') ($ Id.VSub_DollarName '$last_tag'))}
                              )
                            ]
                          )
                      )
                    }
                  spids: [119]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (C {(Id.Lit_LBracket '[')} {($ Id.VSub_DollarName '$nb')} {(Id.Lit_Equals '=')} 
                          {(0)} {(Id.Lit_RBracket ']')}
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:149)
                    )
                  ]
                  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: (Token id:Id.Left_DollarParen val:'$(' span_id:177)
                    command_list: 
                      (command.CommandList
                        children: [(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: (Token id:Id.Left_DollarParen val:'$(' span_id:187)
                    command_list: 
                      (command.CommandList
                        children: [
                          (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: (Token id:Id.Left_DollarParen val:'$(' span_id:225)
                    command_list: 
                      (command.CommandList
                        children: [
                          (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: (Token id:Id.Left_DollarParen val:'$(' span_id:244)
                    command_list: 
                      (command.CommandList
                        children: [
                          (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: [
                (command.Sentence
                  child: 
                    (C {(Id.Lit_LBracket '[')} {($ Id.VSub_DollarName '$ver')} {(Id.Lit_Equals '=')} 
                      {(DQ (0.5.0-dev))} {(Id.Lit_RBracket ']')}
                    )
                  terminator: (Token id:Id.Op_Semi val:';' span_id:280)
                )
              ]
              action: [
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:nb)
                      op: assign_op.Equal
                      rhs: 
                        {
                          (command_sub
                            left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:290)
                            command_list: 
                              (command.CommandList
                                children: [
                                  (C {(expr)} {($ Id.VSub_DollarName '$nb')} {(Id.Lit_Other '+')} {(1)})
                                ]
                              )
                          )
                        }
                      spids: [289]
                    )
                  ]
                )
              ]
              spids: [267 282]
            )
            (if_arm
              cond: [
                (command.Sentence
                  child: 
                    (C {(Id.Lit_LBracket '[')} {($ Id.VSub_DollarName '$ver')} {(Id.Lit_Equals '=')} 
                      {(DQ (0.5.0-pre))} {(Id.Lit_RBracket ']')}
                    )
                  terminator: (Token id:Id.Op_Semi val:';' span_id:314)
                )
              ]
              action: [
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:nb)
                      op: assign_op.Equal
                      rhs: 
                        {
                          (command_sub
                            left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:324)
                            command_list: 
                              (command.CommandList
                                children: [
                                  (C {(expr)} {($ Id.VSub_DollarName '$nb')} {(Id.Lit_Other '+')} 
                                    {(5578)}
                                  )
                                ]
                              )
                          )
                        }
                      spids: [323]
                    )
                  ]
                )
              ]
              spids: [301 316]
            )
          ]
        )
        (command.If
          arms: [
            (if_arm
              cond: [
                (command.Sentence
                  child: 
                    (C {(Id.Lit_LBracket '[')} {(-n)} {(DQ ($ Id.VSub_DollarName '$pre'))} 
                      {(Id.Lit_RBracket ']')}
                    )
                  terminator: (Token id:Id.Op_Semi val:';' span_id:349)
                )
              ]
              action: [
                (command.If
                  arms: [
                    (if_arm
                      cond: [
                        (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: (Token id:Id.Op_Semi val:';' span_id:373)
                        )
                      ]
                      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')})]
        )
      ]
    )
  ]
)