(command.CommandList children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:functions spids:[40]) op: Equal rhs: { (word_part.CommandSubPart command_list: (command.CommandList children: [ (command.SimpleCommand words: [{(cat)}] redirects: [ (redir.HereDoc op: <Redir_DLess '<<'> fd: 16777215 here_begin: {(word_part.EscapedLiteralPart token:<Lit_EscapedChar '\\E'>) (OF)} here_end_span_id: 97 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') ] ) ] ) ] ) left_token: <Left_CommandSub '$('> spids: [41 98] ) } spids: [40] ) ] spids: [40] ) (C {(eval)} {(DQ ($ VSub_Name '$functions'))}) (command.FuncDef name: finish_ident body: (command.BraceGroup children: [ (C {(echo)} { (DQ ('case ') (word_part.EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) (word_part.EscapedLiteralPart token:<Lit_EscapedChar '\\$'>) (GIT_) ($ VSub_Number '$1') (_NAME) (word_part.EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) (' in ') (word_part.EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) (word_part.EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) (') GIT_') ($ VSub_Number '$1') ('_NAME=') (word_part.EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) (word_part.EscapedLiteralPart token:<Lit_EscapedChar '\\$'>) ('{GIT_') ($ VSub_Number '$1') ('_EMAIL%%@*}') (word_part.EscapedLiteralPart 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))}) ] spids: [112] ) spids: [108 111] ) (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)}) ] spids: [185] ) spids: [180 184] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:USAGE spids:[211]) 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: [211] ) ] spids: [211] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:OPTIONS_SPEC spids:[222]) op: Equal rhs: (word.EmptyWord) spids: [222] ) ] spids: [222] ) (C {(.)} {(git-sh-setup)}) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Lit_Other '[')} { (DQ (word_part.CommandSubPart command_list: (command.CommandList children:[(C {(is_bare_repository)})]) left_token: <Left_CommandSub '$('> spids: [234 236] ) ) } {(Lit_Other '=')} {(false)} {(Lit_Other ']')} ) terminator: <Op_Semi ';'> ) ] action: [(C {(require_clean_work_tree)} {(SQ <'rewrite branches'>)})] spids: [16777215 246] ) ] spids: [16777215 255] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:tempdir spids:[258]) op: Equal rhs: {(.git-rewrite)} spids: [258] ) ] spids: [258] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:filter_env spids:[261]) op: Equal rhs: (word.EmptyWord) spids: [261] ) ] spids: [261] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:filter_tree spids:[263]) op: Equal rhs: (word.EmptyWord) spids: [263] ) ] spids: [263] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:filter_index spids:[265]) op: Equal rhs: (word.EmptyWord) spids: [265] ) ] spids: [265] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:filter_parent spids:[267]) op: Equal rhs: (word.EmptyWord) spids: [267] ) ] spids: [267] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:filter_msg spids:[269]) op: Equal rhs: {(cat)} spids: [269] ) ] spids: [269] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:filter_commit spids:[272]) op: Equal rhs: (word.EmptyWord) spids: [272] ) ] spids: [272] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:filter_tag_name spids:[274]) op: Equal rhs: (word.EmptyWord) spids: [274] ) ] spids: [274] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:filter_subdir spids:[276]) op: Equal rhs: (word.EmptyWord) spids: [276] ) ] spids: [276] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:orig_namespace spids:[278]) op: Equal rhs: {(refs/original/)} spids: [278] ) ] spids: [278] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:force spids:[281]) op: Equal rhs: (word.EmptyWord) spids: [281] ) ] spids: [281] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:prune_empty spids:[283]) op: Equal rhs: (word.EmptyWord) spids: [283] ) ] spids: [283] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:remap_to_ancestor spids:[285]) op: Equal rhs: (word.EmptyWord) spids: [285] ) ] spids: [285] ) (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>)] spids: [303 304 313 16777215] ) (case_arm pat_list: [{(--force)} {(-f)}] action: [ (C {(shift)}) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:force spids:[325]) op: Equal rhs: {(t)} spids: [325] ) ] spids: [325] ) (command.ControlFlow token:<ControlFlow_Continue continue>) ] spids: [316 319 332 16777215] ) (case_arm pat_list: [{(--remap-to-ancestor)}] action: [ (C {(shift)}) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:remap_to_ancestor spids:[346]) op: Equal rhs: {(t)} spids: [346] ) ] spids: [346] ) (command.ControlFlow token:<ControlFlow_Continue continue>) ] spids: [335 336 353 16777215] ) (case_arm pat_list: [{(--prune-empty)}] action: [ (C {(shift)}) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:prune_empty spids:[363]) op: Equal rhs: {(t)} spids: [363] ) ] spids: [363] ) (command.ControlFlow token:<ControlFlow_Continue continue>) ] spids: [356 357 370 16777215] ) (case_arm pat_list: [{(-) (Lit_Other '*')}] spids: [373 375 378 16777215] ) (case_arm pat_list: [{(Lit_Other '*')}] action: [ (command.Sentence child: (command.ControlFlow token:<ControlFlow_Break break>) terminator: <Op_Semi ';'> ) ] spids: [381 382 16777215 389] ) ] spids: [294 300 389] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:ARG spids:[397]) op: Equal rhs: {(DQ ($ VSub_Number '$1'))} spids: [397] ) ] spids: [397] ) (command.Case to_match: {(DQ ($ VSub_Pound '$#'))} arms: [(case_arm pat_list:[{(1)}] action:[(C {(usage)})] spids:[411 412 416 16777215])] spids: [403 409 418] ) (C {(shift)}) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:OPTARG spids:[424]) op: Equal rhs: {(DQ ($ VSub_Number '$1'))} spids: [424] ) ] spids: [424] ) (C {(shift)}) (command.Case to_match: {(DQ ($ VSub_Name '$ARG'))} arms: [ (case_arm pat_list: [{(-d)}] action: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:tempdir spids:[447]) op: Equal rhs: {(DQ ($ VSub_Name '$OPTARG'))} spids: [447] ) ] spids: [447] ) ] spids: [443 444 453 16777215] ) (case_arm pat_list: [{(--env-filter)}] action: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:filter_env spids:[460]) op: Equal rhs: {(DQ ($ VSub_Name '$OPTARG'))} spids: [460] ) ] spids: [460] ) ] spids: [456 457 466 16777215] ) (case_arm pat_list: [{(--tree-filter)}] action: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:filter_tree spids:[473]) op: Equal rhs: {(DQ ($ VSub_Name '$OPTARG'))} spids: [473] ) ] spids: [473] ) ] spids: [469 470 479 16777215] ) (case_arm pat_list: [{(--index-filter)}] action: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:filter_index spids:[486]) op: Equal rhs: {(DQ ($ VSub_Name '$OPTARG'))} spids: [486] ) ] spids: [486] ) ] spids: [482 483 492 16777215] ) (case_arm pat_list: [{(--parent-filter)}] action: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:filter_parent spids:[499]) op: Equal rhs: {(DQ ($ VSub_Name '$OPTARG'))} spids: [499] ) ] spids: [499] ) ] spids: [495 496 505 16777215] ) (case_arm pat_list: [{(--msg-filter)}] action: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:filter_msg spids:[512]) op: Equal rhs: {(DQ ($ VSub_Name '$OPTARG'))} spids: [512] ) ] spids: [512] ) ] spids: [508 509 518 16777215] ) (case_arm pat_list: [{(--commit-filter)}] action: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:filter_commit spids:[525]) op: Equal rhs: {(DQ ($ VSub_Name '$functions') ('; ') ($ VSub_Name '$OPTARG'))} spids: [525] ) ] spids: [525] ) ] spids: [521 522 533 16777215] ) (case_arm pat_list: [{(--tag-name-filter)}] action: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:filter_tag_name spids:[540]) op: Equal rhs: {(DQ ($ VSub_Name '$OPTARG'))} spids: [540] ) ] spids: [540] ) ] spids: [536 537 546 16777215] ) (case_arm pat_list: [{(--subdirectory-filter)}] action: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:filter_subdir spids:[553]) op: Equal rhs: {(DQ ($ VSub_Name '$OPTARG'))} spids: [553] ) ] spids: [553] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:remap_to_ancestor spids:[559]) op: Equal rhs: {(t)} spids: [559] ) ] spids: [559] ) ] spids: [549 550 563 16777215] ) (case_arm pat_list: [{(--original)}] action: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:orig_namespace spids:[570]) op: Equal rhs: { (word_part.CommandSubPart command_list: (command.CommandList children: [ (C {(expr)} {(DQ ($ VSub_Name '$OPTARG') (/))} {(Lit_Other ':')} {(SQ <'\\(.*[^/]\\)/*$'>)} ) ] ) left_token: <Left_CommandSub '$('> spids: [571 584] ) (/) } spids: [570] ) ] spids: [570] ) ] spids: [566 567 588 16777215] ) (case_arm pat_list: [{(Lit_Other '*')}] action: [(C {(usage)})] spids: [591 592 598 16777215] ) ] spids: [434 440 601] ) ] spids: [291 603] ) ) (command.Case to_match: {(DQ ($ VSub_Name '$prune_empty') (',') ($ VSub_Name '$filter_commit'))} arms: [ (case_arm pat_list: [{(Lit_Comma ',')}] action: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:filter_commit spids:[620]) op: Equal rhs: {(SQ <'git commit-tree "$@"'>)} spids: [620] ) ] spids: [620] ) ] spids: [616 617 624 16777215] ) (case_arm pat_list: [{(t) (Lit_Comma ',')}] action: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:filter_commit spids:[631]) op: Equal rhs: {(DQ ($ VSub_Name '$functions') (';')) (SQ <' git_commit_non_empty_tree "$@"'>)} spids: [631] ) ] spids: [631] ) ] spids: [626 628 639 16777215] ) (case_arm pat_list:[{(Lit_Comma ',') (Lit_Other '*')}] spids:[641 643 646 16777215]) (case_arm pat_list: [{(Lit_Other '*')}] action: [(C {(die)} {(DQ ('Cannot set --prune-empty and --commit-filter at the same time'))})] spids: [648 649 16777215 658] ) ] spids: [606 614 658] ) (command.Case to_match: {(DQ ($ VSub_Name '$force'))} arms: [ (case_arm pat_list: [{(t)}] action: [(C {(rm)} {(-rf)} {(DQ ($ VSub_Name '$tempdir'))})] spids: [669 670 681 16777215] ) (case_arm pat_list: [{(SQ )}] action: [ (command.AndOr ops: [Op_DAmp] children: [ (C {(test)} {(-d)} {(DQ ($ VSub_Name '$tempdir'))}) (C {(die)} {(DQ ($ VSub_Name '$tempdir') (' already exists, please remove it'))}) ] ) ] spids: [683 685 16777215 706] ) ] spids: [661 667 706] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:orig_dir spids:[708]) op: Equal rhs: { (word_part.CommandSubPart command_list: (command.CommandList children:[(C {(pwd)})]) left_token: <Left_CommandSub '$('> spids: [709 711] ) } spids: [708] ) ] spids: [708] ) (command.AndOr ops: [Op_DAmp Op_DAmp Op_DAmp Op_DPipe] children: [ (C {(mkdir)} {(-p)} {(DQ ($ VSub_Name '$tempdir') (/t))}) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:tempdir spids:[724]) op: Equal rhs: { (DQ (word_part.CommandSubPart command_list: (command.CommandList children: [ (command.Sentence child: (C {(cd)} {(DQ ($ VSub_Name '$tempdir'))}) terminator: <Op_Semi ';'> ) (C {(pwd)}) ] ) left_token: <Left_CommandSub '$('> spids: [726 735] ) ) } spids: [724] ) ] spids: [724] ) (C {(cd)} {(DQ ($ VSub_Name '$tempdir') (/t))}) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:workdir spids:[749]) op: Equal rhs: { (DQ (word_part.CommandSubPart command_list: (command.CommandList children:[(C {(pwd)})]) left_token: <Left_CommandSub '$('> spids: [751 753] ) ) } spids: [749] ) ] spids: [749] ) (C {(die)} {(DQ )}) ] ) (C {(trap)} {(SQ <'cd "$orig_dir"; rm -rf "$tempdir"'>)} {(0)}) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:ORIG_GIT_DIR spids:[776]) op: Equal rhs: {(DQ ($ VSub_Name '$GIT_DIR'))} spids: [776] ) ] spids: [776] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:ORIG_GIT_WORK_TREE spids:[781]) op: Equal rhs: {(DQ ($ VSub_Name '$GIT_WORK_TREE'))} spids: [781] ) ] spids: [781] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:ORIG_GIT_INDEX_FILE spids:[786]) op: Equal rhs: {(DQ ($ VSub_Name '$GIT_INDEX_FILE'))} spids: [786] ) ] spids: [786] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:GIT_WORK_TREE spids:[791]) op: Equal rhs: {(.)} spids: [791] ) ] spids: [791] ) (C {(export)} {(GIT_DIR)} {(GIT_WORK_TREE)}) (command.AndOr ops: [Op_DPipe] children: [ (command.SimpleCommand words: [{(git)} {(for-each-ref)}] redirects: [ (redir.Redir op: <Redir_Great '>'> fd: 16777215 arg_word: {(DQ ($ VSub_Name '$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_Name '$force') (',') ($ VSub_Name '$name'))} arms: [ (case_arm pat_list: [{(Lit_Comma ',') ($ VSub_Name '$orig_namespace') (Lit_Other '*')}] action: [ (C {(die)} { (DQ ('Cannot create a new backup.\n') ('A previous backup already exists in ') ($ VSub_Name '$orig_namespace') ('\n') ('Force overwriting the backup with -f') ) } ) ] spids: [843 846 860 16777215] ) (case_arm pat_list: [{(t) (Lit_Comma ',') ($ VSub_Name '$orig_namespace') (Lit_Other '*')}] action: [ (C {(git)} {(update-ref)} {(-d)} {(DQ ($ VSub_Name '$name'))} {($ VSub_Name '$sha1')}) ] spids: [863 867 883 16777215] ) ] spids: [832 840 886] ) ] spids: [829 888] ) redirects: [ (redir.Redir op: <Redir_Less '<'> fd: 16777215 arg_word: {(DQ ($ VSub_Name '$tempdir')) (/backup-refs)} ) ] ) (command.AndOr ops: [Op_DPipe] children: [ (command.SimpleCommand 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_Name '$tempdir')) (/raw-heads)} ) ] ) (command.ControlFlow token:<ControlFlow_Exit exit>) ] ) (command.SimpleCommand words: [{(sed)} {(-e)} {(SQ <'/^^/d'>)} {(DQ ($ VSub_Name '$tempdir')) (/raw-heads)}] redirects: [ (redir.Redir op: <Redir_Great '>'> fd: 16777215 arg_word: {(DQ ($ VSub_Name '$tempdir')) (/heads)} ) ] ) (command.AndOr ops: [Op_DPipe] children: [ (C {(test)} {(-s)} {(DQ ($ VSub_Name '$tempdir')) (/heads)}) (C {(die)} {(DQ ('Which ref do you want to rewrite?'))}) ] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:GIT_INDEX_FILE spids:[971]) op: Equal rhs: { (DQ (word_part.CommandSubPart command_list: (command.CommandList children:[(C {(pwd)})]) left_token: <Left_CommandSub '$('> spids: [973 975] ) (/../index) ) } spids: [971] ) ] spids: [971] ) (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 keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:nonrevs spids:[1003]) op: Equal rhs: { (word_part.CommandSubPart command_list: (command.CommandList children: [(C {(git)} {(rev-parse)} {(--no-revs)} {(DQ ($ VSub_At '$@'))})] ) left_token: <Left_CommandSub '$('> spids: [1004 1014] ) } spids: [1003] ) ] spids: [1003] ) (command.ControlFlow token:<ControlFlow_Exit exit>) ] ) (command.If arms: [ (if_arm cond: [(C {(test)} {(-z)} {(DQ ($ VSub_Name '$nonrevs'))})] action: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:dashdash spids:[1033]) op: Equal rhs: {(--)} spids: [1033] ) ] spids: [1033] ) ] spids: [16777215 1030] ) ] else_action: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:dashdash spids:[1039]) op: Equal rhs: (word.EmptyWord) spids: [1039] ) ] spids: [1039] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:remap_to_ancestor spids:[1042]) op: Equal rhs: {(t)} spids: [1042] ) ] spids: [1042] ) ] spids: [1036 1045] ) (command.SimpleCommand 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_Name '$filter_subdir'))} arms: [ (case_arm pat_list: [{(DQ )}] action: [ (C {(eval)} {(set)} {(--)} { (DQ (word_part.CommandSubPart command_list: (command.CommandList children: [ (C {(git)} {(rev-parse)} {(--sq)} {(--no-revs)} {(DQ ($ VSub_At '$@'))}) ] ) left_token: <Left_CommandSub '$('> spids: [1082 1094] ) ) } ) ] spids: [1070 1072 1098 16777215] ) (case_arm pat_list: [{(Lit_Other '*')}] action: [ (C {(eval)} {(set)} {(--)} { (DQ (word_part.CommandSubPart command_list: (command.CommandList children: [ (C {(git)} {(rev-parse)} {(--sq)} {(--no-revs)} {(DQ ($ VSub_At '$@'))} {($ VSub_Name '$dashdash')} {(DQ ($ VSub_Name '$filter_subdir'))} ) ] ) left_token: <Left_CommandSub '$('> spids: [1111 1131] ) ) } ) ] spids: [1100 1101 1135 16777215] ) ] spids: [1062 1068 1137] ) (command.AndOr ops: [Op_DPipe] children: [ (command.SimpleCommand 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 keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:commits spids:[1179]) op: Equal rhs: { (word_part.CommandSubPart command_list: (command.CommandList children: [ (command.Pipeline children: [ (command.SimpleCommand words: [{(wc)} {(-l)}] redirects: [ (redir.Redir op: <Redir_Less '<'> fd: 16777215 arg_word: {(../revs)} ) ] ) (C {(tr)} {(-d)} {(DQ (' '))}) ] negated: F ) ] ) left_token: <Left_CommandSub '$('> spids: [1180 1197] ) } spids: [1179] ) ] spids: [1179] ) (command.AndOr ops: [Op_DAmp] children: [ (C {(test)} {($ VSub_Name '$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_Name '$progress'))}) (C {(test)} {($ VSub_Name '$git_filter_branch__commit_count')} {(-gt)} {($ VSub_Name '$next_sample_at')} ) ] ) ] action: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:count spids:[1253]) op: Equal rhs: {($ VSub_Name '$git_filter_branch__commit_count')} spids: [1253] ) ] spids: [1253] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:now spids:[1258]) op: Equal rhs: { (word_part.CommandSubPart command_list: (command.CommandList children: [(C {(date)} {(Lit_Other '+') (Lit_Other '%') (s)})] ) left_token: <Left_CommandSub '$('> spids: [1259 1265] ) } spids: [1258] ) ] spids: [1258] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:elapsed spids:[1268]) op: Equal rhs: { (word_part.ArithSubPart anode: (arith_expr.ArithBinary op_id: Arith_Minus left: (arith_expr.ArithWord w:{($ VSub_Name '$now')}) right: (arith_expr.ArithWord w:{($ VSub_Name '$start_timestamp')}) ) spids: [1269 1276] ) } spids: [1268] ) ] spids: [1268] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:remaining spids:[1279]) op: Equal rhs: { (word_part.ArithSubPart anode: (arith_expr.ArithBinary op_id: Arith_Slash left: (arith_expr.ArithBinary op_id: Arith_Star left: (arith_expr.ArithBinary op_id: Arith_Minus left: (arith_expr.ArithWord w:{($ VSub_Name '$commits')}) right: (arith_expr.ArithWord w:{($ VSub_Name '$count')}) ) right: (arith_expr.ArithWord w:{($ VSub_Name '$elapsed')}) ) right: (arith_expr.ArithWord w:{($ VSub_Name '$count')}) ) spids: [1280 1299] ) } spids: [1279] ) ] spids: [1279] ) (command.If arms: [ (if_arm cond: [(C {(test)} {($ VSub_Name '$elapsed')} {(-gt)} {(0)})] action: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:next_sample_at spids:[1316]) op: Equal rhs: { (word_part.ArithSubPart anode: (arith_expr.ArithBinary op_id: Arith_Slash left: (arith_expr.ArithBinary op_id: Arith_Star left: (arith_expr.ArithBinary op_id: Arith_Plus left: (arith_expr.ArithWord w: {($ VSub_Name '$elapsed')} ) right: (arith_expr.ArithWord w:{(Lit_Digits 1)}) ) right: (arith_expr.ArithWord w: {($ VSub_Name '$count')} ) ) right: (arith_expr.ArithWord w:{($ VSub_Name '$elapsed')}) ) spids: [1317 1336] ) } spids: [1316] ) ] spids: [1316] ) ] spids: [16777215 1313] ) ] else_action: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:next_sample_at spids:[1342]) op: Equal rhs: { (word_part.ArithSubPart anode: (arith_expr.ArithBinary op_id: Arith_Plus left: (arith_expr.ArithWord w: {($ VSub_Name '$next_sample_at')} ) right: (arith_expr.ArithWord w:{(Lit_Digits 1)}) ) spids: [1343 1350] ) } spids: [1342] ) ] spids: [1342] ) ] spids: [1339 1353] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:progress spids:[1356]) op: Equal rhs: { (DQ (' (') ($ VSub_Name '$elapsed') (' seconds passed, remaining ') ($ VSub_Name '$remaining') (' predicted)') ) } spids: [1356] ) ] spids: [1356] ) ] spids: [16777215 1250] ) ] spids: [16777215 1366] ) (C {(printf)} { (DQ (Lit_Other '\\') ('rRewrite ') ($ VSub_Name '$commit') (' (') ($ VSub_Name '$count') (/) ($ VSub_Name '$commits') (')') ($ VSub_Name '$progress') (' ') ) } ) ] spids: [1225] ) spids: [1220 1224] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:git_filter_branch__commit_count spids:[1387]) op: Equal rhs: {(0)} spids: [1387] ) ] spids: [1387] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:progress spids:[1391]) op: Equal rhs: (word.EmptyWord) spids: [1391] ) (assign_pair lhs: (lhs_expr.LhsName name:start_timestamp spids:[1393]) op: Equal rhs: (word.EmptyWord) spids: [1393] ) ] spids: [1391] ) (command.If arms: [ (if_arm cond: [ (command.Pipeline children: [ (command.SimpleCommand 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 keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:next_sample_at spids:[1419]) op: Equal rhs: {(0)} spids: [1419] ) ] spids: [1419] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:progress spids:[1423]) op: Equal rhs: {(DQ ('dummy to ensure this is not empty'))} spids: [1423] ) ] spids: [1423] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:start_timestamp spids:[1429]) op: Equal rhs: { (word_part.CommandSubPart command_list: (command.CommandList children:[(C {(date)} {(SQ <'+%s'>)})]) left_token: <Left_CommandSub '$('> spids: [1430 1436] ) } spids: [1429] ) ] spids: [1429] ) ] spids: [16777215 1416] ) ] spids: [16777215 1438] ) (command.If arms: [ (if_arm cond: [ (command.AndOr ops: [Op_DPipe Op_DPipe] children: [ (C {(test)} {(-n)} {(DQ ($ VSub_Name '$filter_index'))}) (C {(test)} {(-n)} {(DQ ($ VSub_Name '$filter_tree'))}) (C {(test)} {(-n)} {(DQ ($ VSub_Name '$filter_subdir'))}) ] ) ] action: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:need_index spids:[1476]) op: Equal rhs: {(t)} spids: [1476] ) ] spids: [1476] ) ] spids: [16777215 1473] ) ] else_action: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:need_index spids:[1482]) op: Equal rhs: (word.EmptyWord) spids: [1482] ) ] spids: [1482] ) ] spids: [1479 1484] ) (command.WhileUntil keyword: <KW_While while> cond: [(command.Sentence child:(C {(read)} {(commit)} {(parents)}) terminator:<Op_Semi ';'>)] body: (command.DoGroup children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:git_filter_branch__commit_count spids:[1499]) op: Equal rhs: { (word_part.ArithSubPart anode: (arith_expr.ArithBinary op_id: Arith_Plus left: (arith_expr.ArithWord w: {($ VSub_Name '$git_filter_branch__commit_count')} ) right: (arith_expr.ArithWord w:{(Lit_Digits 1)}) ) spids: [1500 1505] ) } spids: [1499] ) ] spids: [1499] ) (C {(report_progress)}) (command.AndOr ops: [Op_DPipe] children: [ (command.Case to_match: {(DQ ($ VSub_Name '$filter_subdir'))} arms: [ (case_arm pat_list: [{(DQ )}] action: [ (command.If arms: [ (if_arm cond: [(C {(test)} {(-n)} {(DQ ($ VSub_Name '$need_index'))})] action: [ (command.SimpleCommand words: [{(git)} {(read-tree)} {(-i)} {(-m)} {($ VSub_Name '$commit')}] more_env: [ (env_pair name: GIT_ALLOW_NULL_SHA1 val: {(1)} spids: [1541] ) ] ) ] spids: [16777215 1538] ) ] spids: [16777215 1555] ) ] spids: [1522 1524 1558 16777215] ) (case_arm pat_list: [{(Lit_Other '*')}] action: [ (command.AndOr ops: [Op_DPipe] children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:err spids:[1569]) op: Equal rhs: { (word_part.CommandSubPart command_list: (command.CommandList children: [ (command.SimpleCommand words: [ {(git)} {(read-tree)} {(-i)} {(-m)} {($ VSub_Name '$commit') (Lit_Other ':') (DQ ($ VSub_Name '$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)} spids: [1571] ) ] ) ] ) left_token: <Left_CommandSub '$('> spids: [1570 1592] ) } spids: [1569] ) ] spids: [1569] ) (command.BraceGroup children: [ (command.If arms: [ (if_arm cond: [ (command.Pipeline children: [ (C {(git)} {(rev-parse)} {(-q)} {(--verify)} {($ VSub_Name '$commit') (Lit_Other ':') (DQ ($ VSub_Name '$filter_subdir')) } ) ] negated: T ) ] action: [(C {(rm)} {(-f)} {(DQ ($ VSub_Name '$GIT_INDEX_FILE'))})] spids: [16777215 1618] ) ] else_action: [ (command.SimpleCommand words: [{(echo)} {(DQ ($ VSub_Name '$err'))}] redirects: [ (redir.Redir op: <Redir_GreatAnd '>&'> fd: 16777215 arg_word: {(2)} ) ] ) (C {(false)}) ] spids: [1630 1646] ) ] spids: [1596] ) ] ) ] spids: [1561 1562 16777215 1652] ) ] spids: [1513 1519 1652] ) (C {(die)} {(DQ ('Could not initialize the index'))}) ] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:GIT_COMMIT spids:[1664]) op: Equal rhs: {($ VSub_Name '$commit')} spids: [1664] ) ] spids: [1664] ) (C {(export)} {(GIT_COMMIT)}) (command.AndOr ops: [Op_DPipe] children: [ (command.SimpleCommand words: [{(git)} {(cat-file)} {(commit)} {(DQ ($ VSub_Name '$commit'))}] redirects: [(redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(../commit)})] ) (C {(die)} {(DQ ('Cannot read commit ') ($ VSub_Name '$commit'))}) ] ) (command.AndOr ops: [Op_DPipe] children: [ (C {(eval)} { (DQ (word_part.CommandSubPart command_list: (command.CommandList children: [ (command.SimpleCommand words: [{(set_ident)}] redirects: [ (redir.Redir op: <Redir_Less '<'> fd: 16777215 arg_word: {(../commit)} ) ] ) ] ) left_token: <Left_CommandSub '$('> spids: [1701 1706] ) ) } ) (C {(die)} {(DQ ('setting author/committer failed for commit ') ($ VSub_Name '$commit'))} ) ] ) (command.AndOr ops: [Op_DPipe] children: [ (command.SimpleCommand words: [{(eval)} {(DQ ($ VSub_Name '$filter_env'))}] redirects: [(redir.Redir op:<Redir_Less '<'> fd:16777215 arg_word:{(/dev/null)})] ) (C {(die)} {(DQ ('env filter failed: ') ($ VSub_Name '$filter_env'))}) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Lit_Other '[')} {(DQ ($ VSub_Name '$filter_tree'))} {(Lit_Other ']')}) 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.SimpleCommand words: [{(eval)} {(DQ ($ VSub_Name '$filter_tree'))}] redirects: [ (redir.Redir op: <Redir_Less '<'> fd: 16777215 arg_word: {(/dev/null)} ) ] ) (C {(die)} {(DQ ('tree filter failed: ') ($ VSub_Name '$filter_tree'))}) ] ) (command.AndOr ops: [Op_DPipe] children: [ (command.Subshell child: (command.AndOr ops: [Op_DAmp] children: [ (C {(git)} {(diff-index)} {(-r)} {(--name-only)} {(--ignore-submodules)} {($ VSub_Name '$commit')} {(--)} ) (C {(git)} {(ls-files)} {(--others)}) ] ) redirects: [ (redir.Redir op: <Redir_Great '>'> fd: 16777215 arg_word: {(DQ ($ VSub_Name '$tempdir')) (/tree-state)} ) ] spids: [1819 1846] ) (command.ControlFlow token:<ControlFlow_Exit exit>) ] ) (command.AndOr ops: [Op_DPipe] children: [ (command.SimpleCommand words: [{(git)} {(update-index)} {(--add)} {(--replace)} {(--remove)} {(--stdin)}] redirects: [ (redir.Redir op: <Redir_Less '<'> fd: 16777215 arg_word: {(DQ ($ VSub_Name '$tempdir')) (/tree-state)} ) ] ) (command.ControlFlow token:<ControlFlow_Exit exit>) ] ) ] spids: [16777215 1753] ) ] spids: [16777215 1886] ) (command.AndOr ops: [Op_DPipe] children: [ (command.SimpleCommand words: [{(eval)} {(DQ ($ VSub_Name '$filter_index'))}] redirects: [(redir.Redir op:<Redir_Less '<'> fd:16777215 arg_word:{(/dev/null)})] ) (C {(die)} {(DQ ('index filter failed: ') ($ VSub_Name '$filter_index'))}) ] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:parentstr spids:[1912]) op: Equal rhs: (word.EmptyWord) spids: [1912] ) ] spids: [1912] ) (command.ForEach iter_name: parent iter_words: [{($ VSub_Name '$parents')}] do_arg_iter: F body: (command.DoGroup children: [ (command.ForEach iter_name: reparent iter_words: [ { (word_part.CommandSubPart command_list: (command.CommandList children: [(C {(map)} {(DQ ($ VSub_Name '$parent'))})] ) left_token: <Left_CommandSub '$('> spids: [1933 1939] ) } ] do_arg_iter: F body: (command.DoGroup children: [ (command.Case to_match: {(DQ ($ VSub_Name '$parentstr') (' '))} arms: [ (case_arm pat_list: [ {(Lit_Other '*') (DQ (' -p ') ($ VSub_Name '$reparent') (' ')) (Lit_Other '*') } ] spids: [1955 1962 1965 16777215] ) (case_arm pat_list: [{(Lit_Other '*')}] action: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:parentstr spids:[1972]) op: Equal rhs: { (DQ ($ VSub_Name '$parentstr') (' -p ') ($ VSub_Name '$reparent') ) } spids: [1972] ) ] spids: [1972] ) ] spids: [1968 1969 1980 16777215] ) ] spids: [1945 1952 1983] ) ] spids: [1942 1986] ) spids: [1932 1940] ) ] spids: [1924 1989] ) spids: [1920 1922] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Lit_Other '[')} {(DQ ($ VSub_Name '$filter_parent'))} {(Lit_Other ']')}) terminator: <Op_Semi ';'> ) ] action: [ (command.AndOr ops: [Op_DPipe] children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:parentstr spids:[2006]) op: Equal rhs: { (DQ (word_part.CommandSubPart command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {(echo)} {(DQ ($ VSub_Name '$parentstr'))}) (C {(eval)} {(DQ ($ VSub_Name '$filter_parent'))}) ] negated: F ) ] ) left_token: <Left_CommandSub '$('> spids: [2008 2022] ) ) } spids: [2006] ) ] spids: [2006] ) (C {(die)} {(DQ ('parent filter failed: ') ($ VSub_Name '$filter_parent'))}) ] ) ] spids: [16777215 2003] ) ] spids: [16777215 2036] ) (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.SimpleCommand words: [{(read)} {(-r)} {(header_line)}] more_env: [(env_pair name:IFS val:{(SQ )} spids:[2045])] ) (C {(test)} {(-n)} {(DQ ($ VSub_Name '$header_line'))}) ] ) ] body: (command.DoGroup children: [ (command.Sentence child: (C {(Lit_Other ':')}) terminator: <Op_Semi ';'> ) ] spids: [2066 2077] ) ) (C {(cat)}) ] redirects: [(redir.Redir op:<Redir_Less '<'> fd:16777215 arg_word:{(../commit)})] spids: [2040] ) (command.SimpleCommand words: [{(eval)} {(DQ ($ VSub_Name '$filter_msg'))}] redirects: [ (redir.Redir op: <Redir_Great '>'> fd: 16777215 arg_word: {(../message)} ) ] ) ] negated: F ) (C {(die)} {(DQ ('msg filter failed: ') ($ VSub_Name '$filter_msg'))}) ] ) (command.If arms: [ (if_arm cond: [(C {(test)} {(-n)} {(DQ ($ VSub_Name '$need_index'))})] action: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:tree spids:[2131]) op: Equal rhs: { (word_part.CommandSubPart command_list: (command.CommandList children: [(C {(git)} {(write-tree)})] ) left_token: <Left_CommandSub '$('> spids: [2132 2136] ) } spids: [2131] ) ] spids: [2131] ) ] spids: [16777215 2128] ) ] else_action: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:tree spids:[2142]) op: Equal rhs: { (word_part.CommandSubPart command_list: (command.CommandList children: [ (C {(git)} {(rev-parse)} {(DQ ($ VSub_Name '$commit') ('^{tree}'))}) ] ) left_token: <Left_CommandSub '$('> spids: [2143 2152] ) } spids: [2142] ) ] spids: [2142] ) ] spids: [2139 2155] ) (command.AndOr ops: [Op_DPipe] children: [ (command.SimpleCommand words: [ {(Lit_Other '@') (SHELL_PATH) (Lit_Other '@')} {(-c)} {(DQ ($ VSub_Name '$filter_commit'))} {(DQ ('git commit-tree'))} {(DQ ($ VSub_Name '$tree'))} {($ VSub_Name '$parentstr')} ] redirects: [ (redir.Redir op: <Redir_Less '<'> fd: 16777215 arg_word: {(../message)} ) (redir.Redir op: <Redir_Great '>'> fd: 16777215 arg_word: {(../map/) ($ VSub_Name '$commit')} ) ] more_env: [(env_pair name:workdir val:{($ VSub_Name '$workdir')} spids:[2158])] ) (C {(die)} {(DQ ('could not write rewritten commit'))}) ] ) ] spids: [1496 2201] ) redirects: [(redir.Redir op:<Redir_Less '<'> fd:16777215 arg_word:{(../revs)})] ) (command.If arms: [ (if_arm cond: [(C {(test)} {(DQ ($ VSub_Name '$remap_to_ancestor'))} {(Lit_Other '=')} {(t)})] action: [ (command.WhileUntil keyword: <KW_While while> cond: [(C {(read)} {(ref)})] body: (command.DoGroup children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:sha1 spids:[2248]) op: Equal rhs: { (word_part.CommandSubPart command_list: (command.CommandList children: [ (C {(git)} {(rev-parse)} {(DQ ($ VSub_Name '$ref')) (Lit_Other '^') (0)} ) ] ) left_token: <Left_CommandSub '$('> spids: [2249 2259] ) } spids: [2248] ) ] spids: [2248] ) (command.AndOr ops: [Op_DAmp] children: [ (C {(test)} {(-f)} {(DQ ($ VSub_Name '$workdir')) (/../map/) ($ VSub_Name '$sha1')} ) (command.ControlFlow token: <ControlFlow_Continue continue> ) ] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:ancestor spids:[2277]) op: Equal rhs: { (word_part.CommandSubPart command_list: (command.CommandList children: [ (C {(git)} {(rev-list)} {(--simplify-merges)} {(-1)} {(DQ ($ VSub_Name '$ref'))} {(DQ ($ VSub_At '$@'))} ) ] ) left_token: <Left_CommandSub '$('> spids: [2278 2294] ) } spids: [2277] ) ] spids: [2277] ) (command.AndOr ops: [Op_DAmp] children: [ (C {(test)} {(DQ ($ VSub_Name '$ancestor'))}) (command.SimpleCommand words: [ {(echo)} { (word_part.CommandSubPart command_list: (command.CommandList children: [(C {(map)} {($ VSub_Name '$ancestor')})] ) left_token: <Left_CommandSub '$('> spids: [2307 2311] ) } ] redirects: [ (redir.Redir op: <Redir_DGreat '>>'> fd: 16777215 arg_word: {(DQ ($ VSub_Name '$workdir')) (/../map/) ($ VSub_Name '$sha1')} ) ] ) ] ) ] spids: [2245 2322] ) redirects: [ (redir.Redir op: <Redir_Less '<'> fd: 16777215 arg_word: {(DQ ($ VSub_Name '$tempdir')) (/heads)} ) ] ) ] spids: [16777215 2235] ) ] spids: [16777215 2331] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:_x40 spids:[2338]) op: Equal rhs: {(SQ <'[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]'>)} spids: [2338] ) ] spids: [2338] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:_x40 spids:[2343]) op: Equal rhs: { (DQ ($ VSub_Name '$_x40') ($ VSub_Name '$_x40') ($ VSub_Name '$_x40') ($ VSub_Name '$_x40') ($ VSub_Name '$_x40') ($ VSub_Name '$_x40') ($ VSub_Name '$_x40') ($ VSub_Name '$_x40') ) } spids: [2343] ) ] spids: [2343] ) (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_Name '$orig_namespace') ($ VSub_Name '$ref'))}) (command.ControlFlow token:<ControlFlow_Continue continue>) ] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:sha1 spids:[2385]) op: Equal rhs: { (word_part.CommandSubPart command_list: (command.CommandList children: [ (C {(git)} {(rev-parse)} {(DQ ($ VSub_Name '$ref')) (Lit_Other '^') (0)}) ] ) left_token: <Left_CommandSub '$('> spids: [2386 2396] ) } spids: [2385] ) ] spids: [2385] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:rewritten spids:[2399]) op: Equal rhs: { (word_part.CommandSubPart command_list: (command.CommandList children: [(C {(map)} {($ VSub_Name '$sha1')})] ) left_token: <Left_CommandSub '$('> spids: [2400 2404] ) } spids: [2399] ) ] spids: [2399] ) (command.AndOr ops: [Op_DAmp Op_DAmp] children: [ (C {(test)} {($ VSub_Name '$sha1')} {(Lit_Other '=')} {(DQ ($ VSub_Name '$rewritten'))}) (C {(warn)} {(DQ ("WARNING: Ref '") ($ VSub_Name '$ref') ("' is unchanged"))}) (command.ControlFlow token:<ControlFlow_Continue continue>) ] ) (command.Case to_match: {(DQ ($ VSub_Name '$rewritten'))} arms: [ (case_arm pat_list: [{(SQ )}] action: [ (C {(echo)} {(DQ ("Ref '") ($ VSub_Name '$ref') ("' was deleted"))}) (command.AndOr ops: [Op_DPipe] children: [ (C {(git)} {(update-ref)} {(-m)} {(DQ ('filter-branch: delete'))} {(-d)} {(DQ ($ VSub_Name '$ref'))} {($ VSub_Name '$sha1')} ) (C {(die)} {(DQ ('Could not delete ') ($ VSub_Name '$ref'))}) ] ) ] spids: [2445 2447 2488 16777215] ) (case_arm pat_list: [{($ VSub_Name '$_x40')}] action: [ (C {(echo)} {(DQ ("Ref '") ($ VSub_Name '$ref') ("' was rewritten"))}) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.Pipeline children: [ (command.SimpleCommand words: [ {(git)} {(update-ref)} {(-m)} {(DQ ('filter-branch: rewrite'))} {(DQ ($ VSub_Name '$ref'))} {($ VSub_Name '$rewritten')} {($ VSub_Name '$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.CommandSubPart command_list: (command.CommandList children: [ (C {(git)} {(cat-file)} {(-t)} {(DQ ($ VSub_Name '$ref'))} ) ] ) left_token: <Left_CommandSub '$('> spids: [2539 2549] ) } {(Lit_Other '=')} {(tag)} ) terminator: <Op_Semi ';'> ) ] action: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(test)} {(-z)} {(DQ ($ VSub_Name '$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." ) ) } ) ] spids: [16777215 2570] ) ] spids: [16777215 2587] ) ] spids: [16777215 2556] ) ] else_action: [ (C {(die)} {(DQ ('Could not rewrite ') ($ VSub_Name '$ref'))}) ] spids: [2590 2601] ) ] spids: [16777215 2532] ) ] spids: [16777215 2604] ) ] spids: [2491 2492 2607 16777215] ) (case_arm pat_list: [{(Lit_Other '*')}] action: [ (C {(warn)} { (DQ ("WARNING: '") ($ VSub_Name '$ref') ("' was rewritten into multiple commits:") ) } ) (C {(warn)} {(DQ ($ VSub_Name '$rewritten'))}) (C {(warn)} { (DQ ("WARNING: Ref '") ($ VSub_Name '$ref') ("' points to the first one now.")) } ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:rewritten spids:[2643]) op: Equal rhs: { (word_part.CommandSubPart command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {(echo)} {(DQ ($ VSub_Name '$rewritten'))}) (C {(head)} {(-n)} {(1)}) ] negated: F ) ] ) left_token: <Left_CommandSub '$('> spids: [2644 2658] ) } spids: [2643] ) ] spids: [2643] ) (command.AndOr ops: [Op_DPipe] children: [ (C {(git)} {(update-ref)} {(-m)} {(DQ ('filter-branch: rewrite to first'))} {(DQ ($ VSub_Name '$ref'))} {($ VSub_Name '$rewritten')} {($ VSub_Name '$sha1')} ) (C {(die)} {(DQ ('Could not rewrite ') ($ VSub_Name '$ref'))}) ] ) ] spids: [2610 2611 2692 16777215] ) ] spids: [2436 2442 2695] ) (command.AndOr ops: [Op_DPipe] children: [ (C {(git)} {(update-ref)} {(-m)} {(DQ ('filter-branch: backup'))} {(DQ ($ VSub_Name '$orig_namespace') ($ VSub_Name '$ref'))} {($ VSub_Name '$sha1')} ) (command.ControlFlow token:<ControlFlow_Exit exit>) ] ) ] spids: [2363 2720] ) redirects: [ (redir.Redir op: <Redir_Less '<'> fd: 16777215 arg_word: {(DQ ($ VSub_Name '$tempdir')) (/heads)} ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Lit_Other '[')} {(DQ ($ VSub_Name '$filter_tag_name'))} {(Lit_Other ']')}) 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 keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:ref spids:[2783]) op: Equal rhs: { (DQ (word_part.BracedVarSub token: <VSub_Name ref> suffix_op: (suffix_op.StringUnary op_id: VOp1_Pound arg_word: {(refs) (Lit_Slash /) (tags) (Lit_Slash /)} ) spids: [2785 2792] ) ) } spids: [2783] ) ] spids: [2783] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Lit_Other '[')} {(DQ ($ VSub_Name '$type'))} {(KW_Bang '!') (Lit_Other '=')} {(DQ (commit))} {(-a)} {(DQ ($ VSub_Name '$type'))} {(KW_Bang '!') (Lit_Other '=')} {(DQ (tag))} {(Lit_Other ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (command.Sentence child: (command.ControlFlow token:<ControlFlow_Continue continue>) terminator: <Op_Semi ';'> ) ] spids: [16777215 2831] ) ] spids: [16777215 2838] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Lit_Other '[')} {(DQ ($ VSub_Name '$type'))} {(Lit_Other '=')} {(DQ (tag))} {(Lit_Other ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:sha1t spids:[2866]) op: Equal rhs: {(DQ ($ VSub_Name '$sha1'))} spids: [2866] ) ] spids: [2866] ) (command.AndOr ops: [Op_DPipe] children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:sha1 spids:[2872]) op: Equal rhs: { (DQ (word_part.CommandSubPart command_list: (command.CommandList children: [ (C {(git)} {(rev-parse)} {(-q)} {(DQ ($ VSub_Name '$sha1')) (Lit_Other '^') (Lit_LBrace '{') (commit) (Lit_RBrace '}') } ) ] ) left_token: <Left_CommandSub '$('> spids: [2874 2888] ) ) } spids: [2872] ) ] spids: [2872] ) (command.ControlFlow token: <ControlFlow_Continue continue> ) ] ) ] spids: [16777215 2859] ) ] spids: [16777215 2896] ) (command.AndOr ops: [Op_DPipe] children: [ (C {(Lit_Other '[')} {(-f)} {(DQ (../map/) ($ VSub_Name '$sha1'))} {(Lit_Other ']')} ) (command.ControlFlow token: <ControlFlow_Continue continue> ) ] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:new_sha1 spids:[2916]) op: Equal rhs: { (DQ (word_part.CommandSubPart command_list: (command.CommandList children: [(C {(cat)} {(DQ (../map/) ($ VSub_Name '$sha1'))})] ) left_token: <Left_CommandSub '$('> spids: [2918 2925] ) ) } spids: [2916] ) ] spids: [2916] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:GIT_COMMIT spids:[2929]) op: Equal rhs: {(DQ ($ VSub_Name '$sha1'))} spids: [2929] ) ] spids: [2929] ) (C {(export)} {(GIT_COMMIT)}) (command.AndOr ops: [Op_DPipe] children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:new_ref spids:[2940]) op: Equal rhs: { (DQ (word_part.CommandSubPart command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {(echo)} {(DQ ($ VSub_Name '$ref'))}) (C {(eval)} {(DQ ($ VSub_Name '$filter_tag_name'))}) ] negated: F ) ] ) left_token: <Left_CommandSub '$('> spids: [2942 2956] ) ) } spids: [2940] ) ] spids: [2940] ) (C {(die)} {(DQ ('tag name filter failed: ') ($ VSub_Name '$filter_tag_name'))} ) ] ) (C {(echo)} { (DQ ($ VSub_Name '$ref') (' -> ') ($ VSub_Name '$new_ref') (' (') ($ VSub_Name '$sha1') (' -> ') ($ VSub_Name '$new_sha1') (')') ) } ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Lit_Other '[')} {(DQ ($ VSub_Name '$type'))} {(Lit_Other '=')} {(DQ (tag))} {(Lit_Other ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (command.AndOr ops: [Op_DPipe] children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:new_sha1 spids:[3006]) op: Equal rhs: { (word_part.CommandSubPart command_list: (command.CommandList children: [ (command.Pipeline children: [ (command.Subshell child: (command.CommandList children: [ (C {(printf)} { (SQ < 'object %s\\ntype commit\\ntag %s\\n' > ) } {(DQ ($ VSub_Name '$new_sha1'))} {(DQ ($ VSub_Name '$new_ref'))} ) (command.Pipeline children: [ (C {(git)} {(cat-file)} {(tag)} {(DQ ($ VSub_Name '$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 ) ] ) spids: [3009 3073] ) (C {(git)} {(mktag)}) ] negated: F ) ] ) left_token: <Left_CommandSub '$('> spids: [3007 3081] ) } spids: [3006] ) ] spids: [3006] ) (C {(die)} { (DQ ('Could not create new tag object for ') ($ VSub_Name '$ref') ) } ) ] ) (command.If arms: [ (if_arm cond: [ (command.Pipeline children: [ (C {(git)} {(cat-file)} {(tag)} {(DQ ($ VSub_Name '$ref'))}) (command.SimpleCommand 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_Name '$sha1t') ) } ) ] spids: [16777215 3123] ) ] spids: [16777215 3134] ) ] spids: [16777215 3003] ) ] spids: [16777215 3137] ) (command.AndOr ops: [Op_DPipe] children: [ (C {(git)} {(update-ref)} {(DQ (refs/tags/) ($ VSub_Name '$new_ref'))} {(DQ ($ VSub_Name '$new_sha1'))} ) (C {(die)} {(DQ ('Could not write tag ') ($ VSub_Name '$new_ref'))}) ] ) ] spids: [2780 3165] ) ) ] negated: F ) ] spids: [16777215 2751] ) ] spids: [16777215 3167] ) (C {(cd)} {(DQ ($ VSub_Name '$orig_dir'))}) (C {(rm)} {(-rf)} {(DQ ($ VSub_Name '$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_Name '$ORIG_GIT_DIR'))}) (command.BraceGroup children: [ (command.AndOr ops: [Op_DAmp] children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:GIT_DIR spids:[3213]) op: Equal rhs: {(DQ ($ VSub_Name '$ORIG_GIT_DIR'))} spids: [3213] ) ] spids: [3213] ) (C {(export)} {(GIT_DIR)}) ] ) ] spids: [3210] ) ] ) (command.AndOr ops: [Op_DPipe] children: [ (C {(test)} {(-z)} {(DQ ($ VSub_Name '$ORIG_GIT_WORK_TREE'))}) (command.BraceGroup children: [ (command.AndOr ops: [Op_DAmp] children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:GIT_WORK_TREE spids:[3239]) op: Equal rhs: {(DQ ($ VSub_Name '$ORIG_GIT_WORK_TREE'))} spids: [3239] ) ] spids: [3239] ) (C {(export)} {(GIT_WORK_TREE)}) ] ) ] spids: [3236] ) ] ) (command.AndOr ops: [Op_DPipe] children: [ (C {(test)} {(-z)} {(DQ ($ VSub_Name '$ORIG_GIT_INDEX_FILE'))}) (command.BraceGroup children: [ (command.AndOr ops: [Op_DAmp] children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:GIT_INDEX_FILE spids:[3266]) op: Equal rhs: {(DQ ($ VSub_Name '$ORIG_GIT_INDEX_FILE'))} spids: [3266] ) ] spids: [3266] ) (C {(export)} {(GIT_INDEX_FILE)}) ] ) ] spids: [3263] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Lit_Other '[')} { (DQ (word_part.CommandSubPart command_list: (command.CommandList children:[(C {(is_bare_repository)})]) left_token: <Left_CommandSub '$('> spids: [3286 3288] ) ) } {(Lit_Other '=')} {(false)} {(Lit_Other ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (command.AndOr ops: [Op_DPipe] children: [ (C {(git)} {(read-tree)} {(-u)} {(-m)} {(HEAD)}) (command.ControlFlow token:<ControlFlow_Exit exit>) ] ) ] spids: [16777215 3298] ) ] spids: [16777215 3315] ) (command.ControlFlow token:<ControlFlow_Exit exit> arg_word:{(0)}) ] )