(command.CommandList
  children: [
    (C {(cd)} 
      {
        (DQ 
          (command_sub
            left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:115)
            command_list: (command.CommandList children:[(C {(dirname)} {($ Id.VSub_Number '$0')})])
          )
        ) (/../..)
      }
    )
    (command.If
      arms: [
        (if_arm
          cond: [
            (command.Sentence
              child: 
                (command.DBracket
                  expr: 
                    (bool_expr.Binary
                      op_id: Id.BoolBinary_GlobNEqual
                      left: 
                        {
                          (DQ 
                            (command_sub
                              left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:129)
                              command_list: 
                                (command.CommandList
                                  children: [(C {(git)} {(rev-parse)} {(--abbrev-ref)} {(HEAD)})]
                                )
                            )
                          )
                        }
                      right: {(DQ (master))}
                    )
                )
              terminator: (Token id:Id.Op_Semi val:';' span_id:147)
            )
          ]
          action: [
            (command.Simple
              words: [{(echo)} {(DQ ('ERROR: not on master branch'))}]
              redirects: [
                (redir.Redir
                  op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:158)
                  fd: -1
                  arg_word: {(2)}
                )
              ]
            )
            (command.ControlFlow
              token: (Token id:Id.ControlFlow_Exit val:exit span_id:162)
              arg_word: {(1)}
            )
          ]
          spids: [124 149]
        )
        (if_arm
          cond: [
            (command.Sentence
              child: 
                (command.DBracket
                  expr: 
                    (bool_expr.Unary
                      op_id: Id.BoolUnary_n
                      child: 
                        {
                          (DQ 
                            (command_sub
                              left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:173)
                              command_list: 
                                (command.CommandList
                                  children: [(C {(git)} {(diff)} {(--name-only)})]
                                )
                            )
                          )
                        }
                    )
                )
              terminator: (Token id:Id.Op_Semi val:';' span_id:183)
            )
          ]
          action: [
            (command.Simple
              words: [{(echo)} {(DQ ('ERROR: locally modified files'))}]
              redirects: [
                (redir.Redir
                  op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:194)
                  fd: -1
                  arg_word: {(2)}
                )
              ]
            )
            (command.Simple
              words: [{(git)} {(diff)} {(--name-only)}]
              redirects: [
                (redir.Redir
                  op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:204)
                  fd: -1
                  arg_word: {(2)}
                )
              ]
            )
            (command.ControlFlow
              token: (Token id:Id.ControlFlow_Exit val:exit span_id:208)
              arg_word: {(1)}
            )
          ]
          spids: [166 185]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:previous_version)
          op: assign_op.Equal
          rhs: 
            {
              (command_sub
                left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:216)
                command_list: 
                  (command.CommandList
                    children: [
                      (C {(awk)} 
                        {
                          (SQ 
                            (Token
                              id: Id.Lit_Chars
                              val: '/^release_version =/ { print substr($3, 2, length($3)-2) }'
                              span_id: 220
                            )
                          )
                        } {(kythe/release/BUILD)}
                      )
                    ]
                  )
              )
            }
          spids: [215]
        )
      ]
    )
    (C {(echo)} {(DQ ('Previous version: ') ($ Id.VSub_DollarName '$previous_version'))})
    (command.If
      arms: [
        (if_arm
          cond: [
            (command.Sentence
              child: 
                (command.DBracket
                  expr: 
                    (bool_expr.Binary
                      op_id: Id.BoolBinary_GlobNEqual
                      left: {(DQ ($ Id.VSub_DollarName '$previous_version'))}
                      right: {(v) (Id.Lit_Other '*') (.) (Id.Lit_Other '*') (.) (Id.Lit_Other '*')}
                    )
                )
              terminator: (Token id:Id.Op_Semi val:';' span_id:252)
            )
          ]
          action: [
            (command.Simple
              words: [{(echo)} {(DQ ('Unexpected version format'))}]
              redirects: [
                (redir.Redir
                  op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:263)
                  fd: -1
                  arg_word: {(2)}
                )
              ]
            )
            (command.ControlFlow
              token: (Token id:Id.ControlFlow_Exit val:exit span_id:267)
              arg_word: {(1)}
            )
          ]
          spids: [234 254]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:previous_version)
          op: assign_op.Equal
          rhs: 
            {
              (braced_var_sub
                token: (Token id:Id.VSub_Name val:previous_version span_id:275)
                suffix_op: (suffix_op.Unary op_id:Id.VOp1_Pound arg_word:{(v)})
              )
            }
          spids: [273]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:components)
          op: assign_op.Equal
          rhs: 
            {
              (sh_array_literal
                left: (Token id:Id.Op_LParen val:'(' span_id:282)
                words: [
                  {
                    (braced_var_sub
                      token: (Token id:Id.VSub_Name val:previous_version span_id:284)
                      suffix_op: 
                        (suffix_op.PatSub
                          pat: {(.)}
                          replace: {(' ')}
                          replace_mode: Id.Lit_Slash
                        )
                    )
                  }
                ]
              )
            }
          spids: [281]
        )
      ]
    )
    (command.DParen
      child: 
        (arith_expr.UnaryAssign
          op_id: Id.Node_PostDPlus
          child: 
            (sh_lhs_expr.IndexedName
              name: components
              index: (arith_expr.ArithWord w:{(Id.Lit_Digits 2)})
            )
        )
    )
    (command.ShFunction
      name: join
      body: 
        (command.BraceGroup
          children: [
            (command.Sentence
              child: (C {(local)} {(Id.Lit_VarLike 'IFS=') (DQ ($ Id.VSub_Number '$1'))})
              terminator: (Token id:Id.Op_Semi val:';' span_id:315)
            )
            (command.Sentence
              child: (C {(shift)})
              terminator: (Token id:Id.Op_Semi val:';' span_id:318)
            )
            (command.Sentence
              child: (C {(echo)} {(DQ ($ Id.VSub_Star '$*'))})
              terminator: (Token id:Id.Op_Semi val:';' span_id:325)
            )
          ]
        )
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:version)
          op: assign_op.Equal
          rhs: 
            {
              (DQ (v) 
                (command_sub
                  left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:332)
                  command_list: 
                    (command.CommandList
                      children: [
                        (C {(join)} {(.)} 
                          {
                            (DQ 
                              (braced_var_sub
                                token: (Token id:Id.VSub_Name val:components span_id:339)
                                bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At)
                              )
                            )
                          }
                        )
                      ]
                    )
                )
              )
            }
          spids: [329]
        )
      ]
    )
    (C {(echo)} {(DQ ('Marking release ') ($ Id.VSub_DollarName '$version'))})
    (C {(sed)} {(-i)} {(DQ ('s/Upcoming release/') ($ Id.VSub_DollarName '$version') (/))} 
      {(RELEASES.md)}
    )
    (C {(sed)} {(-ri)} 
      {
        (DQ ('s/^release_version = .+/release_version = ') 
          (word_part.EscapedLiteral
            token: (Token id:Id.Lit_EscapedChar val:'\\"' span_id:374)
          ) ($ Id.VSub_DollarName '$version') 
          (word_part.EscapedLiteral
            token: (Token id:Id.Lit_EscapedChar val:'\\"' span_id:376)
          ) (/)
        )
      } {(kythe/release/BUILD)}
    )
    (command.If
      arms: [
        (if_arm
          cond: [
            (command.Sentence
              child: 
                (command.Pipeline
                  children: [
                    (command.Simple
                      words: [
                        {(diff)}
                        {(-q)}
                        {
                          (command_sub
                            left_token: (Token id:Id.Left_ProcSubIn val:'<(' span_id:391)
                            command_list: 
                              (command.CommandList
                                children: [(C {(git)} {(diff)} {(--name-only)})]
                              )
                          )
                        }
                        {
                          (command_sub
                            left_token: (Token id:Id.Left_ProcSubIn val:'<(' span_id:399)
                            command_list: 
                              (command.CommandList
                                children: [
                                  (command.Sentence
                                    child: (C {(echo)} {(RELEASES.md)})
                                    terminator: (Token id:Id.Op_Semi val:';' span_id:403)
                                  )
                                  (C {(echo)} {(kythe/release/BUILD)})
                                ]
                              )
                          )
                        }
                      ]
                      redirects: [
                        (redir.Redir
                          op: (Token id:Id.Redir_Great val:'>' span_id:410)
                          fd: -1
                          arg_word: {(/dev/null)}
                        )
                      ]
                    )
                  ]
                  negated: T
                )
              terminator: (Token id:Id.Op_Semi val:';' span_id:412)
            )
          ]
          action: [
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (command.DBracket
                          expr: 
                            (bool_expr.Unary
                              op_id: Id.BoolUnary_z
                              child: 
                                {
                                  (DQ 
                                    (command_sub
                                      left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:424)
                                      command_list: 
                                        (command.CommandList
                                          children: [
                                            (C {(git)} {(diff)} {(--name-only)} {(--)} {(RELEASES.md)})
                                          ]
                                        )
                                    )
                                  )
                                }
                            )
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:438)
                    )
                  ]
                  action: [
                    (command.Simple
                      words: [
                        {(echo)}
                        {(DQ ('ERROR: RELEASES.md has not been updated (no listed changes?)'))}
                      ]
                      redirects: [
                        (redir.Redir
                          op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:449)
                          fd: -1
                          arg_word: {(2)}
                        )
                      ]
                    )
                    (command.ControlFlow
                      token: (Token id:Id.ControlFlow_Exit val:exit span_id:453)
                      arg_word: {(1)}
                    )
                  ]
                  spids: [417 440]
                )
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (command.DBracket
                          expr: 
                            (bool_expr.Unary
                              op_id: Id.BoolUnary_z
                              child: 
                                {
                                  (DQ 
                                    (command_sub
                                      left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:465)
                                      command_list: 
                                        (command.CommandList
                                          children: [
                                            (C {(git)} {(diff)} {(--name-only)} {(--)} 
                                              {(kythe/release/BUILD)}
                                            )
                                          ]
                                        )
                                    )
                                  )
                                }
                            )
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:479)
                    )
                  ]
                  action: [
                    (command.Simple
                      words: [{(echo)} {(DQ ('ERROR: kythe/release/BUILD has not been updated'))}]
                      redirects: [
                        (redir.Redir
                          op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:490)
                          fd: -1
                          arg_word: {(2)}
                        )
                      ]
                    )
                    (command.ControlFlow
                      token: (Token id:Id.ControlFlow_Exit val:exit span_id:494)
                      arg_word: {(1)}
                    )
                  ]
                  spids: [458 481]
                )
              ]
            )
            (command.Simple
              words: [{(echo)} {(DQ ('Unexpected changed files in repository:'))}]
              redirects: [
                (redir.Redir
                  op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:508)
                  fd: -1
                  arg_word: {(2)}
                )
              ]
            )
            (command.Pipeline
              children: [
                (C {(git)} {(diff)} {(--name-only)})
                (C {(grep)} {(-v)} {(-e)} {(SQ (Token id:Id.Lit_Chars val:'^RELEASES.md$' span_id:527))} 
                  {(-e)} {(SQ (Token id:Id.Lit_Chars val:'^kythe/release/BUILD$' span_id:533))}
                )
              ]
              negated: F
            )
          ]
          spids: [383 414]
        )
      ]
    )
    (C {(git)} {(checkout)} {(-b)} {(DQ (release-) ($ Id.VSub_DollarName '$version'))})
    (C {(git)} {(commit)} {(-am)} {(DQ ('Setup release ') ($ Id.VSub_DollarName '$version'))})
  ]
)