(List (= scope= flags=0 words=[] bindings=[('functions', {[ComSub (Com redirects=[(HereDocRedirectNode here_end='EOF' do_expansion=False body_word={[LIT_CHARS "warn () {\n"] [LIT_CHARS "\techo \"$*\" >&2\n"] [LIT_CHARS "}\n"] [LIT_CHARS "\n"] [LIT_CHARS "map()\n"] [LIT_CHARS "{\n"] [LIT_CHARS "\t# if it was not rewritten, take the original\n"] [LIT_CHARS "\tif test -r \"$workdir/../map/$1\"\n"] [LIT_CHARS "\tthen\n"] [LIT_CHARS "\t\tcat \"$workdir/../map/$1\"\n"] [LIT_CHARS "\telse\n"] [LIT_CHARS "\t\techo \"$1\"\n"] [LIT_CHARS "\tfi\n"] [LIT_CHARS "}\n"] [LIT_CHARS "\n"] [LIT_CHARS "# if you run 'skip_commit \"$@\"' in a commit filter, it will print\n"] [LIT_CHARS "# the (mapped) parents, effectively skipping the commit.\n"] [LIT_CHARS "\n"] [LIT_CHARS "skip_commit()\n"] [LIT_CHARS "{\n"] [LIT_CHARS "\tshift;\n"] [LIT_CHARS "\twhile [ -n \"$1\" ];\n"] [LIT_CHARS "\tdo\n"] [LIT_CHARS "\t\tshift;\n"] [LIT_CHARS "\t\tmap \"$1\";\n"] [LIT_CHARS "\t\tshift;\n"] [LIT_CHARS "\tdone;\n"] [LIT_CHARS "}\n"] [LIT_CHARS "\n"] [LIT_CHARS "# if you run 'git_commit_non_empty_tree \"$@\"' in a commit filter,\n"] [LIT_CHARS "# it will skip commits that leave the tree untouched, commit the other.\n"] [LIT_CHARS "git_commit_non_empty_tree()\n"] [LIT_CHARS "{\n"] [LIT_CHARS "\tif test $# = 3 && test \"$1\" = $(git rev-parse \"$3^{tree}\"); then\n"] [LIT_CHARS "\t\tmap \"$3\"\n"] [LIT_CHARS "\telse\n"] [LIT_CHARS "\t\tgit commit-tree \"$@\"\n"] [LIT_CHARS "\tfi\n"] [LIT_CHARS "}\n"] [LIT_CHARS "# override die(): this version puts in an extra line break, so that\n"] [LIT_CHARS "# the progress is still visible\n"] [LIT_CHARS "\n"] [LIT_CHARS "die()\n"] [LIT_CHARS "{\n"] [LIT_CHARS "\techo >&2\n"] [LIT_CHARS "\techo \"$*\" >&2\n"] [LIT_CHARS "\texit 1\n"] [LIT_CHARS "}\n"]} 0)]{[LIT_CHARS cat]})]})]) (Com {[LIT_CHARS eval]} {[DQ [VarSub functions]]}) (FunctionDef finish_ident [] (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "case "][\ LIT_ESCAPED_CHAR "\\\""][\ LIT_ESCAPED_CHAR "\\$"][LIT_CHARS GIT_][VarSub 1][LIT_CHARS _NAME][\ LIT_ESCAPED_CHAR "\\\""][LIT_CHARS " in "][\ LIT_ESCAPED_CHAR "\\\""][\ LIT_ESCAPED_CHAR "\\\""][LIT_CHARS ") GIT_"][VarSub 1][LIT_CHARS "_NAME="][\ LIT_ESCAPED_CHAR "\\\""][\ LIT_ESCAPED_CHAR "\\$"][LIT_CHARS "{GIT_"][VarSub 1][LIT_CHARS "_EMAIL%%@*}"][\ LIT_ESCAPED_CHAR "\\\""][LIT_CHARS " && export GIT_"][VarSub 1][LIT_CHARS "_NAME;; esac"]]}) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "export GIT_"][VarSub 1][LIT_CHARS _NAME]]}) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "export GIT_"][VarSub 1][LIT_CHARS _EMAIL]]}) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "export GIT_"][VarSub 1][LIT_CHARS _DATE]]}) ) ) (FunctionDef set_ident [] (List (Com {[LIT_CHARS parse_ident_from_commit]} {[LIT_CHARS author]} {[LIT_CHARS AUTHOR]} {[LIT_CHARS committer]} {[LIT_CHARS COMMITTER]}) (Com {[LIT_CHARS finish_ident]} {[LIT_CHARS AUTHOR]}) (Com {[LIT_CHARS finish_ident]} {[LIT_CHARS COMMITTER]}) ) ) (= scope= flags=0 words=[] bindings=[('USAGE', {[DQ [LIT_CHARS "[--env-filter ] [--tree-filter ]\n"][LIT_CHARS "\t[--index-filter ] [--parent-filter ]\n"][LIT_CHARS "\t[--msg-filter ] [--commit-filter ]\n"][LIT_CHARS "\t[--tag-name-filter ] [--subdirectory-filter ]\n"][LIT_CHARS "\t[--original ] [-d ] [-f | --force]\n"][LIT_CHARS "\t[...]"]]})]) (= scope= flags=0 words=[] bindings=[('OPTIONS_SPEC', {[SQ ]})]) (Com {[LIT_CHARS .]} {[LIT_CHARS git-sh-setup]}) (If (Com {[LIT_OTHER "["]} {[DQ [ComSub (Com {[LIT_CHARS is_bare_repository]})]]} {[LIT_OTHER "="]} {[LIT_CHARS false]} {[LIT_OTHER "]"]}) (Com {[LIT_CHARS require_clean_work_tree]} {[SQ ]}) ) (= scope= flags=0 words=[] bindings=[('tempdir', {[LIT_CHARS .git-rewrite]})]) (= scope= flags=0 words=[] bindings=[('filter_env', {[SQ ]})]) (= scope= flags=0 words=[] bindings=[('filter_tree', {[SQ ]})]) (= scope= flags=0 words=[] bindings=[('filter_index', {[SQ ]})]) (= scope= flags=0 words=[] bindings=[('filter_parent', {[SQ ]})]) (= scope= flags=0 words=[] bindings=[('filter_msg', {[LIT_CHARS cat]})]) (= scope= flags=0 words=[] bindings=[('filter_commit', {[SQ ]})]) (= scope= flags=0 words=[] bindings=[('filter_tag_name', {[SQ ]})]) (= scope= flags=0 words=[] bindings=[('filter_subdir', {[SQ ]})]) (= scope= flags=0 words=[] bindings=[('orig_namespace', {[LIT_CHARS refs/original/]})]) (= scope= flags=0 words=[] bindings=[('force', {[SQ ]})]) (= scope= flags=0 words=[] bindings=[('prune_empty', {[SQ ]})]) (= scope= flags=0 words=[] bindings=[('remap_to_ancestor', {[SQ ]})]) (While (Com {[LIT_OTHER ":"]}) (List (Case to_match={[DQ [VarSub 1]]}, pat_word_list=[[{[LIT_CHARS --]}], [{[LIT_CHARS --force]}, {[LIT_CHARS -f]}], [{[LIT_CHARS --remap-to-ancestor]}], [{[LIT_CHARS --prune-empty]}], [{[LIT_CHARS -] [LIT_OTHER "*"]}], [{[LIT_OTHER "*"]}]] (List (Com {[LIT_CHARS shift]}) (Com {[LIT_CHARS break]}) ) (List (Com {[LIT_CHARS shift]}) (= scope= flags=0 words=[] bindings=[('force', {[LIT_CHARS t]})]) (Com {[LIT_CHARS continue]}) ) (List (Com {[LIT_CHARS shift]}) (= scope= flags=0 words=[] bindings=[('remap_to_ancestor', {[LIT_CHARS t]})]) (Com {[LIT_CHARS continue]}) ) (List (Com {[LIT_CHARS shift]}) (= scope= flags=0 words=[] bindings=[('prune_empty', {[LIT_CHARS t]})]) (Com {[LIT_CHARS continue]}) ) (ElseTrue) (Com {[LIT_CHARS break]}) ) (= scope= flags=0 words=[] bindings=[('ARG', {[DQ [VarSub 1]]})]) (Case to_match={[DQ [VarSub #]]}, pat_word_list=[[{[LIT_CHARS 1]}]] (Com {[LIT_CHARS usage]}) ) (Com {[LIT_CHARS shift]}) (= scope= flags=0 words=[] bindings=[('OPTARG', {[DQ [VarSub 1]]})]) (Com {[LIT_CHARS shift]}) (Case to_match={[DQ [VarSub ARG]]}, pat_word_list=[[{[LIT_CHARS -d]}], [{[LIT_CHARS --env-filter]}], [{[LIT_CHARS --tree-filter]}], [{[LIT_CHARS --index-filter]}], [{[LIT_CHARS --parent-filter]}], [{[LIT_CHARS --msg-filter]}], [{[LIT_CHARS --commit-filter]}], [{[LIT_CHARS --tag-name-filter]}], [{[LIT_CHARS --subdirectory-filter]}], [{[LIT_CHARS --original]}], [{[LIT_OTHER "*"]}]] (= scope= flags=0 words=[] bindings=[('tempdir', {[DQ [VarSub OPTARG]]})]) (= scope= flags=0 words=[] bindings=[('filter_env', {[DQ [VarSub OPTARG]]})]) (= scope= flags=0 words=[] bindings=[('filter_tree', {[DQ [VarSub OPTARG]]})]) (= scope= flags=0 words=[] bindings=[('filter_index', {[DQ [VarSub OPTARG]]})]) (= scope= flags=0 words=[] bindings=[('filter_parent', {[DQ [VarSub OPTARG]]})]) (= scope= flags=0 words=[] bindings=[('filter_msg', {[DQ [VarSub OPTARG]]})]) (= scope= flags=0 words=[] bindings=[('filter_commit', {[DQ [VarSub functions][LIT_CHARS "; "][VarSub OPTARG]]})]) (= scope= flags=0 words=[] bindings=[('filter_tag_name', {[DQ [VarSub OPTARG]]})]) (List (= scope= flags=0 words=[] bindings=[('filter_subdir', {[DQ [VarSub OPTARG]]})]) (= scope= flags=0 words=[] bindings=[('remap_to_ancestor', {[LIT_CHARS t]})]) ) (= scope= flags=0 words=[] bindings=[('orig_namespace', {[ComSub (Com {[LIT_CHARS expr]} {[DQ [VarSub OPTARG][LIT_CHARS /]]} {[LIT_OTHER ":"]} {[SQ ]})] [LIT_CHARS /]})]) (Com {[LIT_CHARS usage]}) ) ) ) (Case to_match={[DQ [VarSub prune_empty][LIT_CHARS ","][VarSub filter_commit]]}, pat_word_list=[[{[LIT_COMMA ","]}], [{[LIT_CHARS t] [LIT_COMMA ","]}], [{[LIT_COMMA ","] [LIT_OTHER "*"]}], [{[LIT_OTHER "*"]}]] (= scope= flags=0 words=[] bindings=[('filter_commit', {[SQ ]})]) (= scope= flags=0 words=[] bindings=[('filter_commit', {[DQ [VarSub functions][LIT_CHARS ";"]] [SQ ]})]) (ElseTrue) (Com {[LIT_CHARS die]} {[DQ [LIT_CHARS "Cannot set --prune-empty and --commit-filter at the same time"]]}) ) (Case to_match={[DQ [VarSub force]]}, pat_word_list=[[{[LIT_CHARS t]}], [{[SQ ]}]] (Com {[LIT_CHARS rm]} {[LIT_CHARS -rf]} {[DQ [VarSub tempdir]]}) (AndOr OP_AND_IF (Com {[LIT_CHARS test]} {[LIT_CHARS -d]} {[DQ [VarSub tempdir]]}) (Com {[LIT_CHARS die]} {[DQ [VarSub tempdir][LIT_CHARS " already exists, please remove it"]]}) ) ) (= scope= flags=0 words=[] bindings=[('orig_dir', {[ComSub (Com {[LIT_CHARS pwd]})]})]) (AndOr OP_AND_IF (Com {[LIT_CHARS mkdir]} {[LIT_CHARS -p]} {[DQ [VarSub tempdir][LIT_CHARS /t]]}) (AndOr OP_AND_IF (= scope= flags=0 words=[] bindings=[('tempdir', {[DQ [ComSub (List (Com {[LIT_CHARS cd]} {[DQ [VarSub tempdir]]}) (Com {[LIT_CHARS pwd]}) )]]})]) (AndOr OP_AND_IF (Com {[LIT_CHARS cd]} {[DQ [VarSub tempdir][LIT_CHARS /t]]}) (AndOr OP_OR_IF (= scope= flags=0 words=[] bindings=[('workdir', {[DQ [ComSub (Com {[LIT_CHARS pwd]})]]})]) (Com {[LIT_CHARS die]} {[DQ ]}) ) ) ) ) (Com {[LIT_CHARS trap]} {[SQ ]} {[LIT_CHARS 0]}) (= scope= flags=0 words=[] bindings=[('ORIG_GIT_DIR', {[DQ [VarSub GIT_DIR]]})]) (= scope= flags=0 words=[] bindings=[('ORIG_GIT_WORK_TREE', {[DQ [VarSub GIT_WORK_TREE]]})]) (= scope= flags=0 words=[] bindings=[('ORIG_GIT_INDEX_FILE', {[DQ [VarSub GIT_INDEX_FILE]]})]) (= scope= flags=0 words=[] bindings=[('GIT_WORK_TREE', {[LIT_CHARS .]})]) (= scope= flags=1 words=[{[LIT_CHARS GIT_DIR]}, {[LIT_CHARS GIT_WORK_TREE]}] bindings=[]) (AndOr OP_OR_IF (Com {[LIT_CHARS git]} {[LIT_CHARS for-each-ref]} < (FilenameRedirectNode filename={[DQ [VarSub tempdir]] [LIT_CHARS /backup-refs]} "> 1), > ) (Com {[LIT_CHARS exit]}) ) (While (Com {[LIT_CHARS read]} {[LIT_CHARS sha1]} {[LIT_CHARS type]} {[LIT_CHARS name]}) (Case to_match={[DQ [VarSub force][LIT_CHARS ","][VarSub name]]}, pat_word_list=[[{[LIT_COMMA ","] [VarSub orig_namespace] [LIT_OTHER "*"]}], [{[LIT_CHARS t] [LIT_COMMA ","] [VarSub orig_namespace] [LIT_OTHER "*"]}]] (Com {[LIT_CHARS die]} {[DQ [LIT_CHARS "Cannot create a new backup.\n"][LIT_CHARS "A previous backup already exists in "][VarSub orig_namespace][LIT_CHARS "\n"][LIT_CHARS "Force overwriting the backup with -f"]]}) (Com {[LIT_CHARS git]} {[LIT_CHARS update-ref]} {[LIT_CHARS -d]} {[DQ [VarSub name]]} {[VarSub sha1]}) ) ) (AndOr OP_OR_IF (Com {[LIT_CHARS git]} {[LIT_CHARS rev-parse]} {[LIT_CHARS --no-flags]} {[LIT_CHARS --revs-only]} {[LIT_CHARS --symbolic-full-name]} {[LIT_CHARS --default]} {[LIT_CHARS HEAD]} {[DQ [VarSub @]]} < (FilenameRedirectNode filename={[DQ [VarSub tempdir]] [LIT_CHARS /raw-heads]} "> 1), > ) (Com {[LIT_CHARS exit]}) ) (Com {[LIT_CHARS sed]} {[LIT_CHARS -e]} {[SQ ]} {[DQ [VarSub tempdir]] [LIT_CHARS /raw-heads]} < (FilenameRedirectNode filename={[DQ [VarSub tempdir]] [LIT_CHARS /heads]} "> 1), > ) (AndOr OP_OR_IF (Com {[LIT_CHARS test]} {[LIT_CHARS -s]} {[DQ [VarSub tempdir]] [LIT_CHARS /heads]}) (Com {[LIT_CHARS die]} {[DQ [LIT_CHARS "Which ref do you want to rewrite?"]]}) ) (= scope= flags=0 words=[] bindings=[('GIT_INDEX_FILE', {[DQ [ComSub (Com {[LIT_CHARS pwd]})][LIT_CHARS /../index]]})]) (= scope= flags=1 words=[{[LIT_CHARS GIT_INDEX_FILE]}] bindings=[]) (AndOr OP_OR_IF (Com {[LIT_CHARS mkdir]} {[LIT_CHARS ../map]}) (Com {[LIT_CHARS die]} {[DQ [LIT_CHARS "Could not create map/ directory"]]}) ) (AndOr OP_OR_IF (= scope= flags=0 words=[] bindings=[('nonrevs', {[ComSub (Com {[LIT_CHARS git]} {[LIT_CHARS rev-parse]} {[LIT_CHARS --no-revs]} {[DQ [VarSub @]]})]})]) (Com {[LIT_CHARS exit]}) ) (If (Com {[LIT_CHARS test]} {[LIT_CHARS -z]} {[DQ [VarSub nonrevs]]}) (= scope= flags=0 words=[] bindings=[('dashdash', {[LIT_CHARS --]})]) (ElseTrue) (List (= scope= flags=0 words=[] bindings=[('dashdash', {[SQ ]})]) (= scope= flags=0 words=[] bindings=[('remap_to_ancestor', {[LIT_CHARS t]})]) ) ) (Com {[LIT_CHARS git]} {[LIT_CHARS rev-parse]} {[LIT_CHARS --revs-only]} {[DQ [VarSub @]]} < (FilenameRedirectNode filename={[LIT_CHARS ../parse]} "> 1), > ) (Case to_match={[DQ [VarSub filter_subdir]]}, pat_word_list=[[{[DQ ]}], [{[LIT_OTHER "*"]}]] (Com {[LIT_CHARS eval]} {[LIT_CHARS set]} {[LIT_CHARS --]} {[DQ [ComSub (Com {[LIT_CHARS git]} {[LIT_CHARS rev-parse]} {[LIT_CHARS --sq]} {[LIT_CHARS --no-revs]} {[DQ [VarSub @]]})]]}) (Com {[LIT_CHARS eval]} {[LIT_CHARS set]} {[LIT_CHARS --]} {[DQ [ComSub (Com {[LIT_CHARS git]} {[LIT_CHARS rev-parse]} {[LIT_CHARS --sq]} {[LIT_CHARS --no-revs]} {[DQ [VarSub @]]} {[VarSub dashdash]} {[DQ [VarSub filter_subdir]]})]]}) ) (AndOr OP_OR_IF (Com {[LIT_CHARS git]} {[LIT_CHARS rev-list]} {[LIT_CHARS --reverse]} {[LIT_CHARS --topo-order]} {[LIT_CHARS --default]} {[LIT_CHARS HEAD]} {[LIT_CHARS --parents]} {[LIT_CHARS --simplify-merges]} {[LIT_CHARS --stdin]} {[DQ [VarSub @]]} < (FilenameRedirectNode filename={[LIT_CHARS ../parse]} 0), (FilenameRedirectNode filename={[LIT_CHARS ../revs]} "> 1), > ) (Com {[LIT_CHARS die]} {[DQ [LIT_CHARS "Could not get the commits"]]}) ) (= scope= flags=0 words=[] bindings=[('commits', {[ComSub (Pipeline (Com redirects=[(FilenameRedirectNode filename={[LIT_CHARS ../revs]} 0)]{[LIT_CHARS wc]} {[LIT_CHARS -l]}) (Com {[LIT_CHARS tr]} {[LIT_CHARS -d]} {[DQ [LIT_CHARS " "]]}) )]})]) (AndOr OP_AND_IF (Com {[LIT_CHARS test]} {[VarSub commits]} {[LIT_CHARS -eq]} {[LIT_CHARS 0]}) (Com {[LIT_CHARS die]} {[DQ [LIT_CHARS "Found nothing to rewrite"]]}) ) (FunctionDef report_progress [] (List (If (AndOr OP_AND_IF (Com {[LIT_CHARS test]} {[LIT_CHARS -n]} {[DQ [VarSub progress]]}) (Com {[LIT_CHARS test]} {[VarSub git_filter_branch__commit_count]} {[LIT_CHARS -gt]} {[VarSub next_sample_at]}) ) (List (= scope= flags=0 words=[] bindings=[('count', {[VarSub git_filter_branch__commit_count]})]) (= scope= flags=0 words=[] bindings=[('now', {[ComSub (Com {[LIT_CHARS date]} {[LIT_OTHER "+"] [LIT_OTHER "%"] [LIT_CHARS s]})]})]) (= scope= flags=0 words=[] bindings=[('elapsed', {[ArithSub {A2 AS_OP_MINUS {A Atom NODE_ARITH_WORD {[VarSub now]}} {A Atom NODE_ARITH_WORD {[VarSub start_timestamp]}}}]})]) (= scope= flags=0 words=[] bindings=[('remaining', {[ArithSub {A2 AS_OP_SLASH {A2 AS_OP_STAR {A2 AS_OP_MINUS {A Atom NODE_ARITH_WORD {[VarSub commits]}} {A Atom NODE_ARITH_WORD {[VarSub count]}}} {A Atom NODE_ARITH_WORD {[VarSub elapsed]}}} {A Atom NODE_ARITH_WORD {[VarSub count]}}}]})]) (If (Com {[LIT_CHARS test]} {[VarSub elapsed]} {[LIT_CHARS -gt]} {[LIT_CHARS 0]}) (= scope= flags=0 words=[] bindings=[('next_sample_at', {[ArithSub {A2 AS_OP_SLASH {A2 AS_OP_STAR {A2 AS_OP_PLUS {A Atom NODE_ARITH_WORD {[VarSub elapsed]}} {A Atom NODE_ARITH_WORD {[AS_NUM_LITERAL 1]}}} {A Atom NODE_ARITH_WORD {[VarSub count]}}} {A Atom NODE_ARITH_WORD {[VarSub elapsed]}}}]})]) (ElseTrue) (= scope= flags=0 words=[] bindings=[('next_sample_at', {[ArithSub {A2 AS_OP_PLUS {A Atom NODE_ARITH_WORD {[VarSub next_sample_at]}} {A Atom NODE_ARITH_WORD {[AS_NUM_LITERAL 1]}}}]})]) ) (= scope= flags=0 words=[] bindings=[('progress', {[DQ [LIT_CHARS " ("][VarSub elapsed][LIT_CHARS " seconds passed, remaining "][VarSub remaining][LIT_CHARS " predicted)"]]})]) ) ) (Com {[LIT_CHARS printf]} {[DQ [\ LIT_ESCAPED_CHAR "\\r"][LIT_CHARS "Rewrite "][VarSub commit][LIT_CHARS " ("][VarSub count][LIT_CHARS /][VarSub commits][LIT_CHARS ")"][VarSub progress][LIT_CHARS " "]]}) ) ) (= scope= flags=0 words=[] bindings=[('git_filter_branch__commit_count', {[LIT_CHARS 0]})]) (= scope= flags=0 words=[] bindings=[('progress', {[SQ ]}), ('start_timestamp', {[SQ ]})]) (If (Pipeline (Com {[LIT_CHARS date]} {[SQ ]} < (FilenameRedirectNode filename={[LIT_CHARS /dev/null]} "> 2), > ) (Com {[LIT_CHARS grep]} {[LIT_CHARS -q]} {[SQ ]}) ) (List (= scope= flags=0 words=[] bindings=[('next_sample_at', {[LIT_CHARS 0]})]) (= scope= flags=0 words=[] bindings=[('progress', {[DQ [LIT_CHARS "dummy to ensure this is not empty"]]})]) (= scope= flags=0 words=[] bindings=[('start_timestamp', {[ComSub (Com {[LIT_CHARS date]} {[SQ ]})]})]) ) ) (If (AndOr OP_OR_IF (Com {[LIT_CHARS test]} {[LIT_CHARS -n]} {[DQ [VarSub filter_index]]}) (AndOr OP_OR_IF (Com {[LIT_CHARS test]} {[LIT_CHARS -n]} {[DQ [VarSub filter_tree]]}) (Com {[LIT_CHARS test]} {[LIT_CHARS -n]} {[DQ [VarSub filter_subdir]]}) ) ) (= scope= flags=0 words=[] bindings=[('need_index', {[LIT_CHARS t]})]) (ElseTrue) (= scope= flags=0 words=[] bindings=[('need_index', {[SQ ]})]) ) (While (Com {[LIT_CHARS read]} {[LIT_CHARS commit]} {[LIT_CHARS parents]}) (List (= scope= flags=0 words=[] bindings=[('git_filter_branch__commit_count', {[ArithSub {A2 AS_OP_PLUS {A Atom NODE_ARITH_WORD {[VarSub git_filter_branch__commit_count]}} {A Atom NODE_ARITH_WORD {[AS_NUM_LITERAL 1]}}}]})]) (Com {[LIT_CHARS report_progress]}) (AndOr OP_OR_IF (Case to_match={[DQ [VarSub filter_subdir]]}, pat_word_list=[[{[DQ ]}], [{[LIT_OTHER "*"]}]] (If (Com {[LIT_CHARS test]} {[LIT_CHARS -n]} {[DQ [VarSub need_index]]}) (Com {[LIT_CHARS git]} {[LIT_CHARS read-tree]} {[LIT_CHARS -i]} {[LIT_CHARS -m]} {[VarSub commit]} more_env=[('GIT_ALLOW_NULL_SHA1', {[LIT_CHARS 1]})] ) ) (AndOr OP_OR_IF (= scope= flags=0 words=[] bindings=[('err', {[ComSub (Com redirects=[(DescriptorRedirectNode target={[LIT_CHARS 1]} &"> 2)]more_env=[('GIT_ALLOW_NULL_SHA1', {[LIT_CHARS 1]})] {[LIT_CHARS git]} {[LIT_CHARS read-tree]} {[LIT_CHARS -i]} {[LIT_CHARS -m]} {[VarSub commit] [LIT_OTHER ":"] [DQ [VarSub filter_subdir]]})]})]) (If (Pipeline! (Com {[LIT_CHARS git]} {[LIT_CHARS rev-parse]} {[LIT_CHARS -q]} {[LIT_CHARS --verify]} {[VarSub commit] [LIT_OTHER ":"] [DQ [VarSub filter_subdir]]}) ) (Com {[LIT_CHARS rm]} {[LIT_CHARS -f]} {[DQ [VarSub GIT_INDEX_FILE]]}) (ElseTrue) (List (Com {[LIT_CHARS echo]} {[DQ [VarSub err]]} < (DescriptorRedirectNode target={[LIT_CHARS 2]} &"> 1), > ) (Com {[LIT_CHARS false]}) ) ) ) ) (Com {[LIT_CHARS die]} {[DQ [LIT_CHARS "Could not initialize the index"]]}) ) (= scope= flags=0 words=[] bindings=[('GIT_COMMIT', {[VarSub commit]})]) (= scope= flags=1 words=[{[LIT_CHARS GIT_COMMIT]}] bindings=[]) (AndOr OP_OR_IF (Com {[LIT_CHARS git]} {[LIT_CHARS cat-file]} {[LIT_CHARS commit]} {[DQ [VarSub commit]]} < (FilenameRedirectNode filename={[LIT_CHARS ../commit]} "> 1), > ) (Com {[LIT_CHARS die]} {[DQ [LIT_CHARS "Cannot read commit "][VarSub commit]]}) ) (AndOr OP_OR_IF (Com {[LIT_CHARS eval]} {[DQ [ComSub (Com redirects=[(FilenameRedirectNode filename={[LIT_CHARS ../commit]} 0)]{[LIT_CHARS set_ident]})]]}) (Com {[LIT_CHARS die]} {[DQ [LIT_CHARS "setting author/committer failed for commit "][VarSub commit]]}) ) (AndOr OP_OR_IF (Com {[LIT_CHARS eval]} {[DQ [VarSub filter_env]]} < (FilenameRedirectNode filename={[LIT_CHARS /dev/null]} 0), > ) (Com {[LIT_CHARS die]} {[DQ [LIT_CHARS "env filter failed: "][VarSub filter_env]]}) ) (If (Com {[LIT_OTHER "["]} {[DQ [VarSub filter_tree]]} {[LIT_OTHER "]"]}) (List (AndOr OP_OR_IF (Com {[LIT_CHARS git]} {[LIT_CHARS checkout-index]} {[LIT_CHARS -f]} {[LIT_CHARS -u]} {[LIT_CHARS -a]}) (Com {[LIT_CHARS die]} {[DQ [LIT_CHARS "Could not checkout the index"]]}) ) (Com {[LIT_CHARS git]} {[LIT_CHARS clean]} {[LIT_CHARS -d]} {[LIT_CHARS -q]} {[LIT_CHARS -f]} {[LIT_CHARS -x]}) (AndOr OP_OR_IF (Com {[LIT_CHARS eval]} {[DQ [VarSub filter_tree]]} < (FilenameRedirectNode filename={[LIT_CHARS /dev/null]} 0), > ) (Com {[LIT_CHARS die]} {[DQ [LIT_CHARS "tree filter failed: "][VarSub filter_tree]]}) ) (AndOr OP_OR_IF (Subshell (AndOr OP_AND_IF (Com {[LIT_CHARS git]} {[LIT_CHARS diff-index]} {[LIT_CHARS -r]} {[LIT_CHARS --name-only]} {[LIT_CHARS --ignore-submodules]} {[VarSub commit]} {[LIT_CHARS --]}) (Com {[LIT_CHARS git]} {[LIT_CHARS ls-files]} {[LIT_CHARS --others]}) ) ) (Com {[LIT_CHARS exit]}) ) (AndOr OP_OR_IF (Com {[LIT_CHARS git]} {[LIT_CHARS update-index]} {[LIT_CHARS --add]} {[LIT_CHARS --replace]} {[LIT_CHARS --remove]} {[LIT_CHARS --stdin]} < (FilenameRedirectNode filename={[DQ [VarSub tempdir]] [LIT_CHARS /tree-state]} 0), > ) (Com {[LIT_CHARS exit]}) ) ) ) (AndOr OP_OR_IF (Com {[LIT_CHARS eval]} {[DQ [VarSub filter_index]]} < (FilenameRedirectNode filename={[LIT_CHARS /dev/null]} 0), > ) (Com {[LIT_CHARS die]} {[DQ [LIT_CHARS "index filter failed: "][VarSub filter_index]]}) ) (= scope= flags=0 words=[] bindings=[('parentstr', {[SQ ]})]) (For parent [{[VarSub parents]}]) (For reparent [{[ComSub (Com {[LIT_CHARS map]} {[DQ [VarSub parent]]})]}]) (Case to_match={[DQ [VarSub parentstr][LIT_CHARS " "]]}, pat_word_list=[[{[LIT_OTHER "*"] [DQ [LIT_CHARS " -p "][VarSub reparent][LIT_CHARS " "]] [LIT_OTHER "*"]}], [{[LIT_OTHER "*"]}]] (ElseTrue) (= scope= flags=0 words=[] bindings=[('parentstr', {[DQ [VarSub parentstr][LIT_CHARS " -p "][VarSub reparent]]})]) ) ) ) (If (Com {[LIT_OTHER "["]} {[DQ [VarSub filter_parent]]} {[LIT_OTHER "]"]}) (AndOr OP_OR_IF (= scope= flags=0 words=[] bindings=[('parentstr', {[DQ [ComSub (Pipeline (Com {[LIT_CHARS echo]} {[DQ [VarSub parentstr]]}) (Com {[LIT_CHARS eval]} {[DQ [VarSub filter_parent]]}) )]]})]) (Com {[LIT_CHARS die]} {[DQ [LIT_CHARS "parent filter failed: "][VarSub filter_parent]]}) ) ) (AndOr OP_OR_IF (Pipeline (List redirects=[(FilenameRedirectNode filename={[LIT_CHARS ../commit]} 0)] (While (AndOr OP_AND_IF (Com {[LIT_CHARS read]} {[LIT_CHARS -r]} {[LIT_CHARS header_line]} more_env=[('IFS', {[SQ ]})] ) (Com {[LIT_CHARS test]} {[LIT_CHARS -n]} {[DQ [VarSub header_line]]}) ) (Com {[LIT_OTHER ":"]}) ) (Com {[LIT_CHARS cat]}) ) (Com {[LIT_CHARS eval]} {[DQ [VarSub filter_msg]]} < (FilenameRedirectNode filename={[LIT_CHARS ../message]} "> 1), > ) ) (Com {[LIT_CHARS die]} {[DQ [LIT_CHARS "msg filter failed: "][VarSub filter_msg]]}) ) (If (Com {[LIT_CHARS test]} {[LIT_CHARS -n]} {[DQ [VarSub need_index]]}) (= scope= flags=0 words=[] bindings=[('tree', {[ComSub (Com {[LIT_CHARS git]} {[LIT_CHARS write-tree]})]})]) (ElseTrue) (= scope= flags=0 words=[] bindings=[('tree', {[ComSub (Com {[LIT_CHARS git]} {[LIT_CHARS rev-parse]} {[DQ [VarSub commit][LIT_CHARS "^{tree}"]]})]})]) ) (AndOr OP_OR_IF (Com {[LIT_OTHER "@"] [LIT_CHARS SHELL_PATH] [LIT_OTHER "@"]} {[LIT_CHARS -c]} {[DQ [VarSub filter_commit]]} {[DQ [LIT_CHARS "git commit-tree"]]} {[DQ [VarSub tree]]} {[VarSub parentstr]} < (FilenameRedirectNode filename={[LIT_CHARS ../message]} 0), (FilenameRedirectNode filename={[LIT_CHARS ../map/] [VarSub commit]} "> 1), > more_env=[('workdir', {[VarSub workdir]})] ) (Com {[LIT_CHARS die]} {[DQ [LIT_CHARS "could not write rewritten commit"]]}) ) ) ) (If (Com {[LIT_CHARS test]} {[DQ [VarSub remap_to_ancestor]]} {[LIT_OTHER "="]} {[LIT_CHARS t]}) (While (Com {[LIT_CHARS read]} {[LIT_CHARS ref]}) (List (= scope= flags=0 words=[] bindings=[('sha1', {[ComSub (Com {[LIT_CHARS git]} {[LIT_CHARS rev-parse]} {[DQ [VarSub ref]] [LIT_OTHER "^"] [LIT_CHARS 0]})]})]) (AndOr OP_AND_IF (Com {[LIT_CHARS test]} {[LIT_CHARS -f]} {[DQ [VarSub workdir]] [LIT_CHARS /../map/] [VarSub sha1]}) (Com {[LIT_CHARS continue]}) ) (= scope= flags=0 words=[] bindings=[('ancestor', {[ComSub (Com {[LIT_CHARS git]} {[LIT_CHARS rev-list]} {[LIT_CHARS --simplify-merges]} {[LIT_CHARS -1]} {[DQ [VarSub ref]]} {[DQ [VarSub @]]})]})]) (AndOr OP_AND_IF (Com {[LIT_CHARS test]} {[DQ [VarSub ancestor]]}) (Com {[LIT_CHARS echo]} {[ComSub (Com {[LIT_CHARS map]} {[VarSub ancestor]})]} < (FilenameRedirectNode filename={[DQ [VarSub workdir]] [LIT_CHARS /../map/] [VarSub sha1]} >"> 1), > ) ) ) ) ) (= scope= flags=0 words=[] bindings=[('_x40', {[SQ ]})]) (= scope= flags=0 words=[] bindings=[('_x40', {[DQ [VarSub _x40][VarSub _x40][VarSub _x40][VarSub _x40][VarSub _x40][VarSub _x40][VarSub _x40][VarSub _x40]]})]) (Com {[LIT_CHARS echo]}) (While (Com {[LIT_CHARS read]} {[LIT_CHARS ref]}) (List (AndOr OP_AND_IF (Com {[LIT_CHARS test]} {[LIT_CHARS -f]} {[DQ [VarSub orig_namespace][VarSub ref]]}) (Com {[LIT_CHARS continue]}) ) (= scope= flags=0 words=[] bindings=[('sha1', {[ComSub (Com {[LIT_CHARS git]} {[LIT_CHARS rev-parse]} {[DQ [VarSub ref]] [LIT_OTHER "^"] [LIT_CHARS 0]})]})]) (= scope= flags=0 words=[] bindings=[('rewritten', {[ComSub (Com {[LIT_CHARS map]} {[VarSub sha1]})]})]) (AndOr OP_AND_IF (Com {[LIT_CHARS test]} {[VarSub sha1]} {[LIT_OTHER "="]} {[DQ [VarSub rewritten]]}) (AndOr OP_AND_IF (Com {[LIT_CHARS warn]} {[DQ [LIT_CHARS "WARNING: Ref '"][VarSub ref][LIT_CHARS "' is unchanged"]]}) (Com {[LIT_CHARS continue]}) ) ) (Case to_match={[DQ [VarSub rewritten]]}, pat_word_list=[[{[SQ ]}], [{[VarSub _x40]}], [{[LIT_OTHER "*"]}]] (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Ref '"][VarSub ref][LIT_CHARS "' was deleted"]]}) (AndOr OP_OR_IF (Com {[LIT_CHARS git]} {[LIT_CHARS update-ref]} {[LIT_CHARS -m]} {[DQ [LIT_CHARS "filter-branch: delete"]]} {[LIT_CHARS -d]} {[DQ [VarSub ref]]} {[VarSub sha1]}) (Com {[LIT_CHARS die]} {[DQ [LIT_CHARS "Could not delete "][VarSub ref]]}) ) ) (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Ref '"][VarSub ref][LIT_CHARS "' was rewritten"]]}) (If (Pipeline! (Com {[LIT_CHARS git]} {[LIT_CHARS update-ref]} {[LIT_CHARS -m]} {[DQ [LIT_CHARS "filter-branch: rewrite"]]} {[DQ [VarSub ref]]} {[VarSub rewritten]} {[VarSub sha1]} < (FilenameRedirectNode filename={[LIT_CHARS /dev/null]} "> 2), > ) ) (If (Com {[LIT_CHARS test]} {[ComSub (Com {[LIT_CHARS git]} {[LIT_CHARS cat-file]} {[LIT_CHARS -t]} {[DQ [VarSub ref]]})]} {[LIT_OTHER "="]} {[LIT_CHARS tag]}) (If (Com {[LIT_CHARS test]} {[LIT_CHARS -z]} {[DQ [VarSub filter_tag_name]]}) (List (Com {[LIT_CHARS warn]} {[DQ [LIT_CHARS "WARNING: You said to rewrite tagged commits, but not the corresponding tag."]]}) (Com {[LIT_CHARS warn]} {[DQ [LIT_CHARS "WARNING: Perhaps use '--tag-name-filter cat' to rewrite the tag."]]}) ) ) (ElseTrue) (Com {[LIT_CHARS die]} {[DQ [LIT_CHARS "Could not rewrite "][VarSub ref]]}) ) ) ) (List (Com {[LIT_CHARS warn]} {[DQ [LIT_CHARS "WARNING: '"][VarSub ref][LIT_CHARS "' was rewritten into multiple commits:"]]}) (Com {[LIT_CHARS warn]} {[DQ [VarSub rewritten]]}) (Com {[LIT_CHARS warn]} {[DQ [LIT_CHARS "WARNING: Ref '"][VarSub ref][LIT_CHARS "' points to the first one now."]]}) (= scope= flags=0 words=[] bindings=[('rewritten', {[ComSub (Pipeline (Com {[LIT_CHARS echo]} {[DQ [VarSub rewritten]]}) (Com {[LIT_CHARS head]} {[LIT_CHARS -n]} {[LIT_CHARS 1]}) )]})]) (AndOr OP_OR_IF (Com {[LIT_CHARS git]} {[LIT_CHARS update-ref]} {[LIT_CHARS -m]} {[DQ [LIT_CHARS "filter-branch: rewrite to first"]]} {[DQ [VarSub ref]]} {[VarSub rewritten]} {[VarSub sha1]}) (Com {[LIT_CHARS die]} {[DQ [LIT_CHARS "Could not rewrite "][VarSub ref]]}) ) ) ) (AndOr OP_OR_IF (Com {[LIT_CHARS git]} {[LIT_CHARS update-ref]} {[LIT_CHARS -m]} {[DQ [LIT_CHARS "filter-branch: backup"]]} {[DQ [VarSub orig_namespace][VarSub ref]]} {[VarSub sha1]}) (Com {[LIT_CHARS exit]}) ) ) ) (If (Com {[LIT_OTHER "["]} {[DQ [VarSub filter_tag_name]]} {[LIT_OTHER "]"]}) (Pipeline (Com {[LIT_CHARS git]} {[LIT_CHARS for-each-ref]} {[LIT_CHARS --format] [LIT_OTHER "="] [SQ ]} {[LIT_CHARS refs/tags]}) (While (Com {[LIT_CHARS read]} {[LIT_CHARS sha1]} {[LIT_CHARS type]} {[LIT_CHARS ref]}) (List (= scope= flags=0 words=[] bindings=[('ref', {[DQ [VarSub ref transform_ops=[VS_UNARY_POUND {[LIT_CHARS refs] [LIT_SLASH /] [LIT_CHARS tags] [LIT_SLASH /]}]]]})]) (If (Com {[LIT_OTHER "["]} {[DQ [VarSub type]]} {[LIT_OTHER "!"] [LIT_OTHER "="]} {[DQ [LIT_CHARS commit]]} {[LIT_CHARS -a]} {[DQ [VarSub type]]} {[LIT_OTHER "!"] [LIT_OTHER "="]} {[DQ [LIT_CHARS tag]]} {[LIT_OTHER "]"]}) (Com {[LIT_CHARS continue]}) ) (If (Com {[LIT_OTHER "["]} {[DQ [VarSub type]]} {[LIT_OTHER "="]} {[DQ [LIT_CHARS tag]]} {[LIT_OTHER "]"]}) (List (= scope= flags=0 words=[] bindings=[('sha1t', {[DQ [VarSub sha1]]})]) (AndOr OP_OR_IF (= scope= flags=0 words=[] bindings=[('sha1', {[DQ [ComSub (Com {[LIT_CHARS git]} {[LIT_CHARS rev-parse]} {[LIT_CHARS -q]} {[DQ [VarSub sha1]] [LIT_OTHER "^"] [LIT_LBRACE "{"] [LIT_CHARS commit] [LIT_RBRACE "}"]})]]})]) (Com {[LIT_CHARS continue]}) ) ) ) (AndOr OP_OR_IF (Com {[LIT_OTHER "["]} {[LIT_CHARS -f]} {[DQ [LIT_CHARS ../map/][VarSub sha1]]} {[LIT_OTHER "]"]}) (Com {[LIT_CHARS continue]}) ) (= scope= flags=0 words=[] bindings=[('new_sha1', {[DQ [ComSub (Com {[LIT_CHARS cat]} {[DQ [LIT_CHARS ../map/][VarSub sha1]]})]]})]) (= scope= flags=0 words=[] bindings=[('GIT_COMMIT', {[DQ [VarSub sha1]]})]) (= scope= flags=1 words=[{[LIT_CHARS GIT_COMMIT]}] bindings=[]) (AndOr OP_OR_IF (= scope= flags=0 words=[] bindings=[('new_ref', {[DQ [ComSub (Pipeline (Com {[LIT_CHARS echo]} {[DQ [VarSub ref]]}) (Com {[LIT_CHARS eval]} {[DQ [VarSub filter_tag_name]]}) )]]})]) (Com {[LIT_CHARS die]} {[DQ [LIT_CHARS "tag name filter failed: "][VarSub filter_tag_name]]}) ) (Com {[LIT_CHARS echo]} {[DQ [VarSub ref][LIT_CHARS " -> "][VarSub new_ref][LIT_CHARS " ("][VarSub sha1][LIT_CHARS " -> "][VarSub new_sha1][LIT_CHARS ")"]]}) (If (Com {[LIT_OTHER "["]} {[DQ [VarSub type]]} {[LIT_OTHER "="]} {[DQ [LIT_CHARS tag]]} {[LIT_OTHER "]"]}) (List (AndOr OP_OR_IF (= scope= flags=0 words=[] bindings=[('new_sha1', {[ComSub (Pipeline (Subshell (List (Com {[LIT_CHARS printf]} {[SQ ]} {[DQ [VarSub new_sha1]]} {[DQ [VarSub new_ref]]}) (Pipeline (Com {[LIT_CHARS git]} {[LIT_CHARS cat-file]} {[LIT_CHARS tag]} {[DQ [VarSub ref]]}) (Com {[LIT_CHARS sed]} {[LIT_CHARS -n]} {[LIT_CHARS -e]} {[SQ ]} {[LIT_CHARS -e]} {[SQ ]} {[LIT_CHARS -e]} {[SQ ]}) ) ) ) (Com {[LIT_CHARS git]} {[LIT_CHARS mktag]}) )]})]) (Com {[LIT_CHARS die]} {[DQ [LIT_CHARS "Could not create new tag object for "][VarSub ref]]}) ) (If (Pipeline (Com {[LIT_CHARS git]} {[LIT_CHARS cat-file]} {[LIT_CHARS tag]} {[DQ [VarSub ref]]}) (Com {[LIT_CHARS sane_grep]} {[SQ ]} < (FilenameRedirectNode filename={[LIT_CHARS /dev/null]} "> 1), (DescriptorRedirectNode target={[LIT_CHARS 1]} &"> 2), > ) ) (Com {[LIT_CHARS warn]} {[DQ [LIT_CHARS "gpg signature stripped from tag object "][VarSub sha1t]]}) ) ) ) (AndOr OP_OR_IF (Com {[LIT_CHARS git]} {[LIT_CHARS update-ref]} {[DQ [LIT_CHARS refs/tags/][VarSub new_ref]]} {[DQ [VarSub new_sha1]]}) (Com {[LIT_CHARS die]} {[DQ [LIT_CHARS "Could not write tag "][VarSub new_ref]]}) ) ) ) ) ) (Com {[LIT_CHARS cd]} {[DQ [VarSub orig_dir]]}) (Com {[LIT_CHARS rm]} {[LIT_CHARS -rf]} {[DQ [VarSub tempdir]]}) (Com {[LIT_CHARS trap]} {[LIT_CHARS -]} {[LIT_CHARS 0]}) (Com {[LIT_CHARS unset]} {[LIT_CHARS GIT_DIR]} {[LIT_CHARS GIT_WORK_TREE]} {[LIT_CHARS GIT_INDEX_FILE]}) (AndOr OP_OR_IF (Com {[LIT_CHARS test]} {[LIT_CHARS -z]} {[DQ [VarSub ORIG_GIT_DIR]]}) (AndOr OP_AND_IF (= scope= flags=0 words=[] bindings=[('GIT_DIR', {[DQ [VarSub ORIG_GIT_DIR]]})]) (= scope= flags=1 words=[{[LIT_CHARS GIT_DIR]}] bindings=[]) ) ) (AndOr OP_OR_IF (Com {[LIT_CHARS test]} {[LIT_CHARS -z]} {[DQ [VarSub ORIG_GIT_WORK_TREE]]}) (AndOr OP_AND_IF (= scope= flags=0 words=[] bindings=[('GIT_WORK_TREE', {[DQ [VarSub ORIG_GIT_WORK_TREE]]})]) (= scope= flags=1 words=[{[LIT_CHARS GIT_WORK_TREE]}] bindings=[]) ) ) (AndOr OP_OR_IF (Com {[LIT_CHARS test]} {[LIT_CHARS -z]} {[DQ [VarSub ORIG_GIT_INDEX_FILE]]}) (AndOr OP_AND_IF (= scope= flags=0 words=[] bindings=[('GIT_INDEX_FILE', {[DQ [VarSub ORIG_GIT_INDEX_FILE]]})]) (= scope= flags=1 words=[{[LIT_CHARS GIT_INDEX_FILE]}] bindings=[]) ) ) (If (Com {[LIT_OTHER "["]} {[DQ [ComSub (Com {[LIT_CHARS is_bare_repository]})]]} {[LIT_OTHER "="]} {[LIT_CHARS false]} {[LIT_OTHER "]"]}) (AndOr OP_OR_IF (Com {[LIT_CHARS git]} {[LIT_CHARS read-tree]} {[LIT_CHARS -u]} {[LIT_CHARS -m]} {[LIT_CHARS HEAD]}) (Com {[LIT_CHARS exit]}) ) ) (Com {[LIT_CHARS exit]} {[LIT_CHARS 0]}) )