(command.CommandList
  children: [
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'functions='> name:functions)
          op: assign_op.Equal
          rhs: 
            {
              (command_sub
                left_token: <Id.Left_DollarParen '$('>
                child: 
                  (command.Simple
                    words: [{<cat>}]
                    redirects: [
                      (redir
                        op: <Id.Redir_DLess '<<'>
                        loc: (redir_loc.Fd fd:0)
                        arg: 
                          (redir_param.HereDoc
                            here_begin: 
                              {(word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\E'> ch:E) <OF>}
                            here_end_span_id: 89
                            stdin_parts: [
                              <'warn () {\n'>
                              <'\techo "$*" >&2\n'>
                              <'}\n'>
                              <'\n'>
                              <'map()\n'>
                              <'{\n'>
                              <'\t# if it was not rewritten, take the original\n'>
                              <'\tif test -r "$workdir/../map/$1"\n'>
                              <'\tthen\n'>
                              <'\t\tcat "$workdir/../map/$1"\n'>
                              <'\telse\n'>
                              <'\t\techo "$1"\n'>
                              <'\tfi\n'>
                              <'}\n'>
                              <'\n'>
                              <
'# if you run \'skip_commit "$@"\' in a commit filter, it will print\n'
                              >
                              <'# the (mapped) parents, effectively skipping the commit.\n'>
                              <'\n'>
                              <'skip_commit()\n'>
                              <'{\n'>
                              <'\tshift;\n'>
                              <'\twhile [ -n "$1" ];\n'>
                              <'\tdo\n'>
                              <'\t\tshift;\n'>
                              <'\t\tmap "$1";\n'>
                              <'\t\tshift;\n'>
                              <'\tdone;\n'>
                              <'}\n'>
                              <'\n'>
                              <
'# if you run \'git_commit_non_empty_tree "$@"\' in a commit filter,\n'
                              >
                              <
'# it will skip commits that leave the tree untouched, commit the other.\n'
                              >
                              <'git_commit_non_empty_tree()\n'>
                              <'{\n'>
                              <
'\tif test $# = 3 && test "$1" = $(git rev-parse "$3^{tree}"); then\n'
                              >
                              <'\t\tmap "$3"\n'>
                              <'\telse\n'>
                              <'\t\tgit commit-tree "$@"\n'>
                              <'\tfi\n'>
                              <'}\n'>
                              <
'# override die(): this version puts in an extra line break, so that\n'
                              >
                              <'# the progress is still visible\n'>
                              <'\n'>
                              <'die()\n'>
                              <'{\n'>
                              <'\techo >&2\n'>
                              <'\techo "$*" >&2\n'>
                              <'\texit 1\n'>
                              <'}\n'>
                            ]
                          )
                      )
                    ]
                    more_env: []
                    do_fork: T
                  )
                right: <Id.Eof_RParen _>
              )
            }
          spids: [32]
        )
      ]
      redirects: []
    )
    (C {<eval>} {(DQ ($ Id.VSub_DollarName functions))})
    (command.ShFunction
      name: finish_ident
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (C {<echo>} 
              {
                (DQ <'case '> (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\"'> ch:'"') 
                  (word_part.EscapedLiteral
                    token: <Id.Lit_EscapedChar '\\$'>
                    ch: '$'
                  ) <GIT_> ($ Id.VSub_Number 1) <_NAME> (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\"'> ch:'"') 
                  <' in '> (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\"'> ch:'"') 
                  (word_part.EscapedLiteral
                    token: <Id.Lit_EscapedChar '\\"'>
                    ch: '"'
                  ) <') GIT_'> ($ Id.VSub_Number 1) <'_NAME='> 
                  (word_part.EscapedLiteral
                    token: <Id.Lit_EscapedChar '\\"'>
                    ch: '"'
                  ) (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\$'> ch:'$') <'{GIT_'> ($ Id.VSub_Number 1) 
                  <'_EMAIL%%@*}'> (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\"'> ch:'"') <' && export GIT_'> 
                  ($ Id.VSub_Number 1) <'_NAME;; esac'>
                )
              }
            )
            (C {<echo>} {(DQ <'export GIT_'> ($ Id.VSub_Number 1) <_NAME>)})
            (C {<echo>} {(DQ <'export GIT_'> ($ Id.VSub_Number 1) <_EMAIL>)})
            (C {<echo>} {(DQ <'export GIT_'> ($ Id.VSub_Number 1) <_DATE>)})
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.ShFunction
      name: set_ident
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (C {<parse_ident_from_commit>} {<author>} {<AUTHOR>} {<committer>} {<COMMITTER>})
            (C {<finish_ident>} {<AUTHOR>})
            (C {<finish_ident>} {<COMMITTER>})
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'USAGE='> name:USAGE)
          op: assign_op.Equal
          rhs: 
            {
              (DQ <'[--env-filter <command>] [--tree-filter <command>]\n'> 
                <'\t[--index-filter <command>] [--parent-filter <command>]\n'> <'\t[--msg-filter <command>] [--commit-filter <command>]\n'> 
                <'\t[--tag-name-filter <command>] [--subdirectory-filter <directory>]\n'> <'\t[--original <namespace>] [-d <directory>] [-f | --force]\n'> <'\t[<rev-list options>...]'>
              )
            }
          spids: [203]
        )
      ]
      redirects: []
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'OPTIONS_SPEC='> name:OPTIONS_SPEC)
          op: assign_op.Equal
          rhs: (rhs_word.Empty)
          spids: [214]
        )
      ]
      redirects: []
    )
    (C {<.>} {<git-sh-setup>})
    (command.If
      arms: [
        (if_arm
          cond: 
            (condition.Shell
              commands: [
                (command.Sentence
                  child: 
                    (C {<Id.Lit_LBracket '['>} 
                      {
                        (DQ 
                          (command_sub
                            left_token: <Id.Left_DollarParen '$('>
                            child: (C {<is_bare_repository>})
                            right: <Id.Eof_RParen _>
                          )
                        )
                      } {<Id.Lit_Equals '='>} {<false>} {<Id.Lit_RBracket ']'>}
                    )
                  terminator: <Id.Op_Semi _>
                )
              ]
            )
          action: [(C {<require_clean_work_tree>} {(SQ <'rewrite branches'>)})]
          spids: [221 238]
        )
      ]
      else_action: []
      redirects: []
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'tempdir='> name:tempdir)
          op: assign_op.Equal
          rhs: {<.git-rewrite>}
          spids: [250]
        )
      ]
      redirects: []
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'filter_env='> name:filter_env)
          op: assign_op.Equal
          rhs: (rhs_word.Empty)
          spids: [253]
        )
      ]
      redirects: []
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'filter_tree='> name:filter_tree)
          op: assign_op.Equal
          rhs: (rhs_word.Empty)
          spids: [255]
        )
      ]
      redirects: []
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'filter_index='> name:filter_index)
          op: assign_op.Equal
          rhs: (rhs_word.Empty)
          spids: [257]
        )
      ]
      redirects: []
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'filter_parent='> name:filter_parent)
          op: assign_op.Equal
          rhs: (rhs_word.Empty)
          spids: [259]
        )
      ]
      redirects: []
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'filter_msg='> name:filter_msg)
          op: assign_op.Equal
          rhs: {<cat>}
          spids: [261]
        )
      ]
      redirects: []
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'filter_commit='> name:filter_commit)
          op: assign_op.Equal
          rhs: (rhs_word.Empty)
          spids: [264]
        )
      ]
      redirects: []
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'filter_tag_name='> name:filter_tag_name)
          op: assign_op.Equal
          rhs: (rhs_word.Empty)
          spids: [266]
        )
      ]
      redirects: []
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'filter_subdir='> name:filter_subdir)
          op: assign_op.Equal
          rhs: (rhs_word.Empty)
          spids: [268]
        )
      ]
      redirects: []
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'orig_namespace='> name:orig_namespace)
          op: assign_op.Equal
          rhs: {<'refs/original/'>}
          spids: [270]
        )
      ]
      redirects: []
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'force='> name:force)
          op: assign_op.Equal
          rhs: (rhs_word.Empty)
          spids: [273]
        )
      ]
      redirects: []
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'prune_empty='> name:prune_empty)
          op: assign_op.Equal
          rhs: (rhs_word.Empty)
          spids: [275]
        )
      ]
      redirects: []
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'remap_to_ancestor='> name:remap_to_ancestor)
          op: assign_op.Equal
          rhs: (rhs_word.Empty)
          spids: [277]
        )
      ]
      redirects: []
    )
    (command.WhileUntil
      keyword: <Id.KW_While while>
      cond: (condition.Shell commands:[(C {<Id.Lit_Colon ':'>})])
      body: 
        (command.DoGroup
          children: [
            (command.Case
              to_match: {(DQ ($ Id.VSub_Number 1))}
              arms: [
                (case_arm
                  pat_list: [{<-->}]
                  action: [(C {<shift>}) (command.ControlFlow token:<Id.ControlFlow_Break break>)]
                  spids: [295 296 305 -1]
                )
                (case_arm
                  pat_list: [{<--force>} {<-f>}]
                  action: [
                    (C {<shift>})
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'force='> name:force)
                          op: assign_op.Equal
                          rhs: {<t>}
                          spids: [317]
                        )
                      ]
                      redirects: []
                    )
                    (command.ControlFlow token:<Id.ControlFlow_Continue continue>)
                  ]
                  spids: [308 311 324 -1]
                )
                (case_arm
                  pat_list: [{<--remap-to-ancestor>}]
                  action: [
                    (C {<shift>})
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: 
                            (sh_lhs_expr.Name
                              left: <Id.Lit_VarLike 'remap_to_ancestor='>
                              name: remap_to_ancestor
                            )
                          op: assign_op.Equal
                          rhs: {<t>}
                          spids: [338]
                        )
                      ]
                      redirects: []
                    )
                    (command.ControlFlow token:<Id.ControlFlow_Continue continue>)
                  ]
                  spids: [327 328 345 -1]
                )
                (case_arm
                  pat_list: [{<--prune-empty>}]
                  action: [
                    (C {<shift>})
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: 
                            (sh_lhs_expr.Name
                              left: <Id.Lit_VarLike 'prune_empty='>
                              name: prune_empty
                            )
                          op: assign_op.Equal
                          rhs: {<t>}
                          spids: [355]
                        )
                      ]
                      redirects: []
                    )
                    (command.ControlFlow token:<Id.ControlFlow_Continue continue>)
                  ]
                  spids: [348 349 362 -1]
                )
                (case_arm
                  pat_list: [{<-> <Id.Lit_Star '*'>}]
                  action: []
                  spids: [365 367 370 -1]
                )
                (case_arm
                  pat_list: [{<Id.Lit_Star '*'>}]
                  action: [
                    (command.Sentence
                      child: (command.ControlFlow token:<Id.ControlFlow_Break break>)
                      terminator: <Id.Op_Semi _>
                    )
                  ]
                  spids: [373 374 -1 381]
                )
              ]
              redirects: []
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'ARG='> name:ARG)
                  op: assign_op.Equal
                  rhs: {(DQ ($ Id.VSub_Number 1))}
                  spids: [389]
                )
              ]
              redirects: []
            )
            (command.Case
              to_match: {(DQ ($ Id.VSub_Pound '#'))}
              arms: [(case_arm pat_list:[{<1>}] action:[(C {<usage>})] spids:[403 404 408 -1])]
              redirects: []
            )
            (C {<shift>})
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'OPTARG='> name:OPTARG)
                  op: assign_op.Equal
                  rhs: {(DQ ($ Id.VSub_Number 1))}
                  spids: [416]
                )
              ]
              redirects: []
            )
            (C {<shift>})
            (command.Case
              to_match: {(DQ ($ Id.VSub_DollarName ARG))}
              arms: [
                (case_arm
                  pat_list: [{<-d>}]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'tempdir='> name:tempdir)
                          op: assign_op.Equal
                          rhs: {(DQ ($ Id.VSub_DollarName OPTARG))}
                          spids: [439]
                        )
                      ]
                      redirects: []
                    )
                  ]
                  spids: [435 436 445 -1]
                )
                (case_arm
                  pat_list: [{<--env-filter>}]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'filter_env='> name:filter_env)
                          op: assign_op.Equal
                          rhs: {(DQ ($ Id.VSub_DollarName OPTARG))}
                          spids: [452]
                        )
                      ]
                      redirects: []
                    )
                  ]
                  spids: [448 449 458 -1]
                )
                (case_arm
                  pat_list: [{<--tree-filter>}]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: 
                            (sh_lhs_expr.Name
                              left: <Id.Lit_VarLike 'filter_tree='>
                              name: filter_tree
                            )
                          op: assign_op.Equal
                          rhs: {(DQ ($ Id.VSub_DollarName OPTARG))}
                          spids: [465]
                        )
                      ]
                      redirects: []
                    )
                  ]
                  spids: [461 462 471 -1]
                )
                (case_arm
                  pat_list: [{<--index-filter>}]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: 
                            (sh_lhs_expr.Name
                              left: <Id.Lit_VarLike 'filter_index='>
                              name: filter_index
                            )
                          op: assign_op.Equal
                          rhs: {(DQ ($ Id.VSub_DollarName OPTARG))}
                          spids: [478]
                        )
                      ]
                      redirects: []
                    )
                  ]
                  spids: [474 475 484 -1]
                )
                (case_arm
                  pat_list: [{<--parent-filter>}]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: 
                            (sh_lhs_expr.Name
                              left: <Id.Lit_VarLike 'filter_parent='>
                              name: filter_parent
                            )
                          op: assign_op.Equal
                          rhs: {(DQ ($ Id.VSub_DollarName OPTARG))}
                          spids: [491]
                        )
                      ]
                      redirects: []
                    )
                  ]
                  spids: [487 488 497 -1]
                )
                (case_arm
                  pat_list: [{<--msg-filter>}]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'filter_msg='> name:filter_msg)
                          op: assign_op.Equal
                          rhs: {(DQ ($ Id.VSub_DollarName OPTARG))}
                          spids: [504]
                        )
                      ]
                      redirects: []
                    )
                  ]
                  spids: [500 501 510 -1]
                )
                (case_arm
                  pat_list: [{<--commit-filter>}]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: 
                            (sh_lhs_expr.Name
                              left: <Id.Lit_VarLike 'filter_commit='>
                              name: filter_commit
                            )
                          op: assign_op.Equal
                          rhs: 
                            {
                              (DQ ($ Id.VSub_DollarName functions) <'; '> ($ Id.VSub_DollarName OPTARG))
                            }
                          spids: [517]
                        )
                      ]
                      redirects: []
                    )
                  ]
                  spids: [513 514 525 -1]
                )
                (case_arm
                  pat_list: [{<--tag-name-filter>}]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: 
                            (sh_lhs_expr.Name
                              left: <Id.Lit_VarLike 'filter_tag_name='>
                              name: filter_tag_name
                            )
                          op: assign_op.Equal
                          rhs: {(DQ ($ Id.VSub_DollarName OPTARG))}
                          spids: [532]
                        )
                      ]
                      redirects: []
                    )
                  ]
                  spids: [528 529 538 -1]
                )
                (case_arm
                  pat_list: [{<--subdirectory-filter>}]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: 
                            (sh_lhs_expr.Name
                              left: <Id.Lit_VarLike 'filter_subdir='>
                              name: filter_subdir
                            )
                          op: assign_op.Equal
                          rhs: {(DQ ($ Id.VSub_DollarName OPTARG))}
                          spids: [545]
                        )
                      ]
                      redirects: []
                    )
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: 
                            (sh_lhs_expr.Name
                              left: <Id.Lit_VarLike 'remap_to_ancestor='>
                              name: remap_to_ancestor
                            )
                          op: assign_op.Equal
                          rhs: {<t>}
                          spids: [551]
                        )
                      ]
                      redirects: []
                    )
                  ]
                  spids: [541 542 555 -1]
                )
                (case_arm
                  pat_list: [{<--original>}]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: 
                            (sh_lhs_expr.Name
                              left: <Id.Lit_VarLike 'orig_namespace='>
                              name: orig_namespace
                            )
                          op: assign_op.Equal
                          rhs: 
                            {
                              (command_sub
                                left_token: <Id.Left_DollarParen '$('>
                                child: 
                                  (C {<expr>} {(DQ ($ Id.VSub_DollarName OPTARG) <'/'>)} 
                                    {<Id.Lit_Colon ':'>} {(SQ <'\\(.*[^/]\\)/*$'>)}
                                  )
                                right: <Id.Eof_RParen _>
                              ) <'/'>
                            }
                          spids: [562]
                        )
                      ]
                      redirects: []
                    )
                  ]
                  spids: [558 559 580 -1]
                )
                (case_arm
                  pat_list: [{<Id.Lit_Star '*'>}]
                  action: [(C {<usage>})]
                  spids: [583 584 590 -1]
                )
              ]
              redirects: []
            )
          ]
        )
      redirects: []
    )
    (command.Case
      to_match: {(DQ ($ Id.VSub_DollarName prune_empty) <','> ($ Id.VSub_DollarName filter_commit))}
      arms: [
        (case_arm
          pat_list: [{<Id.Lit_Comma ','>}]
          action: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'filter_commit='> name:filter_commit)
                  op: assign_op.Equal
                  rhs: {(SQ <'git commit-tree "$@"'>)}
                  spids: [612]
                )
              ]
              redirects: []
            )
          ]
          spids: [608 609 616 -1]
        )
        (case_arm
          pat_list: [{<t> <Id.Lit_Comma ','>}]
          action: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'filter_commit='> name:filter_commit)
                  op: assign_op.Equal
                  rhs: 
                    {(DQ ($ Id.VSub_DollarName functions) <';'>) 
                      (SQ <' git_commit_non_empty_tree "$@"'>)
                    }
                  spids: [623]
                )
              ]
              redirects: []
            )
          ]
          spids: [618 620 631 -1]
        )
        (case_arm
          pat_list: [{<Id.Lit_Comma ','> <Id.Lit_Star '*'>}]
          action: []
          spids: [633 635 638 -1]
        )
        (case_arm
          pat_list: [{<Id.Lit_Star '*'>}]
          action: [(C {<die>} {(DQ <'Cannot set --prune-empty and --commit-filter at the same time'>)})]
          spids: [640 641 -1 650]
        )
      ]
      redirects: []
    )
    (command.Case
      to_match: {(DQ ($ Id.VSub_DollarName force))}
      arms: [
        (case_arm
          pat_list: [{<t>}]
          action: [(C {<rm>} {<-rf>} {(DQ ($ Id.VSub_DollarName tempdir))})]
          spids: [661 662 673 -1]
        )
        (case_arm
          pat_list: [{(SQ )}]
          action: [
            (command.AndOr
              ops: [Id.Op_DAmp]
              children: [
                (C {<test>} {<-d>} {(DQ ($ Id.VSub_DollarName tempdir))})
                (C {<die>} {(DQ ($ Id.VSub_DollarName tempdir) <' already exists, please remove it'>)})
              ]
            )
          ]
          spids: [675 677 -1 698]
        )
      ]
      redirects: []
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'orig_dir='> name:orig_dir)
          op: assign_op.Equal
          rhs: 
            {
              (command_sub
                left_token: <Id.Left_DollarParen '$('>
                child: (C {<pwd>})
                right: <Id.Eof_RParen _>
              )
            }
          spids: [700]
        )
      ]
      redirects: []
    )
    (command.AndOr
      ops: [Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp Id.Op_DPipe]
      children: [
        (C {<mkdir>} {<-p>} {(DQ ($ Id.VSub_DollarName tempdir) <'/t'>)})
        (command.ShAssignment
          pairs: [
            (assign_pair
              lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'tempdir='> name:tempdir)
              op: assign_op.Equal
              rhs: 
                {
                  (DQ 
                    (command_sub
                      left_token: <Id.Left_DollarParen '$('>
                      child: 
                        (command.CommandList
                          children: [
                            (command.Sentence
                              child: (C {<cd>} {(DQ ($ Id.VSub_DollarName tempdir))})
                              terminator: <Id.Op_Semi _>
                            )
                            (C {<pwd>})
                          ]
                        )
                      right: <Id.Eof_RParen _>
                    )
                  )
                }
              spids: [716]
            )
          ]
          redirects: []
        )
        (C {<cd>} {(DQ ($ Id.VSub_DollarName tempdir) <'/t'>)})
        (command.ShAssignment
          pairs: [
            (assign_pair
              lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'workdir='> name:workdir)
              op: assign_op.Equal
              rhs: 
                {
                  (DQ 
                    (command_sub
                      left_token: <Id.Left_DollarParen '$('>
                      child: (C {<pwd>})
                      right: <Id.Eof_RParen _>
                    )
                  )
                }
              spids: [741]
            )
          ]
          redirects: []
        )
        (C {<die>} {(DQ )})
      ]
    )
    (C {<trap>} {(SQ <'cd "$orig_dir"; rm -rf "$tempdir"'>)} {<0>})
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'ORIG_GIT_DIR='> name:ORIG_GIT_DIR)
          op: assign_op.Equal
          rhs: {(DQ ($ Id.VSub_DollarName GIT_DIR))}
          spids: [768]
        )
      ]
      redirects: []
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'ORIG_GIT_WORK_TREE='> name:ORIG_GIT_WORK_TREE)
          op: assign_op.Equal
          rhs: {(DQ ($ Id.VSub_DollarName GIT_WORK_TREE))}
          spids: [773]
        )
      ]
      redirects: []
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: 
            (sh_lhs_expr.Name
              left: <Id.Lit_VarLike 'ORIG_GIT_INDEX_FILE='>
              name: ORIG_GIT_INDEX_FILE
            )
          op: assign_op.Equal
          rhs: {(DQ ($ Id.VSub_DollarName GIT_INDEX_FILE))}
          spids: [778]
        )
      ]
      redirects: []
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'GIT_WORK_TREE='> name:GIT_WORK_TREE)
          op: assign_op.Equal
          rhs: {<.>}
          spids: [783]
        )
      ]
      redirects: []
    )
    (C {<export>} {<GIT_DIR>} {<GIT_WORK_TREE>})
    (command.AndOr
      ops: [Id.Op_DPipe]
      children: [
        (command.Simple
          words: [{<git>} {<for-each-ref>}]
          redirects: [
            (redir
              op: <Id.Redir_Great '>'>
              loc: (redir_loc.Fd fd:1)
              arg: {(DQ ($ Id.VSub_DollarName tempdir)) <'/backup-refs'>}
            )
          ]
          more_env: []
          do_fork: T
        )
        (command.ControlFlow token:<Id.ControlFlow_Exit exit>)
      ]
    )
    (command.WhileUntil
      keyword: <Id.KW_While while>
      cond: (condition.Shell commands:[(C {<read>} {<sha1>} {<type>} {<name>})])
      body: 
        (command.DoGroup
          children: [
            (command.Case
              to_match: {(DQ ($ Id.VSub_DollarName force) <','> ($ Id.VSub_DollarName name))}
              arms: [
                (case_arm
                  pat_list: [
                    {<Id.Lit_Comma ','> ($ Id.VSub_DollarName orig_namespace) <Id.Lit_Star '*'>}
                  ]
                  action: [
                    (C {<die>} 
                      {
                        (DQ <'Cannot create a new backup.\n'> <'A previous backup already exists in '> 
                          ($ Id.VSub_DollarName orig_namespace) <'\n'> <'Force overwriting the backup with -f'>
                        )
                      }
                    )
                  ]
                  spids: [835 838 852 -1]
                )
                (case_arm
                  pat_list: [
                    {<t> <Id.Lit_Comma ','> ($ Id.VSub_DollarName orig_namespace) <Id.Lit_Star '*'>}
                  ]
                  action: [
                    (C {<git>} {<update-ref>} {<-d>} {(DQ ($ Id.VSub_DollarName name))} 
                      {($ Id.VSub_DollarName sha1)}
                    )
                  ]
                  spids: [855 859 875 -1]
                )
              ]
              redirects: []
            )
          ]
        )
      redirects: [
        (redir
          op: <Id.Redir_Less '<'>
          loc: (redir_loc.Fd fd:0)
          arg: {(DQ ($ Id.VSub_DollarName tempdir)) <'/backup-refs'>}
        )
      ]
    )
    (command.AndOr
      ops: [Id.Op_DPipe]
      children: [
        (command.Simple
          words: [
            {<git>}
            {<rev-parse>}
            {<--no-flags>}
            {<--revs-only>}
            {<--symbolic-full-name>}
            {<--default>}
            {<HEAD>}
            {(DQ ($ Id.VSub_At '@'))}
          ]
          redirects: [
            (redir
              op: <Id.Redir_Great '>'>
              loc: (redir_loc.Fd fd:1)
              arg: {(DQ ($ Id.VSub_DollarName tempdir)) <'/raw-heads'>}
            )
          ]
          more_env: []
          do_fork: T
        )
        (command.ControlFlow token:<Id.ControlFlow_Exit exit>)
      ]
    )
    (command.Simple
      words: [{<sed>} {<-e>} {(SQ <'/^^/d'>)} {(DQ ($ Id.VSub_DollarName tempdir)) <'/raw-heads'>}]
      redirects: [
        (redir
          op: <Id.Redir_Great '>'>
          loc: (redir_loc.Fd fd:1)
          arg: {(DQ ($ Id.VSub_DollarName tempdir)) <'/heads'>}
        )
      ]
      more_env: []
      do_fork: T
    )
    (command.AndOr
      ops: [Id.Op_DPipe]
      children: [
        (C {<test>} {<-s>} {(DQ ($ Id.VSub_DollarName tempdir)) <'/heads'>})
        (C {<die>} {(DQ <'Which ref do you want to rewrite?'>)})
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'GIT_INDEX_FILE='> name:GIT_INDEX_FILE)
          op: assign_op.Equal
          rhs: 
            {
              (DQ 
                (command_sub
                  left_token: <Id.Left_DollarParen '$('>
                  child: (C {<pwd>})
                  right: <Id.Eof_RParen _>
                ) <'/../index'>
              )
            }
          spids: [963]
        )
      ]
      redirects: []
    )
    (C {<export>} {<GIT_INDEX_FILE>})
    (command.AndOr
      ops: [Id.Op_DPipe]
      children: [(C {<mkdir>} {<'../map'>}) (C {<die>} {(DQ <'Could not create map/ directory'>)})]
    )
    (command.AndOr
      ops: [Id.Op_DPipe]
      children: [
        (command.ShAssignment
          pairs: [
            (assign_pair
              lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'nonrevs='> name:nonrevs)
              op: assign_op.Equal
              rhs: 
                {
                  (command_sub
                    left_token: <Id.Left_DollarParen '$('>
                    child: (C {<git>} {<rev-parse>} {<--no-revs>} {(DQ ($ Id.VSub_At '@'))})
                    right: <Id.Eof_RParen _>
                  )
                }
              spids: [995]
            )
          ]
          redirects: []
        )
        (command.ControlFlow token:<Id.ControlFlow_Exit exit>)
      ]
    )
    (command.If
      arms: [
        (if_arm
          cond: 
            (condition.Shell
              commands: [(C {<test>} {<-z>} {(DQ ($ Id.VSub_DollarName nonrevs))})]
            )
          action: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'dashdash='> name:dashdash)
                  op: assign_op.Equal
                  rhs: {<-->}
                  spids: [1025]
                )
              ]
              redirects: []
            )
          ]
          spids: [1012 1022]
        )
      ]
      else_action: [
        (command.ShAssignment
          pairs: [
            (assign_pair
              lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'dashdash='> name:dashdash)
              op: assign_op.Equal
              rhs: (rhs_word.Empty)
              spids: [1031]
            )
          ]
          redirects: []
        )
        (command.ShAssignment
          pairs: [
            (assign_pair
              lhs: 
                (sh_lhs_expr.Name
                  left: <Id.Lit_VarLike 'remap_to_ancestor='>
                  name: remap_to_ancestor
                )
              op: assign_op.Equal
              rhs: {<t>}
              spids: [1034]
            )
          ]
          redirects: []
        )
      ]
      redirects: []
    )
    (command.Simple
      words: [{<git>} {<rev-parse>} {<--revs-only>} {(DQ ($ Id.VSub_At '@'))}]
      redirects: [(redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<'../parse'>})]
      more_env: []
      do_fork: T
    )
    (command.Case
      to_match: {(DQ ($ Id.VSub_DollarName filter_subdir))}
      arms: [
        (case_arm
          pat_list: [{(DQ )}]
          action: [
            (C {<eval>} {<set>} {<-->} 
              {
                (DQ 
                  (command_sub
                    left_token: <Id.Left_DollarParen '$('>
                    child: (C {<git>} {<rev-parse>} {<--sq>} {<--no-revs>} {(DQ ($ Id.VSub_At '@'))})
                    right: <Id.Eof_RParen _>
                  )
                )
              }
            )
          ]
          spids: [1062 1064 1090 -1]
        )
        (case_arm
          pat_list: [{<Id.Lit_Star '*'>}]
          action: [
            (C {<eval>} {<set>} {<-->} 
              {
                (DQ 
                  (command_sub
                    left_token: <Id.Left_DollarParen '$('>
                    child: 
                      (C {<git>} {<rev-parse>} {<--sq>} {<--no-revs>} {(DQ ($ Id.VSub_At '@'))} 
                        {($ Id.VSub_DollarName dashdash)} {(DQ ($ Id.VSub_DollarName filter_subdir))}
                      )
                    right: <Id.Eof_RParen _>
                  )
                )
              }
            )
          ]
          spids: [1092 1093 1127 -1]
        )
      ]
      redirects: []
    )
    (command.AndOr
      ops: [Id.Op_DPipe]
      children: [
        (command.Simple
          words: [
            {<git>}
            {<rev-list>}
            {<--reverse>}
            {<--topo-order>}
            {<--default>}
            {<HEAD>}
            {<--parents>}
            {<--simplify-merges>}
            {<--stdin>}
            {(DQ ($ Id.VSub_At '@'))}
          ]
          redirects: [
            (redir op:<Id.Redir_Less '<'> loc:(redir_loc.Fd fd:0) arg:{<'../parse'>})
            (redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<'../revs'>})
          ]
          more_env: []
          do_fork: T
        )
        (C {<die>} {(DQ <'Could not get the commits'>)})
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'commits='> name:commits)
          op: assign_op.Equal
          rhs: 
            {
              (command_sub
                left_token: <Id.Left_DollarParen '$('>
                child: 
                  (command.Pipeline
                    children: [
                      (command.Simple
                        words: [{<wc>} {<-l>}]
                        redirects: [
                          (redir
                            op: <Id.Redir_Less '<'>
                            loc: (redir_loc.Fd fd:0)
                            arg: {<'../revs'>}
                          )
                        ]
                        more_env: []
                        do_fork: T
                      )
                      (C {<tr>} {<-d>} {(DQ <' '>)})
                    ]
                    negated: F
                    stderr_indices: []
                  )
                right: <Id.Eof_RParen _>
              )
            }
          spids: [1171]
        )
      ]
      redirects: []
    )
    (command.AndOr
      ops: [Id.Op_DAmp]
      children: [
        (C {<test>} {($ Id.VSub_DollarName commits)} {<-eq>} {<0>})
        (C {<die>} {(DQ <'Found nothing to rewrite'>)})
      ]
    )
    (command.ShFunction
      name: report_progress
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.AndOr
                          ops: [Id.Op_DAmp]
                          children: [
                            (C {<test>} {<-n>} {(DQ ($ Id.VSub_DollarName progress))})
                            (C {<test>} {($ Id.VSub_DollarName git_filter_branch__commit_count)} {<-gt>} 
                              {($ Id.VSub_DollarName next_sample_at)}
                            )
                          ]
                        )
                      ]
                    )
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'count='> name:count)
                          op: assign_op.Equal
                          rhs: {($ Id.VSub_DollarName git_filter_branch__commit_count)}
                          spids: [1245]
                        )
                      ]
                      redirects: []
                    )
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'now='> name:now)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (command_sub
                                left_token: <Id.Left_DollarParen '$('>
                                child: (C {<date>} {<Id.Lit_Other '+'> <Id.Lit_Other '%'> <s>})
                                right: <Id.Eof_RParen _>
                              )
                            }
                          spids: [1250]
                        )
                      ]
                      redirects: []
                    )
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'elapsed='> name:elapsed)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (word_part.ArithSub
                                anode: 
                                  (arith_expr.Binary
                                    op_id: Id.Arith_Minus
                                    left: {($ Id.VSub_DollarName now)}
                                    right: {($ Id.VSub_DollarName start_timestamp)}
                                  )
                              )
                            }
                          spids: [1260]
                        )
                      ]
                      redirects: []
                    )
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'remaining='> name:remaining)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (word_part.ArithSub
                                anode: 
                                  (arith_expr.Binary
                                    op_id: Id.Arith_Slash
                                    left: 
                                      (arith_expr.Binary
                                        op_id: Id.Arith_Star
                                        left: 
                                          (arith_expr.Binary
                                            op_id: Id.Arith_Minus
                                            left: {($ Id.VSub_DollarName commits)}
                                            right: {($ Id.VSub_DollarName count)}
                                          )
                                        right: {($ Id.VSub_DollarName elapsed)}
                                      )
                                    right: {($ Id.VSub_DollarName count)}
                                  )
                              )
                            }
                          spids: [1271]
                        )
                      ]
                      redirects: []
                    )
                    (command.If
                      arms: [
                        (if_arm
                          cond: 
                            (condition.Shell
                              commands: [(C {<test>} {($ Id.VSub_DollarName elapsed)} {<-gt>} {<0>})]
                            )
                          action: [
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: 
                                    (sh_lhs_expr.Name
                                      left: <Id.Lit_VarLike 'next_sample_at='>
                                      name: next_sample_at
                                    )
                                  op: assign_op.Equal
                                  rhs: 
                                    {
                                      (word_part.ArithSub
                                        anode: 
                                          (arith_expr.Binary
                                            op_id: Id.Arith_Slash
                                            left: 
                                              (arith_expr.Binary
                                                op_id: Id.Arith_Star
                                                left: 
                                                  (arith_expr.Binary
                                                    op_id: Id.Arith_Plus
                                                    left: {($ Id.VSub_DollarName elapsed)}
                                                    right: {<Id.Lit_Digits 1>}
                                                  )
                                                right: {($ Id.VSub_DollarName count)}
                                              )
                                            right: {($ Id.VSub_DollarName elapsed)}
                                          )
                                      )
                                    }
                                  spids: [1308]
                                )
                              ]
                              redirects: []
                            )
                          ]
                          spids: [1294 1305]
                        )
                      ]
                      else_action: [
                        (command.ShAssignment
                          pairs: [
                            (assign_pair
                              lhs: 
                                (sh_lhs_expr.Name
                                  left: <Id.Lit_VarLike 'next_sample_at='>
                                  name: next_sample_at
                                )
                              op: assign_op.Equal
                              rhs: 
                                {
                                  (word_part.ArithSub
                                    anode: 
                                      (arith_expr.Binary
                                        op_id: Id.Arith_Plus
                                        left: {($ Id.VSub_DollarName next_sample_at)}
                                        right: {<Id.Lit_Digits 1>}
                                      )
                                  )
                                }
                              spids: [1334]
                            )
                          ]
                          redirects: []
                        )
                      ]
                      redirects: []
                    )
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'progress='> name:progress)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (DQ <' ('> ($ Id.VSub_DollarName elapsed) <' seconds passed, remaining '> 
                                ($ Id.VSub_DollarName remaining) <' predicted)'>
                              )
                            }
                          spids: [1348]
                        )
                      ]
                      redirects: []
                    )
                  ]
                  spids: [1220 1242]
                )
              ]
              else_action: []
              redirects: []
            )
            (C {<printf>} 
              {
                (DQ <Id.Lit_BadBackslash '\\'> <'rRewrite '> ($ Id.VSub_DollarName commit) <' ('> 
                  ($ Id.VSub_DollarName count) <'/'> ($ Id.VSub_DollarName commits) <')'> ($ Id.VSub_DollarName progress) <'    '>
                )
              }
            )
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: 
            (sh_lhs_expr.Name
              left: <Id.Lit_VarLike 'git_filter_branch__commit_count='>
              name: git_filter_branch__commit_count
            )
          op: assign_op.Equal
          rhs: {<0>}
          spids: [1379]
        )
      ]
      redirects: []
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'progress='> name:progress)
          op: assign_op.Equal
          rhs: (rhs_word.Empty)
          spids: [1383]
        )
        (assign_pair
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'start_timestamp='> name:start_timestamp)
          op: assign_op.Equal
          rhs: (rhs_word.Empty)
          spids: [1385]
        )
      ]
      redirects: []
    )
    (command.If
      arms: [
        (if_arm
          cond: 
            (condition.Shell
              commands: [
                (command.Pipeline
                  children: [
                    (command.Simple
                      words: [{<date>} {(SQ <'+%s'>)}]
                      redirects: [
                        (redir
                          op: <Id.Redir_Great '2>'>
                          loc: (redir_loc.Fd fd:2)
                          arg: {<'/dev/null'>}
                        )
                      ]
                      more_env: []
                      do_fork: T
                    )
                    (C {<grep>} {<-q>} {(SQ <'^[0-9][0-9]*$'>)})
                  ]
                  negated: F
                  stderr_indices: []
                )
              ]
            )
          action: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'next_sample_at='> name:next_sample_at)
                  op: assign_op.Equal
                  rhs: {<0>}
                  spids: [1411]
                )
              ]
              redirects: []
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'progress='> name:progress)
                  op: assign_op.Equal
                  rhs: {(DQ <'dummy to ensure this is not empty'>)}
                  spids: [1415]
                )
              ]
              redirects: []
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: 
                    (sh_lhs_expr.Name
                      left: <Id.Lit_VarLike 'start_timestamp='>
                      name: start_timestamp
                    )
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: <Id.Left_DollarParen '$('>
                        child: (C {<date>} {(SQ <'+%s'>)})
                        right: <Id.Eof_RParen _>
                      )
                    }
                  spids: [1421]
                )
              ]
              redirects: []
            )
          ]
          spids: [1387 1408]
        )
      ]
      else_action: []
      redirects: []
    )
    (command.If
      arms: [
        (if_arm
          cond: 
            (condition.Shell
              commands: [
                (command.AndOr
                  ops: [Id.Op_DPipe Id.Op_DPipe]
                  children: [
                    (C {<test>} {<-n>} {(DQ ($ Id.VSub_DollarName filter_index))})
                    (C {<test>} {<-n>} {(DQ ($ Id.VSub_DollarName filter_tree))})
                    (C {<test>} {<-n>} {(DQ ($ Id.VSub_DollarName filter_subdir))})
                  ]
                )
              ]
            )
          action: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'need_index='> name:need_index)
                  op: assign_op.Equal
                  rhs: {<t>}
                  spids: [1468]
                )
              ]
              redirects: []
            )
          ]
          spids: [1433 1465]
        )
      ]
      else_action: [
        (command.ShAssignment
          pairs: [
            (assign_pair
              lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'need_index='> name:need_index)
              op: assign_op.Equal
              rhs: (rhs_word.Empty)
              spids: [1474]
            )
          ]
          redirects: []
        )
      ]
      redirects: []
    )
    (command.WhileUntil
      keyword: <Id.KW_While while>
      cond: 
        (condition.Shell
          commands: [
            (command.Sentence
              child: (C {<read>} {<commit>} {<parents>})
              terminator: <Id.Op_Semi _>
            )
          ]
        )
      body: 
        (command.DoGroup
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: 
                    (sh_lhs_expr.Name
                      left: <Id.Lit_VarLike 'git_filter_branch__commit_count='>
                      name: git_filter_branch__commit_count
                    )
                  op: assign_op.Equal
                  rhs: 
                    {
                      (word_part.ArithSub
                        anode: 
                          (arith_expr.Binary
                            op_id: Id.Arith_Plus
                            left: {($ Id.VSub_DollarName git_filter_branch__commit_count)}
                            right: {<Id.Lit_Digits 1>}
                          )
                      )
                    }
                  spids: [1491]
                )
              ]
              redirects: []
            )
            (C {<report_progress>})
            (command.AndOr
              ops: [Id.Op_DPipe]
              children: [
                (command.Case
                  to_match: {(DQ ($ Id.VSub_DollarName filter_subdir))}
                  arms: [
                    (case_arm
                      pat_list: [{(DQ )}]
                      action: [
                        (command.If
                          arms: [
                            (if_arm
                              cond: 
                                (condition.Shell
                                  commands: [
                                    (C {<test>} {<-n>} {(DQ ($ Id.VSub_DollarName need_index))})
                                  ]
                                )
                              action: [
                                (command.Simple
                                  words: [
                                    {<git>}
                                    {<read-tree>}
                                    {<-i>}
                                    {<-m>}
                                    {($ Id.VSub_DollarName commit)}
                                  ]
                                  redirects: []
                                  more_env: [
                                    (env_pair
                                      name: GIT_ALLOW_NULL_SHA1
                                      val: {<1>}
                                      spids: [1533]
                                    )
                                  ]
                                  do_fork: T
                                )
                              ]
                              spids: [1519 1530]
                            )
                          ]
                          else_action: []
                          redirects: []
                        )
                      ]
                      spids: [1514 1516 1550 -1]
                    )
                    (case_arm
                      pat_list: [{<Id.Lit_Star '*'>}]
                      action: [
                        (command.AndOr
                          ops: [Id.Op_DPipe]
                          children: [
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'err='> name:err)
                                  op: assign_op.Equal
                                  rhs: 
                                    {
                                      (command_sub
                                        left_token: <Id.Left_DollarParen '$('>
                                        child: 
                                          (command.Simple
                                            words: [
                                              {<git>}
                                              {<read-tree>}
                                              {<-i>}
                                              {<-m>}
                                              {($ Id.VSub_DollarName commit) <Id.Lit_Colon ':'> 
                                                (DQ ($ Id.VSub_DollarName filter_subdir))
                                              }
                                            ]
                                            redirects: [
                                              (redir
                                                op: <Id.Redir_GreatAnd '2>&'>
                                                loc: (redir_loc.Fd fd:2)
                                                arg: {<1>}
                                              )
                                            ]
                                            more_env: [
                                              (env_pair
                                                name: GIT_ALLOW_NULL_SHA1
                                                val: {<1>}
                                                spids: [1563]
                                              )
                                            ]
                                            do_fork: T
                                          )
                                        right: <Id.Eof_RParen _>
                                      )
                                    }
                                  spids: [1561]
                                )
                              ]
                              redirects: []
                            )
                            (BraceGroup
                              left: <Id.Lit_LBrace '{'>
                              children: [
                                (command.If
                                  arms: [
                                    (if_arm
                                      cond: 
                                        (condition.Shell
                                          commands: [
                                            (command.Pipeline
                                              children: [
                                                (C {<git>} {<rev-parse>} {<-q>} {<--verify>} 
                                                  {($ Id.VSub_DollarName commit) <Id.Lit_Colon ':'> 
                                                    (DQ ($ Id.VSub_DollarName filter_subdir))
                                                  }
                                                )
                                              ]
                                              negated: T
                                              stderr_indices: []
                                            )
                                          ]
                                        )
                                      action: [
                                        (C {<rm>} {<-f>} {(DQ ($ Id.VSub_DollarName GIT_INDEX_FILE))})
                                      ]
                                      spids: [1591 1610]
                                    )
                                  ]
                                  else_action: [
                                    (command.Simple
                                      words: [{<echo>} {(DQ ($ Id.VSub_DollarName err))}]
                                      redirects: [
                                        (redir
                                          op: <Id.Redir_GreatAnd '>&'>
                                          loc: (redir_loc.Fd fd:1)
                                          arg: {<2>}
                                        )
                                      ]
                                      more_env: []
                                      do_fork: T
                                    )
                                    (C {<false>})
                                  ]
                                  redirects: []
                                )
                              ]
                              redirects: []
                              right: <Id.Lit_RBrace '}'>
                            )
                          ]
                        )
                      ]
                      spids: [1553 1554 -1 1644]
                    )
                  ]
                  redirects: []
                )
                (C {<die>} {(DQ <'Could not initialize the index'>)})
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'GIT_COMMIT='> name:GIT_COMMIT)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_DollarName commit)}
                  spids: [1656]
                )
              ]
              redirects: []
            )
            (C {<export>} {<GIT_COMMIT>})
            (command.AndOr
              ops: [Id.Op_DPipe]
              children: [
                (command.Simple
                  words: [{<git>} {<cat-file>} {<commit>} {(DQ ($ Id.VSub_DollarName commit))}]
                  redirects: [
                    (redir
                      op: <Id.Redir_Great '>'>
                      loc: (redir_loc.Fd fd:1)
                      arg: {<'../commit'>}
                    )
                  ]
                  more_env: []
                  do_fork: T
                )
                (C {<die>} {(DQ <'Cannot read commit '> ($ Id.VSub_DollarName commit))})
              ]
            )
            (command.AndOr
              ops: [Id.Op_DPipe]
              children: [
                (C {<eval>} 
                  {
                    (DQ 
                      (command_sub
                        left_token: <Id.Left_DollarParen '$('>
                        child: 
                          (command.Simple
                            words: [{<set_ident>}]
                            redirects: [
                              (redir
                                op: <Id.Redir_Less '<'>
                                loc: (redir_loc.Fd fd:0)
                                arg: {<'../commit'>}
                              )
                            ]
                            more_env: []
                            do_fork: T
                          )
                        right: <Id.Eof_RParen _>
                      )
                    )
                  }
                )
                (C {<die>} 
                  {(DQ <'setting author/committer failed for commit '> ($ Id.VSub_DollarName commit))}
                )
              ]
            )
            (command.AndOr
              ops: [Id.Op_DPipe]
              children: [
                (command.Simple
                  words: [{<eval>} {(DQ ($ Id.VSub_DollarName filter_env))}]
                  redirects: [
                    (redir
                      op: <Id.Redir_Less '<'>
                      loc: (redir_loc.Fd fd:0)
                      arg: {<'/dev/null'>}
                    )
                  ]
                  more_env: []
                  do_fork: T
                )
                (C {<die>} {(DQ <'env filter failed: '> ($ Id.VSub_DollarName filter_env))})
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (C {<Id.Lit_LBracket '['>} {(DQ ($ Id.VSub_DollarName filter_tree))} 
                              {<Id.Lit_RBracket ']'>}
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [
                    (command.AndOr
                      ops: [Id.Op_DPipe]
                      children: [
                        (C {<git>} {<checkout-index>} {<-f>} {<-u>} {<-a>})
                        (C {<die>} {(DQ <'Could not checkout the index'>)})
                      ]
                    )
                    (C {<git>} {<clean>} {<-d>} {<-q>} {<-f>} {<-x>})
                    (command.AndOr
                      ops: [Id.Op_DPipe]
                      children: [
                        (command.Simple
                          words: [{<eval>} {(DQ ($ Id.VSub_DollarName filter_tree))}]
                          redirects: [
                            (redir
                              op: <Id.Redir_Less '<'>
                              loc: (redir_loc.Fd fd:0)
                              arg: {<'/dev/null'>}
                            )
                          ]
                          more_env: []
                          do_fork: T
                        )
                        (C {<die>} {(DQ <'tree filter failed: '> ($ Id.VSub_DollarName filter_tree))})
                      ]
                    )
                    (command.AndOr
                      ops: [Id.Op_DPipe]
                      children: [
                        (command.Subshell
                          child: 
                            (command.AndOr
                              ops: [Id.Op_DAmp]
                              children: [
                                (C {<git>} {<diff-index>} {<-r>} {<--name-only>} {<--ignore-submodules>} 
                                  {($ Id.VSub_DollarName commit)} {<-->}
                                )
                                (C {<git>} {<ls-files>} {<--others>})
                              ]
                            )
                          redirects: [
                            (redir
                              op: <Id.Redir_Great '>'>
                              loc: (redir_loc.Fd fd:1)
                              arg: {(DQ ($ Id.VSub_DollarName tempdir)) <'/tree-state'>}
                            )
                          ]
                        )
                        (command.ControlFlow token:<Id.ControlFlow_Exit exit>)
                      ]
                    )
                    (command.AndOr
                      ops: [Id.Op_DPipe]
                      children: [
                        (command.Simple
                          words: [{<git>} {<update-index>} {<--add>} {<--replace>} {<--remove>} {<--stdin>}]
                          redirects: [
                            (redir
                              op: <Id.Redir_Less '<'>
                              loc: (redir_loc.Fd fd:0)
                              arg: {(DQ ($ Id.VSub_DollarName tempdir)) <'/tree-state'>}
                            )
                          ]
                          more_env: []
                          do_fork: T
                        )
                        (command.ControlFlow token:<Id.ControlFlow_Exit exit>)
                      ]
                    )
                  ]
                  spids: [1734 1745]
                )
              ]
              else_action: []
              redirects: []
            )
            (command.AndOr
              ops: [Id.Op_DPipe]
              children: [
                (command.Simple
                  words: [{<eval>} {(DQ ($ Id.VSub_DollarName filter_index))}]
                  redirects: [
                    (redir
                      op: <Id.Redir_Less '<'>
                      loc: (redir_loc.Fd fd:0)
                      arg: {<'/dev/null'>}
                    )
                  ]
                  more_env: []
                  do_fork: T
                )
                (C {<die>} {(DQ <'index filter failed: '> ($ Id.VSub_DollarName filter_index))})
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'parentstr='> name:parentstr)
                  op: assign_op.Equal
                  rhs: (rhs_word.Empty)
                  spids: [1904]
                )
              ]
              redirects: []
            )
            (command.ForEach
              iter_names: [parent]
              iterable: (for_iter.Words words:[{($ Id.VSub_DollarName parents)}])
              body: 
                (command.DoGroup
                  children: [
                    (command.ForEach
                      iter_names: [reparent]
                      iterable: 
                        (for_iter.Words
                          words: [
                            {
                              (command_sub
                                left_token: <Id.Left_DollarParen '$('>
                                child: (C {<map>} {(DQ ($ Id.VSub_DollarName parent))})
                                right: <Id.Eof_RParen _>
                              )
                            }
                          ]
                        )
                      body: 
                        (command.DoGroup
                          children: [
                            (command.Case
                              to_match: {(DQ ($ Id.VSub_DollarName parentstr) <' '>)}
                              arms: [
                                (case_arm
                                  pat_list: [
                                    {<Id.Lit_Star '*'> 
                                      (DQ <' -p '> ($ Id.VSub_DollarName reparent) <' '>) <Id.Lit_Star '*'>
                                    }
                                  ]
                                  action: []
                                  spids: [1947 1954 1957 -1]
                                )
                                (case_arm
                                  pat_list: [{<Id.Lit_Star '*'>}]
                                  action: [
                                    (command.ShAssignment
                                      pairs: [
                                        (assign_pair
                                          lhs: 
                                            (sh_lhs_expr.Name
                                              left: <Id.Lit_VarLike 'parentstr='>
                                              name: parentstr
                                            )
                                          op: assign_op.Equal
                                          rhs: 
                                            {
                                              (DQ ($ Id.VSub_DollarName parentstr) <' -p '> 
                                                ($ Id.VSub_DollarName reparent)
                                              )
                                            }
                                          spids: [1964]
                                        )
                                      ]
                                      redirects: []
                                    )
                                  ]
                                  spids: [1960 1961 1972 -1]
                                )
                              ]
                              redirects: []
                            )
                          ]
                        )
                      redirects: []
                    )
                  ]
                )
              redirects: []
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (C {<Id.Lit_LBracket '['>} {(DQ ($ Id.VSub_DollarName filter_parent))} 
                              {<Id.Lit_RBracket ']'>}
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [
                    (command.AndOr
                      ops: [Id.Op_DPipe]
                      children: [
                        (command.ShAssignment
                          pairs: [
                            (assign_pair
                              lhs: 
                                (sh_lhs_expr.Name
                                  left: <Id.Lit_VarLike 'parentstr='>
                                  name: parentstr
                                )
                              op: assign_op.Equal
                              rhs: 
                                {
                                  (DQ 
                                    (command_sub
                                      left_token: <Id.Left_DollarParen '$('>
                                      child: 
                                        (command.Pipeline
                                          children: [
                                            (C {<echo>} {(DQ ($ Id.VSub_DollarName parentstr))})
                                            (C {<eval>} {(DQ ($ Id.VSub_DollarName filter_parent))})
                                          ]
                                          negated: F
                                          stderr_indices: []
                                        )
                                      right: <Id.Eof_RParen _>
                                    )
                                  )
                                }
                              spids: [1998]
                            )
                          ]
                          redirects: []
                        )
                        (C {<die>} 
                          {(DQ <'parent filter failed: '> ($ Id.VSub_DollarName filter_parent))}
                        )
                      ]
                    )
                  ]
                  spids: [1984 1995]
                )
              ]
              else_action: []
              redirects: []
            )
            (command.AndOr
              ops: [Id.Op_DPipe]
              children: [
                (command.Pipeline
                  children: [
                    (BraceGroup
                      left: <Id.Lit_LBrace '{'>
                      children: [
                        (command.WhileUntil
                          keyword: <Id.KW_While while>
                          cond: 
                            (condition.Shell
                              commands: [
                                (command.AndOr
                                  ops: [Id.Op_DAmp]
                                  children: [
                                    (command.Simple
                                      words: [{<read>} {<-r>} {<header_line>}]
                                      redirects: []
                                      more_env: [(env_pair name:IFS val:{(SQ )} spids:[2037])]
                                      do_fork: T
                                    )
                                    (C {<test>} {<-n>} {(DQ ($ Id.VSub_DollarName header_line))})
                                  ]
                                )
                              ]
                            )
                          body: 
                            (command.DoGroup
                              children: [
                                (command.Sentence
                                  child: (C {<Id.Lit_Colon ':'>})
                                  terminator: <Id.Op_Semi _>
                                )
                              ]
                            )
                          redirects: []
                        )
                        (C {<cat>})
                      ]
                      redirects: [
                        (redir
                          op: <Id.Redir_Less '<'>
                          loc: (redir_loc.Fd fd:0)
                          arg: {<'../commit'>}
                        )
                      ]
                      right: <Id.Lit_RBrace '}'>
                    )
                    (command.Simple
                      words: [{<eval>} {(DQ ($ Id.VSub_DollarName filter_msg))}]
                      redirects: [
                        (redir
                          op: <Id.Redir_Great '>'>
                          loc: (redir_loc.Fd fd:1)
                          arg: {<'../message'>}
                        )
                      ]
                      more_env: []
                      do_fork: T
                    )
                  ]
                  negated: F
                  stderr_indices: []
                )
                (C {<die>} {(DQ <'msg filter failed: '> ($ Id.VSub_DollarName filter_msg))})
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [(C {<test>} {<-n>} {(DQ ($ Id.VSub_DollarName need_index))})]
                    )
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'tree='> name:tree)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (command_sub
                                left_token: <Id.Left_DollarParen '$('>
                                child: (C {<git>} {<write-tree>})
                                right: <Id.Eof_RParen _>
                              )
                            }
                          spids: [2123]
                        )
                      ]
                      redirects: []
                    )
                  ]
                  spids: [2109 2120]
                )
              ]
              else_action: [
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'tree='> name:tree)
                      op: assign_op.Equal
                      rhs: 
                        {
                          (command_sub
                            left_token: <Id.Left_DollarParen '$('>
                            child: 
                              (C {<git>} {<rev-parse>} {(DQ ($ Id.VSub_DollarName commit) <'^{tree}'>)})
                            right: <Id.Eof_RParen _>
                          )
                        }
                      spids: [2134]
                    )
                  ]
                  redirects: []
                )
              ]
              redirects: []
            )
            (command.AndOr
              ops: [Id.Op_DPipe]
              children: [
                (command.Simple
                  words: [
                    {<Id.Lit_Splice '@SHELL_PATH'> <Id.Lit_At '@'>}
                    {<-c>}
                    {(DQ ($ Id.VSub_DollarName filter_commit))}
                    {(DQ <'git commit-tree'>)}
                    {(DQ ($ Id.VSub_DollarName tree))}
                    {($ Id.VSub_DollarName parentstr)}
                  ]
                  redirects: [
                    (redir
                      op: <Id.Redir_Less '<'>
                      loc: (redir_loc.Fd fd:0)
                      arg: {<'../message'>}
                    )
                    (redir
                      op: <Id.Redir_Great '>'>
                      loc: (redir_loc.Fd fd:1)
                      arg: {<'../map/'> ($ Id.VSub_DollarName commit)}
                    )
                  ]
                  more_env: [
                    (env_pair
                      name: workdir
                      val: {($ Id.VSub_DollarName workdir)}
                      spids: [2150]
                    )
                  ]
                  do_fork: T
                )
                (C {<die>} {(DQ <'could not write rewritten commit'>)})
              ]
            )
          ]
        )
      redirects: [(redir op:<Id.Redir_Less '<'> loc:(redir_loc.Fd fd:0) arg:{<'../revs'>})]
    )
    (command.If
      arms: [
        (if_arm
          cond: 
            (condition.Shell
              commands: [
                (C {<test>} {(DQ ($ Id.VSub_DollarName remap_to_ancestor))} {<Id.Lit_Equals '='>} {<t>})
              ]
            )
          action: [
            (command.WhileUntil
              keyword: <Id.KW_While while>
              cond: (condition.Shell commands:[(C {<read>} {<ref>})])
              body: 
                (command.DoGroup
                  children: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'sha1='> name:sha1)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (command_sub
                                left_token: <Id.Left_DollarParen '$('>
                                child: 
                                  (C {<git>} {<rev-parse>} 
                                    {(DQ ($ Id.VSub_DollarName ref)) <Id.Lit_Other '^'> <0>}
                                  )
                                right: <Id.Eof_RParen _>
                              )
                            }
                          spids: [2239]
                        )
                      ]
                      redirects: []
                    )
                    (command.AndOr
                      ops: [Id.Op_DAmp]
                      children: [
                        (C {<test>} {<-f>} 
                          {(DQ ($ Id.VSub_DollarName workdir)) <'/../map/'> 
                            ($ Id.VSub_DollarName sha1)
                          }
                        )
                        (command.ControlFlow
                          token: <Id.ControlFlow_Continue continue>
                        )
                      ]
                    )
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'ancestor='> name:ancestor)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (command_sub
                                left_token: <Id.Left_DollarParen '$('>
                                child: 
                                  (C {<git>} {<rev-list>} {<--simplify-merges>} {<-1>} 
                                    {(DQ ($ Id.VSub_DollarName ref))} {(DQ ($ Id.VSub_At '@'))}
                                  )
                                right: <Id.Eof_RParen _>
                              )
                            }
                          spids: [2268]
                        )
                      ]
                      redirects: []
                    )
                    (command.AndOr
                      ops: [Id.Op_DAmp]
                      children: [
                        (C {<test>} {(DQ ($ Id.VSub_DollarName ancestor))})
                        (command.Simple
                          words: [
                            {<echo>}
                            {
                              (command_sub
                                left_token: <Id.Left_DollarParen '$('>
                                child: (C {<map>} {($ Id.VSub_DollarName ancestor)})
                                right: <Id.Eof_RParen _>
                              )
                            }
                          ]
                          redirects: [
                            (redir
                              op: <Id.Redir_DGreat '>>'>
                              loc: (redir_loc.Fd fd:1)
                              arg: 
                                {(DQ ($ Id.VSub_DollarName workdir)) <'/../map/'> 
                                  ($ Id.VSub_DollarName sha1)
                                }
                            )
                          ]
                          more_env: []
                          do_fork: T
                        )
                      ]
                    )
                  ]
                )
              redirects: [
                (redir
                  op: <Id.Redir_Less '<'>
                  loc: (redir_loc.Fd fd:0)
                  arg: {(DQ ($ Id.VSub_DollarName tempdir)) <'/heads'>}
                )
              ]
            )
          ]
          spids: [2214 2226]
        )
      ]
      else_action: []
      redirects: []
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike '_x40='> name:_x40)
          op: assign_op.Equal
          rhs: {(SQ <'[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]'>)}
          spids: [2329]
        )
      ]
      redirects: []
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike '_x40='> name:_x40)
          op: assign_op.Equal
          rhs: 
            {
              (DQ ($ Id.VSub_DollarName _x40) ($ Id.VSub_DollarName _x40) ($ Id.VSub_DollarName _x40) 
                ($ Id.VSub_DollarName _x40) ($ Id.VSub_DollarName _x40) ($ Id.VSub_DollarName _x40) ($ Id.VSub_DollarName _x40) 
                ($ Id.VSub_DollarName _x40)
              )
            }
          spids: [2334]
        )
      ]
      redirects: []
    )
    (C {<echo>})
    (command.WhileUntil
      keyword: <Id.KW_While while>
      cond: (condition.Shell commands:[(C {<read>} {<ref>})])
      body: 
        (command.DoGroup
          children: [
            (command.AndOr
              ops: [Id.Op_DAmp]
              children: [
                (C {<test>} {<-f>} 
                  {(DQ ($ Id.VSub_DollarName orig_namespace) ($ Id.VSub_DollarName ref))}
                )
                (command.ControlFlow token:<Id.ControlFlow_Continue continue>)
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'sha1='> name:sha1)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: <Id.Left_DollarParen '$('>
                        child: 
                          (C {<git>} {<rev-parse>} 
                            {(DQ ($ Id.VSub_DollarName ref)) <Id.Lit_Other '^'> <0>}
                          )
                        right: <Id.Eof_RParen _>
                      )
                    }
                  spids: [2376]
                )
              ]
              redirects: []
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'rewritten='> name:rewritten)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: <Id.Left_DollarParen '$('>
                        child: (C {<map>} {($ Id.VSub_DollarName sha1)})
                        right: <Id.Eof_RParen _>
                      )
                    }
                  spids: [2390]
                )
              ]
              redirects: []
            )
            (command.AndOr
              ops: [Id.Op_DAmp Id.Op_DAmp]
              children: [
                (C {<test>} {($ Id.VSub_DollarName sha1)} {<Id.Lit_Equals '='>} 
                  {(DQ ($ Id.VSub_DollarName rewritten))}
                )
                (C {<warn>} {(DQ <'WARNING: Ref \''> ($ Id.VSub_DollarName ref) <'\' is unchanged'>)})
                (command.ControlFlow token:<Id.ControlFlow_Continue continue>)
              ]
            )
            (command.Case
              to_match: {(DQ ($ Id.VSub_DollarName rewritten))}
              arms: [
                (case_arm
                  pat_list: [{(SQ )}]
                  action: [
                    (C {<echo>} {(DQ <'Ref \''> ($ Id.VSub_DollarName ref) <'\' was deleted'>)})
                    (command.AndOr
                      ops: [Id.Op_DPipe]
                      children: [
                        (C {<git>} {<update-ref>} {<-m>} {(DQ <'filter-branch: delete'>)} {<-d>} 
                          {(DQ ($ Id.VSub_DollarName ref))} {($ Id.VSub_DollarName sha1)}
                        )
                        (C {<die>} {(DQ <'Could not delete '> ($ Id.VSub_DollarName ref))})
                      ]
                    )
                  ]
                  spids: [2436 2438 2479 -1]
                )
                (case_arm
                  pat_list: [{($ Id.VSub_DollarName _x40)}]
                  action: [
                    (C {<echo>} {(DQ <'Ref \''> ($ Id.VSub_DollarName ref) <'\' was rewritten'>)})
                    (command.If
                      arms: [
                        (if_arm
                          cond: 
                            (condition.Shell
                              commands: [
                                (command.Sentence
                                  child: 
                                    (command.Pipeline
                                      children: [
                                        (command.Simple
                                          words: [
                                            {<git>}
                                            {<update-ref>}
                                            {<-m>}
                                            {(DQ <'filter-branch: rewrite'>)}
                                            {(DQ ($ Id.VSub_DollarName ref))}
                                            {($ Id.VSub_DollarName rewritten)}
                                            {($ Id.VSub_DollarName sha1)}
                                          ]
                                          redirects: [
                                            (redir
                                              op: <Id.Redir_Great '2>'>
                                              loc: (redir_loc.Fd fd:2)
                                              arg: {<'/dev/null'>}
                                            )
                                          ]
                                          more_env: []
                                          do_fork: T
                                        )
                                      ]
                                      negated: T
                                      stderr_indices: []
                                    )
                                  terminator: <Id.Op_Semi _>
                                )
                              ]
                            )
                          action: [
                            (command.If
                              arms: [
                                (if_arm
                                  cond: 
                                    (condition.Shell
                                      commands: [
                                        (command.Sentence
                                          child: 
                                            (C {<test>} 
                                              {
                                                (command_sub
                                                  left_token: <Id.Left_DollarParen '$('>
                                                  child: 
                                                    (C {<git>} {<cat-file>} {<-t>} 
                                                      {(DQ ($ Id.VSub_DollarName ref))}
                                                    )
                                                  right: <Id.Eof_RParen _>
                                                )
                                              } {<Id.Lit_Equals '='>} {<tag>}
                                            )
                                          terminator: <Id.Op_Semi _>
                                        )
                                      ]
                                    )
                                  action: [
                                    (command.If
                                      arms: [
                                        (if_arm
                                          cond: 
                                            (condition.Shell
                                              commands: [
                                                (command.Sentence
                                                  child: 
                                                    (C {<test>} {<-z>} 
                                                      {(DQ ($ Id.VSub_DollarName filter_tag_name))}
                                                    )
                                                  terminator: <Id.Op_Semi _>
                                                )
                                              ]
                                            )
                                          action: [
                                            (C {<warn>} 
                                              {
                                                (DQ 
                                                  <
'WARNING: You said to rewrite tagged commits, but not the corresponding tag.'
                                                  >
                                                )
                                              }
                                            )
                                            (C {<warn>} 
                                              {
                                                (DQ 
                                                  <
'WARNING: Perhaps use \'--tag-name-filter cat\' to rewrite the tag.'
                                                  >
                                                )
                                              }
                                            )
                                          ]
                                          spids: [2550 2561]
                                        )
                                      ]
                                      else_action: []
                                      redirects: []
                                    )
                                  ]
                                  spids: [2526 2547]
                                )
                              ]
                              else_action: [
                                (C {<die>} {(DQ <'Could not rewrite '> ($ Id.VSub_DollarName ref))})
                              ]
                              redirects: []
                            )
                          ]
                          spids: [2495 2523]
                        )
                      ]
                      else_action: []
                      redirects: []
                    )
                  ]
                  spids: [2482 2483 2598 -1]
                )
                (case_arm
                  pat_list: [{<Id.Lit_Star '*'>}]
                  action: [
                    (C {<warn>} 
                      {
                        (DQ <'WARNING: \''> ($ Id.VSub_DollarName ref) 
                          <'\' was rewritten into multiple commits:'>
                        )
                      }
                    )
                    (C {<warn>} {(DQ ($ Id.VSub_DollarName rewritten))})
                    (C {<warn>} 
                      {
                        (DQ <'WARNING: Ref \''> ($ Id.VSub_DollarName ref) 
                          <'\' points to the first one now.'>
                        )
                      }
                    )
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'rewritten='> name:rewritten)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (command_sub
                                left_token: <Id.Left_DollarParen '$('>
                                child: 
                                  (command.Pipeline
                                    children: [
                                      (C {<echo>} {(DQ ($ Id.VSub_DollarName rewritten))})
                                      (C {<head>} {<-n>} {<1>})
                                    ]
                                    negated: F
                                    stderr_indices: []
                                  )
                                right: <Id.Eof_RParen _>
                              )
                            }
                          spids: [2634]
                        )
                      ]
                      redirects: []
                    )
                    (command.AndOr
                      ops: [Id.Op_DPipe]
                      children: [
                        (C {<git>} {<update-ref>} {<-m>} {(DQ <'filter-branch: rewrite to first'>)} 
                          {(DQ ($ Id.VSub_DollarName ref))} {($ Id.VSub_DollarName rewritten)} {($ Id.VSub_DollarName sha1)}
                        )
                        (C {<die>} {(DQ <'Could not rewrite '> ($ Id.VSub_DollarName ref))})
                      ]
                    )
                  ]
                  spids: [2601 2602 2683 -1]
                )
              ]
              redirects: []
            )
            (command.AndOr
              ops: [Id.Op_DPipe]
              children: [
                (C {<git>} {<update-ref>} {<-m>} {(DQ <'filter-branch: backup'>)} 
                  {(DQ ($ Id.VSub_DollarName orig_namespace) ($ Id.VSub_DollarName ref))} {($ Id.VSub_DollarName sha1)}
                )
                (command.ControlFlow token:<Id.ControlFlow_Exit exit>)
              ]
            )
          ]
        )
      redirects: [
        (redir
          op: <Id.Redir_Less '<'>
          loc: (redir_loc.Fd fd:0)
          arg: {(DQ ($ Id.VSub_DollarName tempdir)) <'/heads'>}
        )
      ]
    )
    (command.If
      arms: [
        (if_arm
          cond: 
            (condition.Shell
              commands: [
                (command.Sentence
                  child: 
                    (C {<Id.Lit_LBracket '['>} {(DQ ($ Id.VSub_DollarName filter_tag_name))} 
                      {<Id.Lit_RBracket ']'>}
                    )
                  terminator: <Id.Op_Semi _>
                )
              ]
            )
          action: [
            (command.Pipeline
              children: [
                (C {<git>} {<for-each-ref>} 
                  {<--format> <Id.Lit_Equals '='> (SQ <'%(objectname) %(objecttype) %(refname)'>)} {<'refs/tags'>}
                )
                (command.WhileUntil
                  keyword: <Id.KW_While while>
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: (C {<read>} {<sha1>} {<type>} {<ref>})
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  body: 
                    (command.DoGroup
                      children: [
                        (command.ShAssignment
                          pairs: [
                            (assign_pair
                              lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'ref='> name:ref)
                              op: assign_op.Equal
                              rhs: 
                                {
                                  (DQ 
                                    (braced_var_sub
                                      left: <Id.Left_DollarBrace '${'>
                                      token: <Id.VSub_Name ref>
                                      var_name: ref
                                      suffix_op: 
                                        (suffix_op.Unary
                                          op: <Id.VOp1_Pound '#'>
                                          arg_word: 
                                            {<refs> <Id.Lit_Slash '/'> <tags> <Id.Lit_Slash '/'>}
                                        )
                                      right: <Id.Right_DollarBrace '}'>
                                    )
                                  )
                                }
                              spids: [2774]
                            )
                          ]
                          redirects: []
                        )
                        (command.If
                          arms: [
                            (if_arm
                              cond: 
                                (condition.Shell
                                  commands: [
                                    (command.Sentence
                                      child: 
                                        (C {<Id.Lit_LBracket '['>} {(DQ ($ Id.VSub_DollarName type))} 
                                          {<Id.KW_Bang '!'> <Id.Lit_Equals '='>} {(DQ <commit>)} {<-a>} {(DQ ($ Id.VSub_DollarName type))} {<Id.KW_Bang '!'> <Id.Lit_Equals '='>} 
                                          {(DQ <tag>)} {<Id.Lit_RBracket ']'>}
                                        )
                                      terminator: <Id.Op_Semi _>
                                    )
                                  ]
                                )
                              action: [
                                (command.Sentence
                                  child: 
                                    (command.ControlFlow
                                      token: <Id.ControlFlow_Continue continue>
                                    )
                                  terminator: <Id.Op_Semi _>
                                )
                              ]
                              spids: [2791 2822]
                            )
                          ]
                          else_action: []
                          redirects: []
                        )
                        (command.If
                          arms: [
                            (if_arm
                              cond: 
                                (condition.Shell
                                  commands: [
                                    (command.Sentence
                                      child: 
                                        (C {<Id.Lit_LBracket '['>} {(DQ ($ Id.VSub_DollarName type))} 
                                          {<Id.Lit_Equals '='>} {(DQ <tag>)} {<Id.Lit_RBracket ']'>}
                                        )
                                      terminator: <Id.Op_Semi _>
                                    )
                                  ]
                                )
                              action: [
                                (command.ShAssignment
                                  pairs: [
                                    (assign_pair
                                      lhs: 
                                        (sh_lhs_expr.Name
                                          left: <Id.Lit_VarLike 'sha1t='>
                                          name: sha1t
                                        )
                                      op: assign_op.Equal
                                      rhs: {(DQ ($ Id.VSub_DollarName sha1))}
                                      spids: [2857]
                                    )
                                  ]
                                  redirects: []
                                )
                                (command.AndOr
                                  ops: [Id.Op_DPipe]
                                  children: [
                                    (command.ShAssignment
                                      pairs: [
                                        (assign_pair
                                          lhs: 
                                            (sh_lhs_expr.Name
                                              left: <Id.Lit_VarLike 'sha1='>
                                              name: sha1
                                            )
                                          op: assign_op.Equal
                                          rhs: 
                                            {
                                              (DQ 
                                                (command_sub
                                                  left_token: <Id.Left_DollarParen '$('>
                                                  child: 
                                                    (C {<git>} {<rev-parse>} {<-q>} 
                                                      {(DQ ($ Id.VSub_DollarName sha1)) 
                                                        <Id.Lit_Other '^'> <Id.Lit_LBrace '{'> <commit> <Id.Lit_RBrace '}'>
                                                      }
                                                    )
                                                  right: <Id.Eof_RParen _>
                                                )
                                              )
                                            }
                                          spids: [2863]
                                        )
                                      ]
                                      redirects: []
                                    )
                                    (command.ControlFlow
                                      token: <Id.ControlFlow_Continue continue>
                                    )
                                  ]
                                )
                              ]
                              spids: [2833 2850]
                            )
                          ]
                          else_action: []
                          redirects: []
                        )
                        (command.AndOr
                          ops: [Id.Op_DPipe]
                          children: [
                            (C {<Id.Lit_LBracket '['>} {<-f>} 
                              {(DQ <'../map/'> ($ Id.VSub_DollarName sha1))} {<Id.Lit_RBracket ']'>}
                            )
                            (command.ControlFlow
                              token: <Id.ControlFlow_Continue continue>
                            )
                          ]
                        )
                        (command.ShAssignment
                          pairs: [
                            (assign_pair
                              lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'new_sha1='> name:new_sha1)
                              op: assign_op.Equal
                              rhs: 
                                {
                                  (DQ 
                                    (command_sub
                                      left_token: <Id.Left_DollarParen '$('>
                                      child: (C {<cat>} {(DQ <'../map/'> ($ Id.VSub_DollarName sha1))})
                                      right: <Id.Eof_RParen _>
                                    )
                                  )
                                }
                              spids: [2907]
                            )
                          ]
                          redirects: []
                        )
                        (command.ShAssignment
                          pairs: [
                            (assign_pair
                              lhs: 
                                (sh_lhs_expr.Name
                                  left: <Id.Lit_VarLike 'GIT_COMMIT='>
                                  name: GIT_COMMIT
                                )
                              op: assign_op.Equal
                              rhs: {(DQ ($ Id.VSub_DollarName sha1))}
                              spids: [2920]
                            )
                          ]
                          redirects: []
                        )
                        (C {<export>} {<GIT_COMMIT>})
                        (command.AndOr
                          ops: [Id.Op_DPipe]
                          children: [
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: 
                                    (sh_lhs_expr.Name
                                      left: <Id.Lit_VarLike 'new_ref='>
                                      name: new_ref
                                    )
                                  op: assign_op.Equal
                                  rhs: 
                                    {
                                      (DQ 
                                        (command_sub
                                          left_token: <Id.Left_DollarParen '$('>
                                          child: 
                                            (command.Pipeline
                                              children: [
                                                (C {<echo>} {(DQ ($ Id.VSub_DollarName ref))})
                                                (C {<eval>} 
                                                  {(DQ ($ Id.VSub_DollarName filter_tag_name))}
                                                )
                                              ]
                                              negated: F
                                              stderr_indices: []
                                            )
                                          right: <Id.Eof_RParen _>
                                        )
                                      )
                                    }
                                  spids: [2931]
                                )
                              ]
                              redirects: []
                            )
                            (C {<die>} 
                              {
                                (DQ <'tag name filter failed: '> 
                                  ($ Id.VSub_DollarName filter_tag_name)
                                )
                              }
                            )
                          ]
                        )
                        (C {<echo>} 
                          {
                            (DQ ($ Id.VSub_DollarName ref) <' -> '> ($ Id.VSub_DollarName new_ref) 
                              <' ('> ($ Id.VSub_DollarName sha1) <' -> '> ($ Id.VSub_DollarName new_sha1) <')'>
                            )
                          }
                        )
                        (command.If
                          arms: [
                            (if_arm
                              cond: 
                                (condition.Shell
                                  commands: [
                                    (command.Sentence
                                      child: 
                                        (C {<Id.Lit_LBracket '['>} {(DQ ($ Id.VSub_DollarName type))} 
                                          {<Id.Lit_Equals '='>} {(DQ <tag>)} {<Id.Lit_RBracket ']'>}
                                        )
                                      terminator: <Id.Op_Semi _>
                                    )
                                  ]
                                )
                              action: [
                                (command.AndOr
                                  ops: [Id.Op_DPipe]
                                  children: [
                                    (command.ShAssignment
                                      pairs: [
                                        (assign_pair
                                          lhs: 
                                            (sh_lhs_expr.Name
                                              left: <Id.Lit_VarLike 'new_sha1='>
                                              name: new_sha1
                                            )
                                          op: assign_op.Equal
                                          rhs: 
                                            {
                                              (command_sub
                                                left_token: <Id.Left_DollarParen '$('>
                                                child: 
                                                  (command.Pipeline
                                                    children: [
                                                      (command.Subshell
                                                        child: 
                                                          (command.CommandList
                                                            children: [
                                                              (C {<printf>} 
                                                                {
                                                                  (SQ 
                                                                    <
'object %s\\ntype commit\\ntag %s\\n'
                                                                    >
                                                                  )
                                                                } {(DQ ($ Id.VSub_DollarName new_sha1))} {(DQ ($ Id.VSub_DollarName new_ref))}
                                                              )
                                                              (command.Pipeline
                                                                children: [
                                                                  (C {<git>} {<cat-file>} {<tag>} 
                                                                    {(DQ ($ Id.VSub_DollarName ref))}
                                                                  )
                                                                  (C {<sed>} {<-n>} {<-e>} 
                                                                    {
                                                                      (SQ <'1,/^$/{\n'> 
                                                                        <
'\t\t\t\t\t  /^object /d\n'
                                                                        > <'\t\t\t\t\t  /^type /d\n'> <'\t\t\t\t\t  /^tag /d\n'> <'\t\t\t\t\t}'>
                                                                      )
                                                                    } {<-e>} {(SQ <'/^-----BEGIN PGP SIGNATURE-----/q'>)} {<-e>} {(SQ <p>)}
                                                                  )
                                                                ]
                                                                negated: F
                                                                stderr_indices: []
                                                              )
                                                            ]
                                                          )
                                                        redirects: []
                                                      )
                                                      (C {<git>} {<mktag>})
                                                    ]
                                                    negated: F
                                                    stderr_indices: []
                                                  )
                                                right: <Id.Eof_RParen _>
                                              )
                                            }
                                          spids: [2997]
                                        )
                                      ]
                                      redirects: []
                                    )
                                    (C {<die>} 
                                      {
                                        (DQ <'Could not create new tag object for '> 
                                          ($ Id.VSub_DollarName ref)
                                        )
                                      }
                                    )
                                  ]
                                )
                                (command.If
                                  arms: [
                                    (if_arm
                                      cond: 
                                        (condition.Shell
                                          commands: [
                                            (command.Pipeline
                                              children: [
                                                (C {<git>} {<cat-file>} {<tag>} 
                                                  {(DQ ($ Id.VSub_DollarName ref))}
                                                )
                                                (command.Simple
                                                  words: [
                                                    {<sane_grep>}
                                                    {(SQ <'^-----BEGIN PGP SIGNATURE-----'>)}
                                                  ]
                                                  redirects: [
                                                    (redir
                                                      op: <Id.Redir_Great '>'>
                                                      loc: (redir_loc.Fd fd:1)
                                                      arg: {<'/dev/null'>}
                                                    )
                                                    (redir
                                                      op: <Id.Redir_GreatAnd '2>&'>
                                                      loc: (redir_loc.Fd fd:2)
                                                      arg: {<1>}
                                                    )
                                                  ]
                                                  more_env: []
                                                  do_fork: T
                                                )
                                              ]
                                              negated: F
                                              stderr_indices: []
                                            )
                                          ]
                                        )
                                      action: [
                                        (C {<warn>} 
                                          {
                                            (DQ <'gpg signature stripped from tag object '> 
                                              ($ Id.VSub_DollarName sha1t)
                                            )
                                          }
                                        )
                                      ]
                                      spids: [3085 3114]
                                    )
                                  ]
                                  else_action: []
                                  redirects: []
                                )
                              ]
                              spids: [2977 2994]
                            )
                          ]
                          else_action: []
                          redirects: []
                        )
                        (command.AndOr
                          ops: [Id.Op_DPipe]
                          children: [
                            (C {<git>} {<update-ref>} 
                              {(DQ <'refs/tags/'> ($ Id.VSub_DollarName new_ref))} {(DQ ($ Id.VSub_DollarName new_sha1))}
                            )
                            (C {<die>} {(DQ <'Could not write tag '> ($ Id.VSub_DollarName new_ref))})
                          ]
                        )
                      ]
                    )
                  redirects: []
                )
              ]
              negated: F
              stderr_indices: []
            )
          ]
          spids: [2731 2742]
        )
      ]
      else_action: []
      redirects: []
    )
    (C {<cd>} {(DQ ($ Id.VSub_DollarName orig_dir))})
    (C {<rm>} {<-rf>} {(DQ ($ Id.VSub_DollarName tempdir))})
    (C {<trap>} {<->} {<0>})
    (C {<unset>} {<GIT_DIR>} {<GIT_WORK_TREE>} {<GIT_INDEX_FILE>})
    (command.AndOr
      ops: [Id.Op_DPipe]
      children: [
        (C {<test>} {<-z>} {(DQ ($ Id.VSub_DollarName ORIG_GIT_DIR))})
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (command.AndOr
              ops: [Id.Op_DAmp]
              children: [
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'GIT_DIR='> name:GIT_DIR)
                      op: assign_op.Equal
                      rhs: {(DQ ($ Id.VSub_DollarName ORIG_GIT_DIR))}
                      spids: [3204]
                    )
                  ]
                  redirects: []
                )
                (C {<export>} {<GIT_DIR>})
              ]
            )
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
      ]
    )
    (command.AndOr
      ops: [Id.Op_DPipe]
      children: [
        (C {<test>} {<-z>} {(DQ ($ Id.VSub_DollarName ORIG_GIT_WORK_TREE))})
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (command.AndOr
              ops: [Id.Op_DAmp]
              children: [
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: 
                        (sh_lhs_expr.Name
                          left: <Id.Lit_VarLike 'GIT_WORK_TREE='>
                          name: GIT_WORK_TREE
                        )
                      op: assign_op.Equal
                      rhs: {(DQ ($ Id.VSub_DollarName ORIG_GIT_WORK_TREE))}
                      spids: [3230]
                    )
                  ]
                  redirects: []
                )
                (C {<export>} {<GIT_WORK_TREE>})
              ]
            )
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
      ]
    )
    (command.AndOr
      ops: [Id.Op_DPipe]
      children: [
        (C {<test>} {<-z>} {(DQ ($ Id.VSub_DollarName ORIG_GIT_INDEX_FILE))})
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (command.AndOr
              ops: [Id.Op_DAmp]
              children: [
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: 
                        (sh_lhs_expr.Name
                          left: <Id.Lit_VarLike 'GIT_INDEX_FILE='>
                          name: GIT_INDEX_FILE
                        )
                      op: assign_op.Equal
                      rhs: {(DQ ($ Id.VSub_DollarName ORIG_GIT_INDEX_FILE))}
                      spids: [3257]
                    )
                  ]
                  redirects: []
                )
                (C {<export>} {<GIT_INDEX_FILE>})
              ]
            )
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
      ]
    )
    (command.If
      arms: [
        (if_arm
          cond: 
            (condition.Shell
              commands: [
                (command.Sentence
                  child: 
                    (C {<Id.Lit_LBracket '['>} 
                      {
                        (DQ 
                          (command_sub
                            left_token: <Id.Left_DollarParen '$('>
                            child: (C {<is_bare_repository>})
                            right: <Id.Eof_RParen _>
                          )
                        )
                      } {<Id.Lit_Equals '='>} {<false>} {<Id.Lit_RBracket ']'>}
                    )
                  terminator: <Id.Op_Semi _>
                )
              ]
            )
          action: [
            (command.AndOr
              ops: [Id.Op_DPipe]
              children: [
                (C {<git>} {<read-tree>} {<-u>} {<-m>} {<HEAD>})
                (command.ControlFlow token:<Id.ControlFlow_Exit exit>)
              ]
            )
          ]
          spids: [3272 3289]
        )
      ]
      else_action: []
      redirects: []
    )
    (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<0>})
  ]
)