(command.CommandList children: [ (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:functions) op: Equal rhs: { (word_part.CommandSub left_token: <Left_DollarParen '$('> command_list: (command.CommandList children: [ (command.Simple words: [{(cat)}] redirects: [ (redir.HereDoc op: <Redir_DLess '<<'> fd: 16777215 here_begin: {(word_part.EscapedLiteral token:<Lit_EscapedChar '\\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') ] ) ] ) ] ) ) } ) ] ) (C {(eval)} {(DQ ($ VSub_DollarName '$functions'))}) (command.FuncDef name: finish_ident body: (command.BraceGroup children: [ (C {(echo)} { (DQ ('case ') (word_part.EscapedLiteral token:<Lit_EscapedChar '\\"'>) (word_part.EscapedLiteral token:<Lit_EscapedChar '\\$'>) (GIT_) ($ VSub_Number '$1') (_NAME) (word_part.EscapedLiteral token:<Lit_EscapedChar '\\"'>) (' in ') (word_part.EscapedLiteral token:<Lit_EscapedChar '\\"'>) (word_part.EscapedLiteral token:<Lit_EscapedChar '\\"'>) (') GIT_') ($ VSub_Number '$1') ('_NAME=') (word_part.EscapedLiteral token:<Lit_EscapedChar '\\"'>) (word_part.EscapedLiteral token:<Lit_EscapedChar '\\$'>) ('{GIT_') ($ VSub_Number '$1') ('_EMAIL%%@*}') (word_part.EscapedLiteral token:<Lit_EscapedChar '\\"'>) (' && export GIT_') ($ VSub_Number '$1') ('_NAME;; esac') ) } ) (C {(echo)} {(DQ ('export GIT_') ($ VSub_Number '$1') (_NAME))}) (C {(echo)} {(DQ ('export GIT_') ($ VSub_Number '$1') (_EMAIL))}) (C {(echo)} {(DQ ('export GIT_') ($ VSub_Number '$1') (_DATE))}) ] ) ) (command.FuncDef name: set_ident body: (command.BraceGroup children: [ (C {(parse_ident_from_commit)} {(author)} {(AUTHOR)} {(committer)} {(COMMITTER)}) (C {(finish_ident)} {(AUTHOR)}) (C {(finish_ident)} {(COMMITTER)}) ] ) ) (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:USAGE) 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>...]') ) } ) ] ) (command.Assignment pairs: [(assign_pair lhs:(lhs_expr.LhsName name:OPTIONS_SPEC) op:Equal rhs:(word.Empty))] ) (C {(.)} {(git-sh-setup)}) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Lit_LBracket '[')} { (DQ (word_part.CommandSub left_token: <Left_DollarParen '$('> command_list: (command.CommandList children:[(C {(is_bare_repository)})]) ) ) } {(Lit_Other '=')} {(false)} {(Lit_RBracket ']')} ) terminator: <Op_Semi ';'> ) ] action: [(C {(require_clean_work_tree)} {(SQ <'rewrite branches'>)})] ) ] ) (command.Assignment pairs: [(assign_pair lhs:(lhs_expr.LhsName name:tempdir) op:Equal rhs:{(.git-rewrite)})] ) (command.Assignment pairs: [(assign_pair lhs:(lhs_expr.LhsName name:filter_env) op:Equal rhs:(word.Empty))] ) (command.Assignment pairs: [(assign_pair lhs:(lhs_expr.LhsName name:filter_tree) op:Equal rhs:(word.Empty))] ) (command.Assignment pairs: [(assign_pair lhs:(lhs_expr.LhsName name:filter_index) op:Equal rhs:(word.Empty))] ) (command.Assignment pairs: [(assign_pair lhs:(lhs_expr.LhsName name:filter_parent) op:Equal rhs:(word.Empty))] ) (command.Assignment pairs: [(assign_pair lhs:(lhs_expr.LhsName name:filter_msg) op:Equal rhs:{(cat)})] ) (command.Assignment pairs: [(assign_pair lhs:(lhs_expr.LhsName name:filter_commit) op:Equal rhs:(word.Empty))] ) (command.Assignment pairs: [(assign_pair lhs:(lhs_expr.LhsName name:filter_tag_name) op:Equal rhs:(word.Empty))] ) (command.Assignment pairs: [(assign_pair lhs:(lhs_expr.LhsName name:filter_subdir) op:Equal rhs:(word.Empty))] ) (command.Assignment pairs: [(assign_pair lhs:(lhs_expr.LhsName name:orig_namespace) op:Equal rhs:{(refs/original/)})] ) (command.Assignment pairs: [(assign_pair lhs:(lhs_expr.LhsName name:force) op:Equal rhs:(word.Empty))] ) (command.Assignment pairs: [(assign_pair lhs:(lhs_expr.LhsName name:prune_empty) op:Equal rhs:(word.Empty))] ) (command.Assignment pairs: [(assign_pair lhs:(lhs_expr.LhsName name:remap_to_ancestor) op:Equal rhs:(word.Empty))] ) (command.WhileUntil keyword: <KW_While while> cond: [(C {(Lit_Other ':')})] body: (command.DoGroup children: [ (command.Case to_match: {(DQ ($ VSub_Number '$1'))} arms: [ (case_arm pat_list: [{(--)}] action: [(C {(shift)}) (command.ControlFlow token:<ControlFlow_Break break>)] ) (case_arm pat_list: [{(--force)} {(-f)}] action: [ (C {(shift)}) (command.Assignment pairs: [(assign_pair lhs:(lhs_expr.LhsName name:force) op:Equal rhs:{(t)})] ) (command.ControlFlow token:<ControlFlow_Continue continue>) ] ) (case_arm pat_list: [{(--remap-to-ancestor)}] action: [ (C {(shift)}) (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:remap_to_ancestor) op: Equal rhs: {(t)} ) ] ) (command.ControlFlow token:<ControlFlow_Continue continue>) ] ) (case_arm pat_list: [{(--prune-empty)}] action: [ (C {(shift)}) (command.Assignment pairs: [(assign_pair lhs:(lhs_expr.LhsName name:prune_empty) op:Equal rhs:{(t)})] ) (command.ControlFlow token:<ControlFlow_Continue continue>) ] ) (case_arm pat_list:[{(-) (Lit_Star '*')}]) (case_arm pat_list: [{(Lit_Star '*')}] action: [ (command.Sentence child: (command.ControlFlow token:<ControlFlow_Break break>) terminator: <Op_Semi ';'> ) ] ) ] ) (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:ARG) op: Equal rhs: {(DQ ($ VSub_Number '$1'))} ) ] ) (command.Case to_match: {(DQ ($ VSub_Pound '$#'))} arms: [(case_arm pat_list:[{(1)}] action:[(C {(usage)})])] ) (C {(shift)}) (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:OPTARG) op: Equal rhs: {(DQ ($ VSub_Number '$1'))} ) ] ) (C {(shift)}) (command.Case to_match: {(DQ ($ VSub_DollarName '$ARG'))} arms: [ (case_arm pat_list: [{(-d)}] action: [ (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:tempdir) op: Equal rhs: {(DQ ($ VSub_DollarName '$OPTARG'))} ) ] ) ] ) (case_arm pat_list: [{(--env-filter)}] action: [ (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:filter_env) op: Equal rhs: {(DQ ($ VSub_DollarName '$OPTARG'))} ) ] ) ] ) (case_arm pat_list: [{(--tree-filter)}] action: [ (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:filter_tree) op: Equal rhs: {(DQ ($ VSub_DollarName '$OPTARG'))} ) ] ) ] ) (case_arm pat_list: [{(--index-filter)}] action: [ (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:filter_index) op: Equal rhs: {(DQ ($ VSub_DollarName '$OPTARG'))} ) ] ) ] ) (case_arm pat_list: [{(--parent-filter)}] action: [ (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:filter_parent) op: Equal rhs: {(DQ ($ VSub_DollarName '$OPTARG'))} ) ] ) ] ) (case_arm pat_list: [{(--msg-filter)}] action: [ (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:filter_msg) op: Equal rhs: {(DQ ($ VSub_DollarName '$OPTARG'))} ) ] ) ] ) (case_arm pat_list: [{(--commit-filter)}] action: [ (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:filter_commit) op: Equal rhs: { (DQ ($ VSub_DollarName '$functions') ('; ') ($ VSub_DollarName '$OPTARG')) } ) ] ) ] ) (case_arm pat_list: [{(--tag-name-filter)}] action: [ (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:filter_tag_name) op: Equal rhs: {(DQ ($ VSub_DollarName '$OPTARG'))} ) ] ) ] ) (case_arm pat_list: [{(--subdirectory-filter)}] action: [ (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:filter_subdir) op: Equal rhs: {(DQ ($ VSub_DollarName '$OPTARG'))} ) ] ) (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:remap_to_ancestor) op: Equal rhs: {(t)} ) ] ) ] ) (case_arm pat_list: [{(--original)}] action: [ (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:orig_namespace) op: Equal rhs: { (word_part.CommandSub left_token: <Left_DollarParen '$('> command_list: (command.CommandList children: [ (C {(expr)} {(DQ ($ VSub_DollarName '$OPTARG') (/))} {(Lit_Other ':')} {(SQ <'\\(.*[^/]\\)/*$'>)} ) ] ) ) (/) } ) ] ) ] ) (case_arm pat_list:[{(Lit_Star '*')}] action:[(C {(usage)})]) ] ) ] ) ) (command.Case to_match: {(DQ ($ VSub_DollarName '$prune_empty') (',') ($ VSub_DollarName '$filter_commit'))} arms: [ (case_arm pat_list: [{(Lit_Comma ',')}] action: [ (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:filter_commit) op: Equal rhs: {(SQ <'git commit-tree "$@"'>)} ) ] ) ] ) (case_arm pat_list: [{(t) (Lit_Comma ',')}] action: [ (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:filter_commit) op: Equal rhs: {(DQ ($ VSub_DollarName '$functions') (';')) (SQ <' git_commit_non_empty_tree "$@"'>) } ) ] ) ] ) (case_arm pat_list:[{(Lit_Comma ',') (Lit_Star '*')}]) (case_arm pat_list: [{(Lit_Star '*')}] action: [(C {(die)} {(DQ ('Cannot set --prune-empty and --commit-filter at the same time'))})] ) ] ) (command.Case to_match: {(DQ ($ VSub_DollarName '$force'))} arms: [ (case_arm pat_list: [{(t)}] action: [(C {(rm)} {(-rf)} {(DQ ($ VSub_DollarName '$tempdir'))})] ) (case_arm pat_list: [{(SQ )}] action: [ (command.AndOr ops: [Op_DAmp] children: [ (C {(test)} {(-d)} {(DQ ($ VSub_DollarName '$tempdir'))}) (C {(die)} {(DQ ($ VSub_DollarName '$tempdir') (' already exists, please remove it'))}) ] ) ] ) ] ) (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:orig_dir) op: Equal rhs: { (word_part.CommandSub left_token: <Left_DollarParen '$('> command_list: (command.CommandList children:[(C {(pwd)})]) ) } ) ] ) (command.AndOr ops: [Op_DAmp Op_DAmp Op_DAmp Op_DPipe] children: [ (C {(mkdir)} {(-p)} {(DQ ($ VSub_DollarName '$tempdir') (/t))}) (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:tempdir) op: Equal rhs: { (DQ (word_part.CommandSub left_token: <Left_DollarParen '$('> command_list: (command.CommandList children: [ (command.Sentence child: (C {(cd)} {(DQ ($ VSub_DollarName '$tempdir'))}) terminator: <Op_Semi ';'> ) (C {(pwd)}) ] ) ) ) } ) ] ) (C {(cd)} {(DQ ($ VSub_DollarName '$tempdir') (/t))}) (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:workdir) op: Equal rhs: { (DQ (word_part.CommandSub left_token: <Left_DollarParen '$('> command_list: (command.CommandList children:[(C {(pwd)})]) ) ) } ) ] ) (C {(die)} {(DQ )}) ] ) (C {(trap)} {(SQ <'cd "$orig_dir"; rm -rf "$tempdir"'>)} {(0)}) (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:ORIG_GIT_DIR) op: Equal rhs: {(DQ ($ VSub_DollarName '$GIT_DIR'))} ) ] ) (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:ORIG_GIT_WORK_TREE) op: Equal rhs: {(DQ ($ VSub_DollarName '$GIT_WORK_TREE'))} ) ] ) (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:ORIG_GIT_INDEX_FILE) op: Equal rhs: {(DQ ($ VSub_DollarName '$GIT_INDEX_FILE'))} ) ] ) (command.Assignment pairs: [(assign_pair lhs:(lhs_expr.LhsName name:GIT_WORK_TREE) op:Equal rhs:{(.)})] ) (C {(export)} {(GIT_DIR)} {(GIT_WORK_TREE)}) (command.AndOr ops: [Op_DPipe] children: [ (command.Simple words: [{(git)} {(for-each-ref)}] redirects: [ (redir.Redir op: <Redir_Great '>'> fd: 16777215 arg_word: {(DQ ($ VSub_DollarName '$tempdir')) (/backup-refs)} ) ] ) (command.ControlFlow token:<ControlFlow_Exit exit>) ] ) (command.WhileUntil keyword: <KW_While while> cond: [(C {(read)} {(sha1)} {(type)} {(name)})] body: (command.DoGroup children: [ (command.Case to_match: {(DQ ($ VSub_DollarName '$force') (',') ($ VSub_DollarName '$name'))} arms: [ (case_arm pat_list: [{(Lit_Comma ',') ($ VSub_DollarName '$orig_namespace') (Lit_Star '*')}] action: [ (C {(die)} { (DQ ('Cannot create a new backup.\n') ('A previous backup already exists in ') ($ VSub_DollarName '$orig_namespace') ('\n') ('Force overwriting the backup with -f') ) } ) ] ) (case_arm pat_list: [ {(t) (Lit_Comma ',') ($ VSub_DollarName '$orig_namespace') (Lit_Star '*')} ] action: [ (C {(git)} {(update-ref)} {(-d)} {(DQ ($ VSub_DollarName '$name'))} {($ VSub_DollarName '$sha1')} ) ] ) ] ) ] ) redirects: [ (redir.Redir op: <Redir_Less '<'> fd: 16777215 arg_word: {(DQ ($ VSub_DollarName '$tempdir')) (/backup-refs)} ) ] ) (command.AndOr ops: [Op_DPipe] children: [ (command.Simple words: [ {(git)} {(rev-parse)} {(--no-flags)} {(--revs-only)} {(--symbolic-full-name)} {(--default)} {(HEAD)} {(DQ ($ VSub_At '$@'))} ] redirects: [ (redir.Redir op: <Redir_Great '>'> fd: 16777215 arg_word: {(DQ ($ VSub_DollarName '$tempdir')) (/raw-heads)} ) ] ) (command.ControlFlow token:<ControlFlow_Exit exit>) ] ) (command.Simple words: [{(sed)} {(-e)} {(SQ <'/^^/d'>)} {(DQ ($ VSub_DollarName '$tempdir')) (/raw-heads)}] redirects: [ (redir.Redir op: <Redir_Great '>'> fd: 16777215 arg_word: {(DQ ($ VSub_DollarName '$tempdir')) (/heads)} ) ] ) (command.AndOr ops: [Op_DPipe] children: [ (C {(test)} {(-s)} {(DQ ($ VSub_DollarName '$tempdir')) (/heads)}) (C {(die)} {(DQ ('Which ref do you want to rewrite?'))}) ] ) (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:GIT_INDEX_FILE) op: Equal rhs: { (DQ (word_part.CommandSub left_token: <Left_DollarParen '$('> command_list: (command.CommandList children:[(C {(pwd)})]) ) (/../index) ) } ) ] ) (C {(export)} {(GIT_INDEX_FILE)}) (command.AndOr ops: [Op_DPipe] children: [(C {(mkdir)} {(../map)}) (C {(die)} {(DQ ('Could not create map/ directory'))})] ) (command.AndOr ops: [Op_DPipe] children: [ (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:nonrevs) op: Equal rhs: { (word_part.CommandSub left_token: <Left_DollarParen '$('> command_list: (command.CommandList children: [(C {(git)} {(rev-parse)} {(--no-revs)} {(DQ ($ VSub_At '$@'))})] ) ) } ) ] ) (command.ControlFlow token:<ControlFlow_Exit exit>) ] ) (command.If arms: [ (if_arm cond: [(C {(test)} {(-z)} {(DQ ($ VSub_DollarName '$nonrevs'))})] action: [ (command.Assignment pairs: [(assign_pair lhs:(lhs_expr.LhsName name:dashdash) op:Equal rhs:{(--)})] ) ] ) ] else_action: [ (command.Assignment pairs: [(assign_pair lhs:(lhs_expr.LhsName name:dashdash) op:Equal rhs:(word.Empty))] ) (command.Assignment pairs: [(assign_pair lhs:(lhs_expr.LhsName name:remap_to_ancestor) op:Equal rhs:{(t)})] ) ] ) (command.Simple words: [{(git)} {(rev-parse)} {(--revs-only)} {(DQ ($ VSub_At '$@'))}] redirects: [(redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(../parse)})] ) (command.Case to_match: {(DQ ($ VSub_DollarName '$filter_subdir'))} arms: [ (case_arm pat_list: [{(DQ )}] action: [ (C {(eval)} {(set)} {(--)} { (DQ (word_part.CommandSub left_token: <Left_DollarParen '$('> command_list: (command.CommandList children: [ (C {(git)} {(rev-parse)} {(--sq)} {(--no-revs)} {(DQ ($ VSub_At '$@'))}) ] ) ) ) } ) ] ) (case_arm pat_list: [{(Lit_Star '*')}] action: [ (C {(eval)} {(set)} {(--)} { (DQ (word_part.CommandSub left_token: <Left_DollarParen '$('> command_list: (command.CommandList children: [ (C {(git)} {(rev-parse)} {(--sq)} {(--no-revs)} {(DQ ($ VSub_At '$@'))} {($ VSub_DollarName '$dashdash')} {(DQ ($ VSub_DollarName '$filter_subdir'))} ) ] ) ) ) } ) ] ) ] ) (command.AndOr ops: [Op_DPipe] children: [ (command.Simple words: [ {(git)} {(rev-list)} {(--reverse)} {(--topo-order)} {(--default)} {(HEAD)} {(--parents)} {(--simplify-merges)} {(--stdin)} {(DQ ($ VSub_At '$@'))} ] redirects: [ (redir.Redir op:<Redir_Less '<'> fd:16777215 arg_word:{(../parse)}) (redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(../revs)}) ] ) (C {(die)} {(DQ ('Could not get the commits'))}) ] ) (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:commits) op: Equal rhs: { (word_part.CommandSub left_token: <Left_DollarParen '$('> command_list: (command.CommandList children: [ (command.Pipeline children: [ (command.Simple words: [{(wc)} {(-l)}] redirects: [ (redir.Redir op: <Redir_Less '<'> fd: 16777215 arg_word: {(../revs)} ) ] ) (C {(tr)} {(-d)} {(DQ (' '))}) ] negated: F ) ] ) ) } ) ] ) (command.AndOr ops: [Op_DAmp] children: [ (C {(test)} {($ VSub_DollarName '$commits')} {(-eq)} {(0)}) (C {(die)} {(DQ ('Found nothing to rewrite'))}) ] ) (command.FuncDef name: report_progress body: (command.BraceGroup children: [ (command.If arms: [ (if_arm cond: [ (command.AndOr ops: [Op_DAmp] children: [ (C {(test)} {(-n)} {(DQ ($ VSub_DollarName '$progress'))}) (C {(test)} {($ VSub_DollarName '$git_filter_branch__commit_count')} {(-gt)} {($ VSub_DollarName '$next_sample_at')} ) ] ) ] action: [ (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:count) op: Equal rhs: {($ VSub_DollarName '$git_filter_branch__commit_count')} ) ] ) (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:now) op: Equal rhs: { (word_part.CommandSub left_token: <Left_DollarParen '$('> command_list: (command.CommandList children: [(C {(date)} {(Lit_Other '+') (Lit_Other '%') (s)})] ) ) } ) ] ) (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:elapsed) op: Equal rhs: { (word_part.ArithSub anode: (arith_expr.Binary op_id: Arith_Minus left: (arith_expr.ArithWord w:{($ VSub_DollarName '$now')}) right: (arith_expr.ArithWord w: {($ VSub_DollarName '$start_timestamp')} ) ) ) } ) ] ) (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:remaining) op: Equal rhs: { (word_part.ArithSub anode: (arith_expr.Binary op_id: Arith_Slash left: (arith_expr.Binary op_id: Arith_Star left: (arith_expr.Binary op_id: Arith_Minus left: (arith_expr.ArithWord w: {($ VSub_DollarName '$commits')} ) right: (arith_expr.ArithWord w: {($ VSub_DollarName '$count')} ) ) right: (arith_expr.ArithWord w: {($ VSub_DollarName '$elapsed')} ) ) right: (arith_expr.ArithWord w:{($ VSub_DollarName '$count')}) ) ) } ) ] ) (command.If arms: [ (if_arm cond: [(C {(test)} {($ VSub_DollarName '$elapsed')} {(-gt)} {(0)})] action: [ (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:next_sample_at) op: Equal rhs: { (word_part.ArithSub anode: (arith_expr.Binary op_id: Arith_Slash left: (arith_expr.Binary op_id: Arith_Star left: (arith_expr.Binary op_id: Arith_Plus left: (arith_expr.ArithWord w: {($ VSub_DollarName '$elapsed')} ) right: (arith_expr.ArithWord w:{(Lit_Digits 1)}) ) right: (arith_expr.ArithWord w: {($ VSub_DollarName '$count')} ) ) right: (arith_expr.ArithWord w: {($ VSub_DollarName '$elapsed')} ) ) ) } ) ] ) ] ) ] else_action: [ (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:next_sample_at) op: Equal rhs: { (word_part.ArithSub anode: (arith_expr.Binary op_id: Arith_Plus left: (arith_expr.ArithWord w: {($ VSub_DollarName '$next_sample_at')} ) right: (arith_expr.ArithWord w:{(Lit_Digits 1)}) ) ) } ) ] ) ] ) (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:progress) op: Equal rhs: { (DQ (' (') ($ VSub_DollarName '$elapsed') (' seconds passed, remaining ') ($ VSub_DollarName '$remaining') (' predicted)') ) } ) ] ) ] ) ] ) (C {(printf)} { (DQ (Lit_Other '\\') ('rRewrite ') ($ VSub_DollarName '$commit') (' (') ($ VSub_DollarName '$count') (/) ($ VSub_DollarName '$commits') (')') ($ VSub_DollarName '$progress') (' ') ) } ) ] ) ) (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:git_filter_branch__commit_count) op: Equal rhs: {(0)} ) ] ) (command.Assignment pairs: [ (assign_pair lhs:(lhs_expr.LhsName name:progress) op:Equal rhs:(word.Empty)) (assign_pair lhs:(lhs_expr.LhsName name:start_timestamp) op:Equal rhs:(word.Empty)) ] ) (command.If arms: [ (if_arm cond: [ (command.Pipeline children: [ (command.Simple words: [{(date)} {(SQ <'+%s'>)}] redirects: [(redir.Redir op:<Redir_Great '2>'> fd:2 arg_word:{(/dev/null)})] ) (C {(grep)} {(-q)} {(SQ <'^[0-9][0-9]*$'>)}) ] negated: F ) ] action: [ (command.Assignment pairs: [(assign_pair lhs:(lhs_expr.LhsName name:next_sample_at) op:Equal rhs:{(0)})] ) (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:progress) op: Equal rhs: {(DQ ('dummy to ensure this is not empty'))} ) ] ) (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:start_timestamp) op: Equal rhs: { (word_part.CommandSub left_token: <Left_DollarParen '$('> command_list: (command.CommandList children:[(C {(date)} {(SQ <'+%s'>)})]) ) } ) ] ) ] ) ] ) (command.If arms: [ (if_arm cond: [ (command.AndOr ops: [Op_DPipe Op_DPipe] children: [ (C {(test)} {(-n)} {(DQ ($ VSub_DollarName '$filter_index'))}) (C {(test)} {(-n)} {(DQ ($ VSub_DollarName '$filter_tree'))}) (C {(test)} {(-n)} {(DQ ($ VSub_DollarName '$filter_subdir'))}) ] ) ] action: [ (command.Assignment pairs: [(assign_pair lhs:(lhs_expr.LhsName name:need_index) op:Equal rhs:{(t)})] ) ] ) ] else_action: [ (command.Assignment pairs: [(assign_pair lhs:(lhs_expr.LhsName name:need_index) op:Equal rhs:(word.Empty))] ) ] ) (command.WhileUntil keyword: <KW_While while> cond: [(command.Sentence child:(C {(read)} {(commit)} {(parents)}) terminator:<Op_Semi ';'>)] body: (command.DoGroup children: [ (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:git_filter_branch__commit_count) op: Equal rhs: { (word_part.ArithSub anode: (arith_expr.Binary op_id: Arith_Plus left: (arith_expr.ArithWord w: {($ VSub_DollarName '$git_filter_branch__commit_count')} ) right: (arith_expr.ArithWord w:{(Lit_Digits 1)}) ) ) } ) ] ) (C {(report_progress)}) (command.AndOr ops: [Op_DPipe] children: [ (command.Case to_match: {(DQ ($ VSub_DollarName '$filter_subdir'))} arms: [ (case_arm pat_list: [{(DQ )}] action: [ (command.If arms: [ (if_arm cond: [(C {(test)} {(-n)} {(DQ ($ VSub_DollarName '$need_index'))})] action: [ (command.Simple words: [ {(git)} {(read-tree)} {(-i)} {(-m)} {($ VSub_DollarName '$commit')} ] more_env: [(env_pair name:GIT_ALLOW_NULL_SHA1 val:{(1)})] ) ] ) ] ) ] ) (case_arm pat_list: [{(Lit_Star '*')}] action: [ (command.AndOr ops: [Op_DPipe] children: [ (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:err) op: Equal rhs: { (word_part.CommandSub left_token: <Left_DollarParen '$('> command_list: (command.CommandList children: [ (command.Simple words: [ {(git)} {(read-tree)} {(-i)} {(-m)} {($ VSub_DollarName '$commit') (Lit_Other ':') (DQ ($ VSub_DollarName '$filter_subdir')) } ] redirects: [ (redir.Redir op: <Redir_GreatAnd '2>&'> fd: 2 arg_word: {(1)} ) ] more_env: [ (env_pair name: GIT_ALLOW_NULL_SHA1 val: {(1)} ) ] ) ] ) ) } ) ] ) (command.BraceGroup children: [ (command.If arms: [ (if_arm cond: [ (command.Pipeline children: [ (C {(git)} {(rev-parse)} {(-q)} {(--verify)} {($ VSub_DollarName '$commit') (Lit_Other ':') (DQ ($ VSub_DollarName '$filter_subdir')) } ) ] negated: T ) ] action: [ (C {(rm)} {(-f)} {(DQ ($ VSub_DollarName '$GIT_INDEX_FILE'))}) ] ) ] else_action: [ (command.Simple words: [{(echo)} {(DQ ($ VSub_DollarName '$err'))}] redirects: [ (redir.Redir op: <Redir_GreatAnd '>&'> fd: 16777215 arg_word: {(2)} ) ] ) (C {(false)}) ] ) ] ) ] ) ] ) ] ) (C {(die)} {(DQ ('Could not initialize the index'))}) ] ) (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:GIT_COMMIT) op: Equal rhs: {($ VSub_DollarName '$commit')} ) ] ) (C {(export)} {(GIT_COMMIT)}) (command.AndOr ops: [Op_DPipe] children: [ (command.Simple words: [{(git)} {(cat-file)} {(commit)} {(DQ ($ VSub_DollarName '$commit'))}] redirects: [(redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(../commit)})] ) (C {(die)} {(DQ ('Cannot read commit ') ($ VSub_DollarName '$commit'))}) ] ) (command.AndOr ops: [Op_DPipe] children: [ (C {(eval)} { (DQ (word_part.CommandSub left_token: <Left_DollarParen '$('> command_list: (command.CommandList children: [ (command.Simple words: [{(set_ident)}] redirects: [ (redir.Redir op: <Redir_Less '<'> fd: 16777215 arg_word: {(../commit)} ) ] ) ] ) ) ) } ) (C {(die)} {(DQ ('setting author/committer failed for commit ') ($ VSub_DollarName '$commit'))} ) ] ) (command.AndOr ops: [Op_DPipe] children: [ (command.Simple words: [{(eval)} {(DQ ($ VSub_DollarName '$filter_env'))}] redirects: [(redir.Redir op:<Redir_Less '<'> fd:16777215 arg_word:{(/dev/null)})] ) (C {(die)} {(DQ ('env filter failed: ') ($ VSub_DollarName '$filter_env'))}) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Lit_LBracket '[')} {(DQ ($ VSub_DollarName '$filter_tree'))} {(Lit_RBracket ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (command.AndOr ops: [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: [Op_DPipe] children: [ (command.Simple words: [{(eval)} {(DQ ($ VSub_DollarName '$filter_tree'))}] redirects: [ (redir.Redir op: <Redir_Less '<'> fd: 16777215 arg_word: {(/dev/null)} ) ] ) (C {(die)} {(DQ ('tree filter failed: ') ($ VSub_DollarName '$filter_tree'))}) ] ) (command.AndOr ops: [Op_DPipe] children: [ (command.Subshell command_list: (command.CommandList children: [ (command.AndOr ops: [Op_DAmp] children: [ (C {(git)} {(diff-index)} {(-r)} {(--name-only)} {(--ignore-submodules)} {($ VSub_DollarName '$commit')} {(--)} ) (C {(git)} {(ls-files)} {(--others)}) ] ) ] ) redirects: [ (redir.Redir op: <Redir_Great '>'> fd: 16777215 arg_word: {(DQ ($ VSub_DollarName '$tempdir')) (/tree-state)} ) ] ) (command.ControlFlow token:<ControlFlow_Exit exit>) ] ) (command.AndOr ops: [Op_DPipe] children: [ (command.Simple words: [{(git)} {(update-index)} {(--add)} {(--replace)} {(--remove)} {(--stdin)}] redirects: [ (redir.Redir op: <Redir_Less '<'> fd: 16777215 arg_word: {(DQ ($ VSub_DollarName '$tempdir')) (/tree-state)} ) ] ) (command.ControlFlow token:<ControlFlow_Exit exit>) ] ) ] ) ] ) (command.AndOr ops: [Op_DPipe] children: [ (command.Simple words: [{(eval)} {(DQ ($ VSub_DollarName '$filter_index'))}] redirects: [(redir.Redir op:<Redir_Less '<'> fd:16777215 arg_word:{(/dev/null)})] ) (C {(die)} {(DQ ('index filter failed: ') ($ VSub_DollarName '$filter_index'))}) ] ) (command.Assignment pairs: [(assign_pair lhs:(lhs_expr.LhsName name:parentstr) op:Equal rhs:(word.Empty))] ) (command.ForEach iter_name: parent iter_words: [{($ VSub_DollarName '$parents')}] do_arg_iter: F body: (command.DoGroup children: [ (command.ForEach iter_name: reparent iter_words: [ { (word_part.CommandSub left_token: <Left_DollarParen '$('> command_list: (command.CommandList children: [(C {(map)} {(DQ ($ VSub_DollarName '$parent'))})] ) ) } ] do_arg_iter: F body: (command.DoGroup children: [ (command.Case to_match: {(DQ ($ VSub_DollarName '$parentstr') (' '))} arms: [ (case_arm pat_list: [ {(Lit_Star '*') (DQ (' -p ') ($ VSub_DollarName '$reparent') (' ')) (Lit_Star '*') } ] ) (case_arm pat_list: [{(Lit_Star '*')}] action: [ (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:parentstr) op: Equal rhs: { (DQ ($ VSub_DollarName '$parentstr') (' -p ') ($ VSub_DollarName '$reparent') ) } ) ] ) ] ) ] ) ] ) ) ] ) ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Lit_LBracket '[')} {(DQ ($ VSub_DollarName '$filter_parent'))} {(Lit_RBracket ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (command.AndOr ops: [Op_DPipe] children: [ (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:parentstr) op: Equal rhs: { (DQ (word_part.CommandSub left_token: <Left_DollarParen '$('> command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {(echo)} {(DQ ($ VSub_DollarName '$parentstr'))}) (C {(eval)} {(DQ ($ VSub_DollarName '$filter_parent'))}) ] negated: F ) ] ) ) ) } ) ] ) (C {(die)} {(DQ ('parent filter failed: ') ($ VSub_DollarName '$filter_parent'))} ) ] ) ] ) ] ) (command.AndOr ops: [Op_DPipe] children: [ (command.Pipeline children: [ (command.BraceGroup children: [ (command.WhileUntil keyword: <KW_While while> cond: [ (command.AndOr ops: [Op_DAmp] children: [ (command.Simple words: [{(read)} {(-r)} {(header_line)}] more_env: [(env_pair name:IFS val:{(SQ )})] ) (C {(test)} {(-n)} {(DQ ($ VSub_DollarName '$header_line'))}) ] ) ] body: (command.DoGroup children: [ (command.Sentence child: (C {(Lit_Other ':')}) terminator: <Op_Semi ';'> ) ] ) ) (C {(cat)}) ] redirects: [(redir.Redir op:<Redir_Less '<'> fd:16777215 arg_word:{(../commit)})] ) (command.Simple words: [{(eval)} {(DQ ($ VSub_DollarName '$filter_msg'))}] redirects: [ (redir.Redir op: <Redir_Great '>'> fd: 16777215 arg_word: {(../message)} ) ] ) ] negated: F ) (C {(die)} {(DQ ('msg filter failed: ') ($ VSub_DollarName '$filter_msg'))}) ] ) (command.If arms: [ (if_arm cond: [(C {(test)} {(-n)} {(DQ ($ VSub_DollarName '$need_index'))})] action: [ (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:tree) op: Equal rhs: { (word_part.CommandSub left_token: <Left_DollarParen '$('> command_list: (command.CommandList children: [(C {(git)} {(write-tree)})] ) ) } ) ] ) ] ) ] else_action: [ (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:tree) op: Equal rhs: { (word_part.CommandSub left_token: <Left_DollarParen '$('> command_list: (command.CommandList children: [ (C {(git)} {(rev-parse)} {(DQ ($ VSub_DollarName '$commit') ('^{tree}'))} ) ] ) ) } ) ] ) ] ) (command.AndOr ops: [Op_DPipe] children: [ (command.Simple words: [ {(Lit_Splice '@SHELL_PATH') (Lit_Other '@')} {(-c)} {(DQ ($ VSub_DollarName '$filter_commit'))} {(DQ ('git commit-tree'))} {(DQ ($ VSub_DollarName '$tree'))} {($ VSub_DollarName '$parentstr')} ] redirects: [ (redir.Redir op: <Redir_Less '<'> fd: 16777215 arg_word: {(../message)} ) (redir.Redir op: <Redir_Great '>'> fd: 16777215 arg_word: {(../map/) ($ VSub_DollarName '$commit')} ) ] more_env: [(env_pair name:workdir val:{($ VSub_DollarName '$workdir')})] ) (C {(die)} {(DQ ('could not write rewritten commit'))}) ] ) ] ) redirects: [(redir.Redir op:<Redir_Less '<'> fd:16777215 arg_word:{(../revs)})] ) (command.If arms: [ (if_arm cond: [(C {(test)} {(DQ ($ VSub_DollarName '$remap_to_ancestor'))} {(Lit_Other '=')} {(t)})] action: [ (command.WhileUntil keyword: <KW_While while> cond: [(C {(read)} {(ref)})] body: (command.DoGroup children: [ (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:sha1) op: Equal rhs: { (word_part.CommandSub left_token: <Left_DollarParen '$('> command_list: (command.CommandList children: [ (C {(git)} {(rev-parse)} {(DQ ($ VSub_DollarName '$ref')) (Lit_Other '^') (0)} ) ] ) ) } ) ] ) (command.AndOr ops: [Op_DAmp] children: [ (C {(test)} {(-f)} {(DQ ($ VSub_DollarName '$workdir')) (/../map/) ($ VSub_DollarName '$sha1')} ) (command.ControlFlow token: <ControlFlow_Continue continue> ) ] ) (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:ancestor) op: Equal rhs: { (word_part.CommandSub left_token: <Left_DollarParen '$('> command_list: (command.CommandList children: [ (C {(git)} {(rev-list)} {(--simplify-merges)} {(-1)} {(DQ ($ VSub_DollarName '$ref'))} {(DQ ($ VSub_At '$@'))} ) ] ) ) } ) ] ) (command.AndOr ops: [Op_DAmp] children: [ (C {(test)} {(DQ ($ VSub_DollarName '$ancestor'))}) (command.Simple words: [ {(echo)} { (word_part.CommandSub left_token: <Left_DollarParen '$('> command_list: (command.CommandList children: [(C {(map)} {($ VSub_DollarName '$ancestor')})] ) ) } ] redirects: [ (redir.Redir op: <Redir_DGreat '>>'> fd: 16777215 arg_word: {(DQ ($ VSub_DollarName '$workdir')) (/../map/) ($ VSub_DollarName '$sha1') } ) ] ) ] ) ] ) redirects: [ (redir.Redir op: <Redir_Less '<'> fd: 16777215 arg_word: {(DQ ($ VSub_DollarName '$tempdir')) (/heads)} ) ] ) ] ) ] ) (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:_x40) op: Equal rhs: {(SQ <'[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]'>)} ) ] ) (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:_x40) op: Equal rhs: { (DQ ($ VSub_DollarName '$_x40') ($ VSub_DollarName '$_x40') ($ VSub_DollarName '$_x40') ($ VSub_DollarName '$_x40') ($ VSub_DollarName '$_x40') ($ VSub_DollarName '$_x40') ($ VSub_DollarName '$_x40') ($ VSub_DollarName '$_x40') ) } ) ] ) (C {(echo)}) (command.WhileUntil keyword: <KW_While while> cond: [(C {(read)} {(ref)})] body: (command.DoGroup children: [ (command.AndOr ops: [Op_DAmp] children: [ (C {(test)} {(-f)} {(DQ ($ VSub_DollarName '$orig_namespace') ($ VSub_DollarName '$ref'))} ) (command.ControlFlow token:<ControlFlow_Continue continue>) ] ) (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:sha1) op: Equal rhs: { (word_part.CommandSub left_token: <Left_DollarParen '$('> command_list: (command.CommandList children: [ (C {(git)} {(rev-parse)} {(DQ ($ VSub_DollarName '$ref')) (Lit_Other '^') (0)} ) ] ) ) } ) ] ) (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:rewritten) op: Equal rhs: { (word_part.CommandSub left_token: <Left_DollarParen '$('> command_list: (command.CommandList children: [(C {(map)} {($ VSub_DollarName '$sha1')})] ) ) } ) ] ) (command.AndOr ops: [Op_DAmp Op_DAmp] children: [ (C {(test)} {($ VSub_DollarName '$sha1')} {(Lit_Other '=')} {(DQ ($ VSub_DollarName '$rewritten'))} ) (C {(warn)} {(DQ ("WARNING: Ref '") ($ VSub_DollarName '$ref') ("' is unchanged"))}) (command.ControlFlow token:<ControlFlow_Continue continue>) ] ) (command.Case to_match: {(DQ ($ VSub_DollarName '$rewritten'))} arms: [ (case_arm pat_list: [{(SQ )}] action: [ (C {(echo)} {(DQ ("Ref '") ($ VSub_DollarName '$ref') ("' was deleted"))}) (command.AndOr ops: [Op_DPipe] children: [ (C {(git)} {(update-ref)} {(-m)} {(DQ ('filter-branch: delete'))} {(-d)} {(DQ ($ VSub_DollarName '$ref'))} {($ VSub_DollarName '$sha1')} ) (C {(die)} {(DQ ('Could not delete ') ($ VSub_DollarName '$ref'))}) ] ) ] ) (case_arm pat_list: [{($ VSub_DollarName '$_x40')}] action: [ (C {(echo)} {(DQ ("Ref '") ($ VSub_DollarName '$ref') ("' was rewritten"))}) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.Pipeline children: [ (command.Simple words: [ {(git)} {(update-ref)} {(-m)} {(DQ ('filter-branch: rewrite'))} {(DQ ($ VSub_DollarName '$ref'))} {($ VSub_DollarName '$rewritten')} {($ VSub_DollarName '$sha1')} ] redirects: [ (redir.Redir op: <Redir_Great '2>'> fd: 2 arg_word: {(/dev/null)} ) ] ) ] negated: T ) terminator: <Op_Semi ';'> ) ] action: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(test)} { (word_part.CommandSub left_token: <Left_DollarParen '$('> command_list: (command.CommandList children: [ (C {(git)} {(cat-file)} {(-t)} {(DQ ($ VSub_DollarName '$ref'))} ) ] ) ) } {(Lit_Other '=')} {(tag)} ) terminator: <Op_Semi ';'> ) ] action: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(test)} {(-z)} {(DQ ($ VSub_DollarName '$filter_tag_name'))} ) terminator: <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." ) ) } ) ] ) ] ) ] ) ] else_action: [ (C {(die)} {(DQ ('Could not rewrite ') ($ VSub_DollarName '$ref'))}) ] ) ] ) ] ) ] ) (case_arm pat_list: [{(Lit_Star '*')}] action: [ (C {(warn)} { (DQ ("WARNING: '") ($ VSub_DollarName '$ref') ("' was rewritten into multiple commits:") ) } ) (C {(warn)} {(DQ ($ VSub_DollarName '$rewritten'))}) (C {(warn)} { (DQ ("WARNING: Ref '") ($ VSub_DollarName '$ref') ("' points to the first one now.") ) } ) (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:rewritten) op: Equal rhs: { (word_part.CommandSub left_token: <Left_DollarParen '$('> command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {(echo)} {(DQ ($ VSub_DollarName '$rewritten'))}) (C {(head)} {(-n)} {(1)}) ] negated: F ) ] ) ) } ) ] ) (command.AndOr ops: [Op_DPipe] children: [ (C {(git)} {(update-ref)} {(-m)} {(DQ ('filter-branch: rewrite to first'))} {(DQ ($ VSub_DollarName '$ref'))} {($ VSub_DollarName '$rewritten')} {($ VSub_DollarName '$sha1')} ) (C {(die)} {(DQ ('Could not rewrite ') ($ VSub_DollarName '$ref'))}) ] ) ] ) ] ) (command.AndOr ops: [Op_DPipe] children: [ (C {(git)} {(update-ref)} {(-m)} {(DQ ('filter-branch: backup'))} {(DQ ($ VSub_DollarName '$orig_namespace') ($ VSub_DollarName '$ref'))} {($ VSub_DollarName '$sha1')} ) (command.ControlFlow token:<ControlFlow_Exit exit>) ] ) ] ) redirects: [ (redir.Redir op: <Redir_Less '<'> fd: 16777215 arg_word: {(DQ ($ VSub_DollarName '$tempdir')) (/heads)} ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Lit_LBracket '[')} {(DQ ($ VSub_DollarName '$filter_tag_name'))} {(Lit_RBracket ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (command.Pipeline children: [ (C {(git)} {(for-each-ref)} {(--format) (Lit_Other '=') (SQ <'%(objectname) %(objecttype) %(refname)'>)} {(refs/tags)} ) (command.WhileUntil keyword: <KW_While while> cond: [ (command.Sentence child: (C {(read)} {(sha1)} {(type)} {(ref)}) terminator: <Op_Semi ';'> ) ] body: (command.DoGroup children: [ (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:ref) op: Equal rhs: { (DQ (word_part.BracedVarSub token: <VSub_Name ref> suffix_op: (suffix_op.Unary op_id: VOp1_Pound arg_word: {(refs) (Lit_Slash /) (tags) (Lit_Slash /)} ) ) ) } ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Lit_LBracket '[')} {(DQ ($ VSub_DollarName '$type'))} {(KW_Bang '!') (Lit_Other '=')} {(DQ (commit))} {(-a)} {(DQ ($ VSub_DollarName '$type'))} {(KW_Bang '!') (Lit_Other '=')} {(DQ (tag))} {(Lit_RBracket ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (command.Sentence child: (command.ControlFlow token:<ControlFlow_Continue continue>) terminator: <Op_Semi ';'> ) ] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Lit_LBracket '[')} {(DQ ($ VSub_DollarName '$type'))} {(Lit_Other '=')} {(DQ (tag))} {(Lit_RBracket ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:sha1t) op: Equal rhs: {(DQ ($ VSub_DollarName '$sha1'))} ) ] ) (command.AndOr ops: [Op_DPipe] children: [ (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:sha1) op: Equal rhs: { (DQ (word_part.CommandSub left_token: <Left_DollarParen '$('> command_list: (command.CommandList children: [ (C {(git)} {(rev-parse)} {(-q)} {(DQ ($ VSub_DollarName '$sha1')) (Lit_Other '^') (Lit_LBrace '{') (commit) (Lit_RBrace '}') } ) ] ) ) ) } ) ] ) (command.ControlFlow token: <ControlFlow_Continue continue> ) ] ) ] ) ] ) (command.AndOr ops: [Op_DPipe] children: [ (C {(Lit_LBracket '[')} {(-f)} {(DQ (../map/) ($ VSub_DollarName '$sha1'))} {(Lit_RBracket ']')} ) (command.ControlFlow token: <ControlFlow_Continue continue> ) ] ) (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:new_sha1) op: Equal rhs: { (DQ (word_part.CommandSub left_token: <Left_DollarParen '$('> command_list: (command.CommandList children: [ (C {(cat)} {(DQ (../map/) ($ VSub_DollarName '$sha1'))}) ] ) ) ) } ) ] ) (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:GIT_COMMIT) op: Equal rhs: {(DQ ($ VSub_DollarName '$sha1'))} ) ] ) (C {(export)} {(GIT_COMMIT)}) (command.AndOr ops: [Op_DPipe] children: [ (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:new_ref) op: Equal rhs: { (DQ (word_part.CommandSub left_token: <Left_DollarParen '$('> command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {(echo)} {(DQ ($ VSub_DollarName '$ref'))}) (C {(eval)} {(DQ ($ VSub_DollarName '$filter_tag_name'))} ) ] negated: F ) ] ) ) ) } ) ] ) (C {(die)} { (DQ ('tag name filter failed: ') ($ VSub_DollarName '$filter_tag_name') ) } ) ] ) (C {(echo)} { (DQ ($ VSub_DollarName '$ref') (' -> ') ($ VSub_DollarName '$new_ref') (' (') ($ VSub_DollarName '$sha1') (' -> ') ($ VSub_DollarName '$new_sha1') (')') ) } ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Lit_LBracket '[')} {(DQ ($ VSub_DollarName '$type'))} {(Lit_Other '=')} {(DQ (tag))} {(Lit_RBracket ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (command.AndOr ops: [Op_DPipe] children: [ (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:new_sha1) op: Equal rhs: { (word_part.CommandSub left_token: <Left_DollarParen '$('> command_list: (command.CommandList children: [ (command.Pipeline children: [ (command.Subshell command_list: (command.CommandList children: [ (C {(printf)} { (SQ < 'object %s\\ntype commit\\ntag %s\\n' > ) } {(DQ ($ VSub_DollarName '$new_sha1'))} {(DQ ($ VSub_DollarName '$new_ref'))} ) (command.Pipeline children: [ (C {(git)} {(cat-file)} {(tag)} { (DQ ($ 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 ) ] ) ) (C {(git)} {(mktag)}) ] negated: F ) ] ) ) } ) ] ) (C {(die)} { (DQ ('Could not create new tag object for ') ($ VSub_DollarName '$ref') ) } ) ] ) (command.If arms: [ (if_arm cond: [ (command.Pipeline children: [ (C {(git)} {(cat-file)} {(tag)} {(DQ ($ VSub_DollarName '$ref'))} ) (command.Simple words: [ {(sane_grep)} {(SQ <'^-----BEGIN PGP SIGNATURE-----'>)} ] redirects: [ (redir.Redir op: <Redir_Great '>'> fd: 16777215 arg_word: {(/dev/null)} ) (redir.Redir op: <Redir_GreatAnd '2>&'> fd: 2 arg_word: {(1)} ) ] ) ] negated: F ) ] action: [ (C {(warn)} { (DQ ('gpg signature stripped from tag object ') ($ VSub_DollarName '$sha1t') ) } ) ] ) ] ) ] ) ] ) (command.AndOr ops: [Op_DPipe] children: [ (C {(git)} {(update-ref)} {(DQ (refs/tags/) ($ VSub_DollarName '$new_ref'))} {(DQ ($ VSub_DollarName '$new_sha1'))} ) (C {(die)} {(DQ ('Could not write tag ') ($ VSub_DollarName '$new_ref'))}) ] ) ] ) ) ] negated: F ) ] ) ] ) (C {(cd)} {(DQ ($ VSub_DollarName '$orig_dir'))}) (C {(rm)} {(-rf)} {(DQ ($ VSub_DollarName '$tempdir'))}) (C {(trap)} {(-)} {(0)}) (C {(unset)} {(GIT_DIR)} {(GIT_WORK_TREE)} {(GIT_INDEX_FILE)}) (command.AndOr ops: [Op_DPipe] children: [ (C {(test)} {(-z)} {(DQ ($ VSub_DollarName '$ORIG_GIT_DIR'))}) (command.BraceGroup children: [ (command.AndOr ops: [Op_DAmp] children: [ (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:GIT_DIR) op: Equal rhs: {(DQ ($ VSub_DollarName '$ORIG_GIT_DIR'))} ) ] ) (C {(export)} {(GIT_DIR)}) ] ) ] ) ] ) (command.AndOr ops: [Op_DPipe] children: [ (C {(test)} {(-z)} {(DQ ($ VSub_DollarName '$ORIG_GIT_WORK_TREE'))}) (command.BraceGroup children: [ (command.AndOr ops: [Op_DAmp] children: [ (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:GIT_WORK_TREE) op: Equal rhs: {(DQ ($ VSub_DollarName '$ORIG_GIT_WORK_TREE'))} ) ] ) (C {(export)} {(GIT_WORK_TREE)}) ] ) ] ) ] ) (command.AndOr ops: [Op_DPipe] children: [ (C {(test)} {(-z)} {(DQ ($ VSub_DollarName '$ORIG_GIT_INDEX_FILE'))}) (command.BraceGroup children: [ (command.AndOr ops: [Op_DAmp] children: [ (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:GIT_INDEX_FILE) op: Equal rhs: {(DQ ($ VSub_DollarName '$ORIG_GIT_INDEX_FILE'))} ) ] ) (C {(export)} {(GIT_INDEX_FILE)}) ] ) ] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Lit_LBracket '[')} { (DQ (word_part.CommandSub left_token: <Left_DollarParen '$('> command_list: (command.CommandList children:[(C {(is_bare_repository)})]) ) ) } {(Lit_Other '=')} {(false)} {(Lit_RBracket ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (command.AndOr ops: [Op_DPipe] children: [ (C {(git)} {(read-tree)} {(-u)} {(-m)} {(HEAD)}) (command.ControlFlow token:<ControlFlow_Exit exit>) ] ) ] ) ] ) (command.ControlFlow token:<ControlFlow_Exit exit> arg_word:{(0)}) ] )