#!/bin/sh global USAGE := ''[help|start|bad|good|new|old|terms|skip|next|reset|visualize|replay|log|run]'' global LONG_USAGE := ''git bisect help print this long help message. git bisect start [--term-{old,good}= --term-{new,bad}=] [--no-checkout] [ [...]] [--] [...] reset bisect state and start bisection. git bisect (bad|new) [] mark a known-bad revision/ a revision after change in a given property. git bisect (good|old) [...] mark ... known-good revisions/ revisions before change in a given property. git bisect terms [--term-good | --term-bad] show the terms used for old and new commits (default: bad, good) git bisect skip [(|)...] mark ... untestable revisions. git bisect next find next bisection to test and check it out. git bisect reset [] finish bisection search and go back to commit. git bisect visualize show bisect status in gitk. git bisect replay replay bisection log. git bisect log show bisect log. git bisect run ... use ... to automatically bisect. Please use "git help bisect" to get the full man page.'' global OPTIONS_SPEC := '' source git-sh-setup global _x40 := ''[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]'' global _x40 := ""$_x40$_x40$_x40$_x40$_x40$_x40$_x40$_x40"" global TERM_BAD := 'bad' global TERM_GOOD := 'good' proc bisect_head { if test -f "$GIT_DIR/BISECT_HEAD" { echo BISECT_HEAD } else { echo HEAD } } proc bisect_autostart { test -s "$GIT_DIR/BISECT_START" || do { gettextln "You need to start by \"git bisect start\"" > !2 if test -t 0 { # TRANSLATORS: Make sure to include [Y] and [n] in your # translation. The program will only accept English input # at this point. gettext "Do you want me to do it for you [Y/n]? " > !2 read yesno matchstr $yesno { [Nn]* { exit } } bisect_start } else { exit 1 } } } proc bisect_start { # # Check for one bad and then some good revisions. # global has_double_dash := '0'for arg in @Argv { matchstr $arg { -- { global has_double_dash := '1'; break } } } global orig_args := $[git rev-parse --sq-quote @Argv] global bad_seen := '0' global eval := '''' global must_write_terms := '0' global revs := '''' if test "z$[git rev-parse --is-bare-repository]" != zfalse { global mode := '--no-checkout' } else { global mode := '''' } while [ $# -gt 0 ] { global arg := $1 matchstr $arg { -- { shift break } --no-checkout { global mode := '--no-checkout' shift } --term-good|--term-old { shift global must_write_terms := '1' global TERM_GOOD := $1 shift } --term-good=*|--term-old=* { global must_write_terms := '1' global TERM_GOOD := $(1#*=) shift } --term-bad|--term-new { shift global must_write_terms := '1' global TERM_BAD := $1 shift } --term-bad=*|--term-new=* { global must_write_terms := '1' global TERM_BAD := $(1#*=) shift } --* { die $[eval_gettext "unrecognised option: '\$arg'] } * { global rev := $[git rev-parse -q --verify "$arg^{commit}] || do { test $has_double_dash -eq 1 && die $[eval_gettext "'\$arg' does not appear to be a valid revision] break } global revs := ""$revs $rev"" shift } } } for rev in [$revs] { # The user ran "git bisect start # ", hence did not explicitly specify # the terms, but we are already starting to # set references named with the default terms, # and won't be able to change afterwards. global must_write_terms := '1' matchstr $bad_seen { 0 { global state := $TERM_BAD ; global bad_seen := '1' } * { global state := $TERM_GOOD } } global eval := ""$eval bisect_write '$state' '$rev' 'nolog' &&"" } # # Verify HEAD. # global head := $[env GIT_DIR=$GIT_DIR git symbolic-ref -q HEAD] || global head := $[env GIT_DIR=$GIT_DIR git rev-parse --verify HEAD] || die $[gettext "Bad HEAD - I need a HEAD] # # Check if we are bisecting. # global start_head := '''' if test -s "$GIT_DIR/BISECT_START" { # Reset to the rev from where we started. global start_head := $[cat "$GIT_DIR/BISECT_START] if test "z$mode" != "z--no-checkout" { git checkout $start_head -- || die $[eval_gettext "Checking out '\$start_head' failed. Try 'git bisect reset '.] } } else { # Get rev from where we start. matchstr $head { refs/heads/*|$_x40 { # This error message should only be triggered by # cogito usage, and cogito users should understand # it relates to cg-seek. test -s "$GIT_DIR/head-name" && die $[gettext "won't bisect on cg-seek'ed tree] global start_head := $(head#refs/heads/) } * { die $[gettext "Bad HEAD - strange symbolic ref] } } } # # Get rid of any old bisect state. # bisect_clean_state || exit # # Change state. # In case of mistaken revs or checkout error, or signals received, # "bisect_auto_next" below may exit or misbehave. # We have to trap this to be able to clean up using # "bisect_clean_state". # trap 'bisect_clean_state' 0 trap 'exit 255' 1 2 3 15 # # Write new start state. # echo $start_head >"$GIT_DIR/BISECT_START" && do { test "z$mode" != "z--no-checkout" || git update-ref --no-deref BISECT_HEAD $start_head } && git rev-parse --sq-quote @Argv >"$GIT_DIR/BISECT_NAMES" && eval "$eval true" && if test $must_write_terms -eq 1 { write_terms $TERM_BAD $TERM_GOOD } && echo "git bisect start$orig_args" >>"$GIT_DIR/BISECT_LOG" || exit # # Check if we can proceed to the next bisect state. # bisect_auto_next trap '-' 0 } proc bisect_write { global state := $1 global rev := $2 global nolog := $3 matchstr $state { "$TERM_BAD" { global tag := $state } "$TERM_GOOD"|skip { global tag := ""$state"-"$rev"" } * { die $[eval_gettext "Bad bisect_write argument: \$state] } } git update-ref "refs/bisect/$tag" $rev || exit echo "# $state: $[git show-branch $rev]" >>"$GIT_DIR/BISECT_LOG" test -n $nolog || echo "git bisect $state $rev" >>"$GIT_DIR/BISECT_LOG" } proc is_expected_rev { test -f "$GIT_DIR/BISECT_EXPECTED_REV" && test $1 = $[cat "$GIT_DIR/BISECT_EXPECTED_REV] } proc check_expected_revs { for _rev in [@Argv] { if ! is_expected_rev $_rev { rm -f "$GIT_DIR/BISECT_ANCESTORS_OK" rm -f "$GIT_DIR/BISECT_EXPECTED_REV" return } } } proc bisect_skip { global all := '''' for arg in [@Argv] { matchstr $arg { *..* { global revs := $[git rev-list $arg] || die $[eval_gettext "Bad rev input: \$arg] } * { global revs := $[git rev-parse --sq-quote $arg] } } global all := ""$all $revs"" } eval bisect_state 'skip' $all } proc bisect_state { bisect_autostart global state := $1 check_and_set_terms $state matchstr "$Argc,$state" { 0,* { die "Please call 'bisect_state' with at least one argument." } 1,"$TERM_BAD"|1,"$TERM_GOOD"|1,skip { global bisected_head := $[bisect_head] global rev := $[git rev-parse --verify $bisected_head] || die $[eval_gettext "Bad rev input: \$bisected_head] bisect_write $state $rev check_expected_revs $rev } 2,"$TERM_BAD"|*,"$TERM_GOOD"|*,skip { shift global hash_list := '''' for rev in [@Argv] { global sha := $[git rev-parse --verify "$rev^{commit}] || die $[eval_gettext "Bad rev input: \$rev] global hash_list := ""$hash_list $sha"" } for rev in [$hash_list] { bisect_write $state $rev } check_expected_revs $hash_list } *,"$TERM_BAD" { die $[eval_gettext "'git bisect \$TERM_BAD' can take only one argument.] } * { usage } } bisect_auto_next } proc bisect_next_check { global missing_good := '', missing_bad := '' git show-ref -q --verify refs/bisect/$TERM_BAD || global missing_bad := 't' test -n $[git for-each-ref "refs/bisect/$TERM_GOOD-*] || global missing_good := 't' matchstr "$missing_good,$missing_bad,$1" { ,,* { : have both $TERM_GOOD and $TERM_BAD - ok } *, { # do not have both but not asked to fail - just report. false } t,,"$TERM_GOOD" { # have bad (or new) but not good (or old). we could bisect although # this is less optimum. eval_gettextln "Warning: bisecting only with a \$TERM_BAD commit." > !2 if test -t 0 { # TRANSLATORS: Make sure to include [Y] and [n] in your # translation. The program will only accept English input # at this point. gettext "Are you sure [Y/n]? " > !2 read yesno matchstr $yesno { [Nn]* { exit 1 } } } : bisect without $TERM_GOOD... } * { global bad_syn := $[bisect_voc bad] global good_syn := $[bisect_voc good] if test -s "$GIT_DIR/BISECT_START" { eval_gettextln "You need to give me at least one \$bad_syn and one \$good_syn revision. (You can use \"git bisect \$bad_syn\" and \"git bisect \$good_syn\" for that.)" > !2 } else { eval_gettextln "You need to start by \"git bisect start\". You then need to give me at least one \$good_syn and one \$bad_syn revision. (You can use \"git bisect \$bad_syn\" and \"git bisect \$good_syn\" for that.)" > !2 } exit 1 } } } proc bisect_auto_next { bisect_next_check && bisect_next || : } proc bisect_next { matchstr "$Argc" { 0 { } * { usage } } bisect_autostart bisect_next_check $TERM_GOOD # Perform all bisection computation, display and checkout git bisect--helper --next-all $[test -f "$GIT_DIR/BISECT_HEAD" && echo --no-checkout] global res := $Status # Check if we should exit because bisection is finished if test $res -eq 10 { global bad_rev := $[git show-ref --hash --verify refs/bisect/$TERM_BAD] global bad_commit := $[git show-branch $bad_rev] echo "# first $TERM_BAD commit: $bad_commit" >>"$GIT_DIR/BISECT_LOG" exit 0 } elif test $res -eq 2 { echo "# only skipped commits left to test" >>"$GIT_DIR/BISECT_LOG" global good_revs := $[git for-each-ref --format="%(objectname)" "refs/bisect/$TERM_GOOD-*] for skipped in [$[git rev-list refs/bisect/$TERM_BAD --not $good_revs]] { global skipped_commit := $[git show-branch $skipped] echo "# possible first $TERM_BAD commit: $skipped_commit" >>"$GIT_DIR/BISECT_LOG" } exit $res } # Check for an error in the bisection process test $res -ne 0 && exit $res return 0 } proc bisect_visualize { bisect_next_check fail if test $Argc = 0 { if test -n "$(DISPLAY+set)$(SESSIONNAME+set)$(MSYSTEM+set)$(SECURITYSESSIONID+set)" && type gitk >/dev/null !2 > !1 { set gitk } else { set git log } } else { matchstr $1 { git*|tig { } -* { set git log @Argv } * { set git @Argv } } } eval '"$@"' --bisect -- $[cat "$GIT_DIR/BISECT_NAMES] } proc bisect_reset { test -s "$GIT_DIR/BISECT_START" || do { gettextln "We are not bisecting." return } matchstr "$Argc" { 0 { global branch := $[cat "$GIT_DIR/BISECT_START] } 1 { git rev-parse --quiet --verify "$1^{commit}" >/dev/null || do { global invalid := $1 die $[eval_gettext "'\$invalid' is not a valid commit] } global branch := $1 } * { usage } } if ! test -f "$GIT_DIR/BISECT_HEAD" && ! git checkout $branch -- { die $[eval_gettext "Could not check out original HEAD '\$branch'. Try 'git bisect reset '.] } bisect_clean_state } proc bisect_clean_state { # There may be some refs packed during bisection. git for-each-ref --format='%(refname) %(objectname)' refs/bisect/'*' | while read ref hash { git update-ref -d $ref $hash || exit } rm -f "$GIT_DIR/BISECT_EXPECTED_REV" && rm -f "$GIT_DIR/BISECT_ANCESTORS_OK" && rm -f "$GIT_DIR/BISECT_LOG" && rm -f "$GIT_DIR/BISECT_NAMES" && rm -f "$GIT_DIR/BISECT_RUN" && rm -f "$GIT_DIR/BISECT_TERMS" && # Cleanup head-name if it got left by an old version of git-bisect rm -f "$GIT_DIR/head-name" && git update-ref -d --no-deref BISECT_HEAD && # clean up BISECT_START last rm -f "$GIT_DIR/BISECT_START" } proc bisect_replay { global file := $1 test "$Argc" -eq 1 || die $[gettext "No logfile given] test -r $file || die $[eval_gettext "cannot read \$file for replaying] bisect_reset while read git bisect command rev { test "$git $bisect" = "git bisect" || test $git = "git-bisect" || continue if test $git = "git-bisect" { global rev := $command global command := $bisect } get_terms check_and_set_terms $command matchstr $command { start { global cmd := ""bisect_start $rev"" eval $cmd } "$TERM_GOOD"|"$TERM_BAD"|skip { bisect_write $command $rev } terms { bisect_terms $rev } * { die $[gettext "?? what are you talking about?] } } } <"$file" bisect_auto_next } proc bisect_run { bisect_next_check fail while true { global command := @Argv eval_gettextln "running \$command" @Argv global res := $Status # Check for really bad run error. if test $res -lt 0 -o $res -ge 128 { eval_gettextln "bisect run failed: exit code \$res from '\$command' is < 0 or >= 128" > !2 exit $res } # Find current state depending on run success or failure. # A special exit code of 125 means cannot test. if test $res -eq 125 { global state := ''skip'' } elif test $res -gt 0 { global state := $TERM_BAD } else { global state := $TERM_GOOD } # We have to use a subshell because "bisect_state" can exit. shell { bisect_state $state >"$GIT_DIR/BISECT_RUN" } global res := $Status cat "$GIT_DIR/BISECT_RUN" if sane_grep "first $TERM_BAD commit could be any of" "$GIT_DIR/BISECT_RUN" \ >/dev/null { gettextln "bisect run cannot continue any more" > !2 exit $res } if test $res -ne 0 { eval_gettextln "bisect run failed: 'bisect_state \$state' exited with error code \$res" > !2 exit $res } if sane_grep "is the first $TERM_BAD commit" "$GIT_DIR/BISECT_RUN" >/dev/null { gettextln "bisect run success" exit 0; } } } proc bisect_log { test -s "$GIT_DIR/BISECT_LOG" || die $[gettext "We are not bisecting.] cat "$GIT_DIR/BISECT_LOG" } proc get_terms { if test -s "$GIT_DIR/BISECT_TERMS" { do { read TERM_BAD read TERM_GOOD } <"$GIT_DIR/BISECT_TERMS" } } proc write_terms { global TERM_BAD := $1 global TERM_GOOD := $2 if test $TERM_BAD = $TERM_GOOD { die $[gettext "please use two different terms] } check_term_format $TERM_BAD bad check_term_format $TERM_GOOD good printf '%s\n%s\n' $TERM_BAD $TERM_GOOD >"$GIT_DIR/BISECT_TERMS" } proc check_term_format { global term := $1 git check-ref-format refs/bisect/"$term" || die $[eval_gettext "'\$term' is not a valid term] matchstr $term { help|start|terms|skip|next|reset|visualize|replay|log|run { die $[eval_gettext "can't use the builtin command '\$term' as a term] } bad|new { if test $2 != bad { # In theory, nothing prevents swapping # completely good and bad, but this situation # could be confusing and hasn't been tested # enough. Forbid it for now. die $[eval_gettext "can't change the meaning of term '\$term'] } } good|old { if test $2 != good { die $[eval_gettext "can't change the meaning of term '\$term'] } } } } proc check_and_set_terms { global cmd := $1 matchstr $cmd { skip|start|terms { } * { if test -s "$GIT_DIR/BISECT_TERMS" && test $cmd != $TERM_BAD && test $cmd != $TERM_GOOD { die $[eval_gettext "Invalid command: you're currently in a \$TERM_BAD/\$TERM_GOOD bisect.] } matchstr $cmd { bad|good { if ! test -s "$GIT_DIR/BISECT_TERMS" { write_terms bad good } } new|old { if ! test -s "$GIT_DIR/BISECT_TERMS" { write_terms new old } } } } } } proc bisect_voc { matchstr $1 { bad { echo "bad|new" } good { echo "good|old" } } } proc bisect_terms { get_terms if ! test -s "$GIT_DIR/BISECT_TERMS" { die $[gettext "no terms defined] } matchstr "$Argc" { 0 { gettextln "Your current terms are $TERM_GOOD for the old state and $TERM_BAD for the new state." } 1 { global arg := $1 matchstr $arg { --term-good|--term-old { printf '%s\n' $TERM_GOOD } --term-bad|--term-new { printf '%s\n' $TERM_BAD } * { die $[eval_gettext "invalid argument \$arg for 'git bisect terms'. Supported options are: --term-good|--term-old and --term-bad|--term-new.] } } } * { usage } } } matchstr "$Argc" { 0 { usage } * { global cmd := $1 get_terms shift matchstr $cmd { help { git bisect -h } start { bisect_start @Argv } bad|good|new|old|"$TERM_BAD"|"$TERM_GOOD" { bisect_state $cmd @Argv } skip { bisect_skip @Argv } next { # Not sure we want "next" at the UI level anymore. bisect_next @Argv } visualize|view { bisect_visualize @Argv } reset { bisect_reset @Argv } replay { bisect_replay @Argv } log { bisect_log } run { bisect_run @Argv } terms { bisect_terms @Argv } * { usage } } } } (CommandList children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:USAGE) op: Equal rhs: {(SQ <"[help|start|bad|good|new|old|terms|skip|next|reset|visualize|replay|log|run]">)} spids: [4] ) ] spids: [4] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:LONG_USAGE) op: Equal rhs: { (SQ <"git bisect help\n"> <"\tprint this long help message.\n"> <"git bisect start [--term-{old,good}= --term-{new,bad}=]\n"> <"\t\t [--no-checkout] [ [...]] [--] [...]\n"> <"\treset bisect state and start bisection.\n"> <"git bisect (bad|new) []\n"> <"\tmark a known-bad revision/\n"> <"\t\ta revision after change in a given property.\n"> <"git bisect (good|old) [...]\n"> <"\tmark ... known-good revisions/\n"> <"\t\trevisions before change in a given property.\n"> <"git bisect terms [--term-good | --term-bad]\n"> <"\tshow the terms used for old and new commits (default: bad, good)\n"> <"git bisect skip [(|)...]\n"> <"\tmark ... untestable revisions.\n"> <"git bisect next\n"> <"\tfind next bisection to test and check it out.\n"> <"git bisect reset []\n"> <"\tfinish bisection search and go back to commit.\n"> <"git bisect visualize\n"> <"\tshow bisect status in gitk.\n"> <"git bisect replay \n"> <"\treplay bisection log.\n"> <"git bisect log\n"> <"\tshow bisect log.\n"> <"git bisect run ...\n"> <"\tuse ... to automatically bisect.\n"> <"\n"> <"Please use \"git help bisect\" to get the full man page."> ) } spids: [9] ) ] spids: [9] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:OPTIONS_SPEC) op:Equal rhs:{(SQ )} spids:[43])] spids: [43] ) (C {(.)} {(git-sh-setup)}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:_x40) op: Equal rhs: {(SQ <"[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]">)} spids: [50] ) ] spids: [50] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:_x40) 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: [55] ) ] spids: [55] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:TERM_BAD) op:Equal rhs:{(bad)} spids:[67])] spids: [67] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:TERM_GOOD) op:Equal rhs:{(good)} spids:[70])] spids: [70] ) (FuncDef name: bisect_head body: (BraceGroup children: [ (If arms: [ (if_arm cond: [(C {(test)} {(-f)} {(DQ ($ VSub_Name "$GIT_DIR") (/BISECT_HEAD))})] action: [(C {(echo)} {(BISECT_HEAD)})] spids: [-1 93] ) ] else_action: [(C {(echo)} {(HEAD)})] spids: [101 109] ) ] spids: [78] ) spids: [74 77] ) (FuncDef name: bisect_autostart body: (BraceGroup children: [ (AndOr children: [ (C {(test)} {(-s)} {(DQ ($ VSub_Name "$GIT_DIR") (/BISECT_START))}) (BraceGroup children: [ (SimpleCommand words: [ {(gettextln)} { (DQ ("You need to start by ") (EscapedLiteralPart token: ) ("git bisect start") (EscapedLiteralPart token:) ) } ] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[144])] ) (If arms: [ (if_arm cond: [(C {(test)} {(-t)} {(0)})] action: [ (SimpleCommand words: [{(gettext)} {(DQ ("Do you want me to do it for you [Y/n]? "))}] redirects: [ (Redir op_id: Redir_GreatAnd fd: -1 arg_word: {(2)} spids: [178] ) ] ) (C {(read)} {(yesno)}) (Case to_match: {(DQ ($ VSub_Name "$yesno"))} arms: [ (case_arm pat_list: [{(Lit_Other "[") (Nn) (Lit_Other "]") (Lit_Other "*")}] action: [(C {(exit)})] spids: [196 200 205 -1] ) ] spids: [187 193 208] ) (C {(bisect_start)}) ] spids: [-1 157] ) ] else_action: [(C {(exit)} {(1)})] spids: [214 222] ) ] spids: [132] ) ] op_id: Op_DPipe ) ] spids: [118] ) spids: [114 117] ) (FuncDef name: bisect_start body: (BraceGroup children: [ (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:has_double_dash) op:Equal rhs:{(0)} spids:[249])] spids: [249] ) (ForEach iter_name: arg do_arg_iter: True body: (DoGroup children: [ (Case to_match: {(DQ ($ VSub_Name "$arg"))} arms: [ (case_arm pat_list: [{(--)}] action: [ (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:has_double_dash) op: Equal rhs: {(1)} spids: [272] ) ] spids: [272] ) terminator: ) (ControlFlow token:) ] spids: [269 270 278 -1] ) ] spids: [261 267 280] ) ] spids: [258 283] ) spids: [-1 -1] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:orig_args) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [(C {(git)} {(rev-parse)} {(--sq-quote)} {(DQ ($ VSub_At "$@"))})] ) left_token: spids: [287 297] ) } spids: [286] ) ] spids: [286] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:bad_seen) op:Equal rhs:{(0)} spids:[300])] spids: [300] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:eval) op:Equal rhs:{(SQ )} spids:[304])] spids: [304] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:must_write_terms) op: Equal rhs: {(0)} spids: [309] ) ] spids: [309] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:revs) op:Equal rhs:{(SQ )} spids:[313])] spids: [313] ) (If arms: [ (if_arm cond: [ (C {(test)} { (DQ (z) (CommandSubPart command_list: (CommandList children: [(C {(git)} {(rev-parse)} {(--is-bare-repository)})] ) left_token: spids: [324 330] ) ) } {(KW_Bang "!") (Lit_Other "=")} {(zfalse)} ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:mode) op: Equal rhs: {(--no-checkout)} spids: [342] ) ] spids: [342] ) ] spids: [-1 339] ) ] else_action: [ (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:mode) op:Equal rhs:{(SQ )} spids:[349])] spids: [349] ) ] spids: [346 354] ) (While cond: [ (Sentence child: (C {(Lit_Other "[")} {($ VSub_Pound "$#")} {(-gt)} {(0)} {(Lit_Other "]")}) terminator: ) ] body: (DoGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:arg) op: Equal rhs: {(DQ ($ VSub_Number "$1"))} spids: [373] ) ] spids: [373] ) (Case to_match: {(DQ ($ VSub_Name "$arg"))} arms: [ (case_arm pat_list: [{(--)}] action: [(C {(shift)}) (ControlFlow token:)] spids: [388 389 398 -1] ) (case_arm pat_list: [{(--no-checkout)}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:mode) op: Equal rhs: {(--no-checkout)} spids: [405] ) ] spids: [405] ) (C {(shift)}) ] spids: [401 402 411 -1] ) (case_arm pat_list: [{(--term-good)} {(--term-old)}] action: [ (C {(shift)}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:must_write_terms) op: Equal rhs: {(1)} spids: [423] ) ] spids: [423] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:TERM_GOOD) op: Equal rhs: {($ VSub_Number "$1")} spids: [427] ) ] spids: [427] ) (C {(shift)}) ] spids: [414 417 433 -1] ) (case_arm pat_list: [ {(--term-good) (Lit_Other "=") (Lit_Other "*")} {(--term-old) (Lit_Other "=") (Lit_Other "*")} ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:must_write_terms) op: Equal rhs: {(1)} spids: [446] ) ] spids: [446] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:TERM_GOOD) op: Equal rhs: { (BracedVarSub token: suffix_op: (StringUnary op_id:VOp1_Pound arg_word:{("*=")}) spids: [451 455] ) } spids: [450] ) ] spids: [450] ) (C {(shift)}) ] spids: [436 443 460 -1] ) (case_arm pat_list: [{(--term-bad)} {(--term-new)}] action: [ (C {(shift)}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:must_write_terms) op: Equal rhs: {(1)} spids: [472] ) ] spids: [472] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:TERM_BAD) op: Equal rhs: {($ VSub_Number "$1")} spids: [476] ) ] spids: [476] ) (C {(shift)}) ] spids: [463 466 482 -1] ) (case_arm pat_list: [ {(--term-bad) (Lit_Other "=") (Lit_Other "*")} {(--term-new) (Lit_Other "=") (Lit_Other "*")} ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:must_write_terms) op: Equal rhs: {(1)} spids: [495] ) ] spids: [495] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:TERM_BAD) op: Equal rhs: { (BracedVarSub token: suffix_op: (StringUnary op_id:VOp1_Pound arg_word:{("*=")}) spids: [500 504] ) } spids: [499] ) ] spids: [499] ) (C {(shift)}) ] spids: [485 492 509 -1] ) (case_arm pat_list: [{(--) (Lit_Other "*")}] action: [ (C {(die)} { (DQ (CommandSubPart command_list: (CommandList children: [ (C {(eval_gettext)} { (DQ ("unrecognised option: '") (EscapedLiteralPart token: ) ("arg'") ) } ) ] ) left_token: spids: [520 528] ) ) } ) ] spids: [512 514 531 -1] ) (case_arm pat_list: [{(Lit_Other "*")}] action: [ (AndOr children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:rev) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (C {(git)} {(rev-parse)} {(-q)} {(--verify)} {(DQ ($ VSub_Name "$arg") ("^{commit}"))} ) ] ) left_token: spids: [539 552] ) } spids: [538] ) ] spids: [538] ) (BraceGroup children: [ (AndOr children: [ (C {(test)} {($ VSub_Name "$has_double_dash")} {(-eq)} {(1)}) (C {(die)} { (DQ (CommandSubPart command_list: (CommandList children: [ (C {(eval_gettext)} { (DQ ("'") (EscapedLiteralPart token: ) ("arg' does not appear to be a valid revision") ) } ) ] ) left_token: spids: [573 581] ) ) } ) ] op_id: Op_DAmp ) (ControlFlow token: ) ] spids: [556] ) ] op_id: Op_DPipe ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:revs) op: Equal rhs: {(DQ ($ VSub_Name "$revs") (" ") ($ VSub_Name "$rev"))} spids: [591] ) ] spids: [591] ) (C {(shift)}) ] spids: [534 535 602 -1] ) ] spids: [379 385 605] ) ] spids: [370 608] ) ) (ForEach iter_name: rev iter_words: [{($ VSub_Name "$revs")}] do_arg_iter: False body: (DoGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:must_write_terms) op: Equal rhs: {(1)} spids: [644] ) ] spids: [644] ) (Case to_match: {($ VSub_Name "$bad_seen")} arms: [ (case_arm pat_list: [{(0)}] action: [ (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:state) op: Equal rhs: {($ VSub_Name "$TERM_BAD")} spids: [659] ) ] spids: [659] ) terminator: ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:bad_seen) op: Equal rhs: {(1)} spids: [664] ) ] spids: [664] ) ] spids: [656 657 667 -1] ) (case_arm pat_list: [{(Lit_Other "*")}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:state) op: Equal rhs: {($ VSub_Name "$TERM_GOOD")} spids: [673] ) ] spids: [673] ) ] spids: [670 671 676 -1] ) ] spids: [649 653 679] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:eval) op: Equal rhs: { (DQ ($ VSub_Name "$eval") (" bisect_write '") ($ VSub_Name "$state") ("' '") ($ VSub_Name "$rev") ("' 'nolog' &&") ) } spids: [682] ) ] spids: [682] ) ] spids: [621 693] ) spids: [617 -1] ) (AndOr children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:head) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (SimpleCommand words: [{(git)} {(symbolic-ref)} {(-q)} {(HEAD)}] more_env: [ (env_pair name: GIT_DIR val: {(DQ ($ VSub_Name "$GIT_DIR"))} spids: [710] ) ] ) ] ) left_token: spids: [709 722] ) } spids: [708] ) ] spids: [708] ) (AndOr children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:head) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (SimpleCommand words: [{(git)} {(rev-parse)} {(--verify)} {(HEAD)}] more_env: [ (env_pair name: GIT_DIR val: {(DQ ($ VSub_Name "$GIT_DIR"))} spids: [729] ) ] ) ] ) left_token: spids: [728 741] ) } spids: [727] ) ] spids: [727] ) (C {(die)} { (DQ (CommandSubPart command_list: (CommandList children: [(C {(gettext)} {(DQ ("Bad HEAD - I need a HEAD"))})] ) left_token: spids: [749 755] ) ) } ) ] op_id: Op_DPipe ) ] op_id: Op_DPipe ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:start_head) op:Equal rhs:{(SQ )} spids:[772])] spids: [772] ) (If arms: [ (if_arm cond: [(C {(test)} {(-s)} {(DQ ($ VSub_Name "$GIT_DIR") (/BISECT_START))})] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:start_head) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (C {(cat)} {(DQ ($ VSub_Name "$GIT_DIR") (/BISECT_START))}) ] ) left_token: spids: [797 804] ) } spids: [796] ) ] spids: [796] ) (If arms: [ (if_arm cond: [ (C {(test)} {(DQ (z) ($ VSub_Name "$mode"))} {(KW_Bang "!") (Lit_Other "=")} {(DQ (z--no-checkout))} ) ] action: [ (AndOr children: [ (C {(git)} {(checkout)} {(DQ ($ VSub_Name "$start_head"))} {(--)}) (C {(die)} { (DQ (CommandSubPart command_list: (CommandList children: [ (C {(eval_gettext)} { (DQ ("Checking out '") (EscapedLiteralPart token: ) ("start_head' failed. Try 'git bisect reset '.") ) } ) ] ) left_token: spids: [843 851] ) ) } ) ] op_id: Op_DPipe ) ] spids: [-1 824] ) ] spids: [-1 855] ) ] spids: [-1 789] ) ] else_action: [ (Case to_match: {(DQ ($ VSub_Name "$head"))} arms: [ (case_arm pat_list: [{(refs/heads/) (Lit_Other "*")} {($ VSub_Name "$_x40")}] action: [ (AndOr children: [ (C {(Lit_Other "[")} {(-s)} {(DQ ($ VSub_Name "$GIT_DIR") (/head-name))} {(Lit_Other "]")} ) (C {(die)} { (DQ (CommandSubPart command_list: (CommandList children: [ (C {(gettext)} {(DQ ("won't bisect on cg-seek'ed tree"))}) ] ) left_token: spids: [910 916] ) ) } ) ] op_id: Op_DAmp ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:start_head) op: Equal rhs: { (DQ (BracedVarSub token: suffix_op: (StringUnary op_id: VOp1_Pound arg_word: {(refs) (Lit_Slash /) (heads) (Lit_Slash /)} ) spids: [922 929] ) ) } spids: [920] ) ] spids: [920] ) ] spids: [874 878 933 -1] ) (case_arm pat_list: [{(Lit_Other "*")}] action: [ (C {(die)} { (DQ (CommandSubPart command_list: (CommandList children: [ (C {(gettext)} {(DQ ("Bad HEAD - strange symbolic ref"))}) ] ) left_token: spids: [943 949] ) ) } ) ] spids: [936 937 953 -1] ) ] spids: [865 871 956] ) ] spids: [858 959] ) (AndOr children:[(C {(bisect_clean_state)})(C {(exit)})] op_id:Op_DPipe) (C {(trap)} {(SQ )} {(0)}) (C {(trap)} {(SQ <"exit 255">)} {(1)} {(2)} {(3)} {(15)}) (AndOr children: [ (SimpleCommand words: [{(echo)} {(DQ ($ VSub_Name "$start_head"))}] redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {(DQ ($ VSub_Name "$GIT_DIR") (/BISECT_START))} spids: [1054] ) ] ) (AndOr children: [ (BraceGroup children: [ (AndOr children: [ (C {(test)} {(DQ (z) ($ VSub_Name "$mode"))} {(KW_Bang "!") (Lit_Other "=")} {(DQ (z--no-checkout))} ) (C {(git)} {(update-ref)} {(--no-deref)} {(BISECT_HEAD)} {(DQ ($ VSub_Name "$start_head"))} ) ] op_id: Op_DPipe ) ] spids: [1062] ) (AndOr children: [ (SimpleCommand words: [{(git)} {(rev-parse)} {(--sq-quote)} {(DQ ($ VSub_At "$@"))}] redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {(DQ ($ VSub_Name "$GIT_DIR") (/BISECT_NAMES))} spids: [1110] ) ] ) (AndOr children: [ (C {(eval)} {(DQ ($ VSub_Name "$eval") (" true"))}) (AndOr children: [ (If arms: [ (if_arm cond: [ (C {(test)} {($ VSub_Name "$must_write_terms")} {(-eq)} {(1)}) ] action: [ (C {(write_terms)} {(DQ ($ VSub_Name "$TERM_BAD"))} {(DQ ($ VSub_Name "$TERM_GOOD"))} ) ] spids: [-1 1140] ) ] spids: [-1 1154] ) (AndOr children: [ (SimpleCommand words: [ {(echo)} {(DQ ("git bisect start") ($ VSub_Name "$orig_args"))} ] redirects: [ (Redir op_id: Redir_DGreat fd: -1 arg_word: {(DQ ($ VSub_Name "$GIT_DIR") (/BISECT_LOG))} spids: [1166] ) ] ) (C {(exit)}) ] op_id: Op_DPipe ) ] op_id: Op_DAmp ) ] op_id: Op_DAmp ) ] op_id: Op_DAmp ) ] op_id: Op_DAmp ) ] op_id: Op_DAmp ) (C {(bisect_auto_next)}) (C {(trap)} {(SQ <->)} {(0)}) ] spids: [234] ) spids: [230 233] ) (FuncDef name: bisect_write body: (BraceGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:state) op: Equal rhs: {(DQ ($ VSub_Number "$1"))} spids: [1211] ) ] spids: [1211] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:rev) op: Equal rhs: {(DQ ($ VSub_Number "$2"))} spids: [1217] ) ] spids: [1217] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:nolog) op: Equal rhs: {(DQ ($ VSub_Number "$3"))} spids: [1223] ) ] spids: [1223] ) (Case to_match: {(DQ ($ VSub_Name "$state"))} arms: [ (case_arm pat_list: [{(DQ ($ VSub_Name "$TERM_BAD"))}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:tag) op: Equal rhs: {(DQ ($ VSub_Name "$state"))} spids: [1244] ) ] spids: [1244] ) ] spids: [1239 1241 1249 -1] ) (case_arm pat_list: [{(DQ ($ VSub_Name "$TERM_GOOD"))} {(skip)}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:tag) op: Equal rhs: {(DQ ($ VSub_Name "$state")) (-) (DQ ($ VSub_Name "$rev"))} spids: [1260] ) ] spids: [1260] ) ] spids: [1253 1257 1269 -1] ) (case_arm pat_list: [{(Lit_Other "*")}] action: [ (C {(die)} { (DQ (CommandSubPart command_list: (CommandList children: [ (C {(eval_gettext)} { (DQ ("Bad bisect_write argument: ") (EscapedLiteralPart token: ) (state) ) } ) ] ) left_token: spids: [1279 1287] ) ) } ) ] spids: [1272 1273 1290 -1] ) ] spids: [1229 1235 1293] ) (AndOr children: [ (C {(git)} {(update-ref)} {(DQ (refs/bisect/) ($ VSub_Name "$tag"))} {(DQ ($ VSub_Name "$rev"))} ) (C {(exit)}) ] op_id: Op_DPipe ) (SimpleCommand words: [ {(echo)} { (DQ ("# ") ($ VSub_Name "$state") (": ") (CommandSubPart command_list: (CommandList children: [(C {(git)} {(show-branch)} {($ VSub_Name "$rev")})] ) left_token: spids: [1320 1326] ) ) } ] redirects: [ (Redir op_id: Redir_DGreat fd: -1 arg_word: {(DQ ($ VSub_Name "$GIT_DIR") (/BISECT_LOG))} spids: [1329] ) ] ) (AndOr children: [ (C {(test)} {(-n)} {(DQ ($ VSub_Name "$nolog"))}) (SimpleCommand words: [ {(echo)} {(DQ ("git bisect ") ($ VSub_Name "$state") (" ") ($ VSub_Name "$rev"))} ] redirects: [ (Redir op_id: Redir_DGreat fd: -1 arg_word: {(DQ ($ VSub_Name "$GIT_DIR") (/BISECT_LOG))} spids: [1355] ) ] ) ] op_id: Op_DPipe ) ] spids: [1208] ) spids: [1204 1207] ) (FuncDef name: is_expected_rev body: (BraceGroup children: [ (AndOr children: [ (C {(test)} {(-f)} {(DQ ($ VSub_Name "$GIT_DIR") (/BISECT_EXPECTED_REV))}) (C {(test)} {(DQ ($ VSub_Number "$1"))} {(Lit_Other "=")} { (CommandSubPart command_list: (CommandList children: [(C {(cat)} {(DQ ($ VSub_Name "$GIT_DIR") (/BISECT_EXPECTED_REV))})] ) left_token: spids: [1391 1398] ) } ) ] op_id: Op_DAmp ) ] spids: [1368] ) spids: [1364 1367] ) (FuncDef name: check_expected_revs body: (BraceGroup children: [ (ForEach iter_name: _rev iter_words: [{(DQ ($ VSub_At "$@"))}] do_arg_iter: False body: (DoGroup children: [ (If arms: [ (if_arm cond: [ (Pipeline children: [(C {(is_expected_rev)} {(DQ ($ VSub_Name "$_rev"))})] negated: True ) ] action: [ (C {(rm)} {(-f)} {(DQ ($ VSub_Name "$GIT_DIR") (/BISECT_ANCESTORS_OK))}) (C {(rm)} {(-f)} {(DQ ($ VSub_Name "$GIT_DIR") (/BISECT_EXPECTED_REV))}) (ControlFlow token: ) ] spids: [-1 1435] ) ] spids: [-1 1461] ) ] spids: [1421 1464] ) spids: [1415 1419] ) ] spids: [1407] ) spids: [1403 1406] ) (FuncDef name: bisect_skip body: (BraceGroup children: [ (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:all) op:Equal rhs:{(SQ )} spids:[1476])] spids: [1476] ) (ForEach iter_name: arg iter_words: [{(DQ ($ VSub_At "$@"))}] do_arg_iter: False body: (DoGroup children: [ (Case to_match: {(DQ ($ VSub_Name "$arg"))} arms: [ (case_arm pat_list: [{(Lit_Other "*") (..) (Lit_Other "*")}] action: [ (AndOr children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:revs) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (C {(git)} {(rev-list)} {(DQ ($ VSub_Name "$arg"))}) ] ) left_token: spids: [1511 1519] ) } spids: [1510] ) ] spids: [1510] ) (C {(die)} { (DQ (CommandSubPart command_list: (CommandList children: [ (C {(eval_gettext)} { (DQ ("Bad rev input: ") (EscapedLiteralPart token: ) (arg) ) } ) ] ) left_token: spids: [1526 1534] ) ) } ) ] op_id: Op_DPipe ) ] spids: [1504 1507 1537 -1] ) (case_arm pat_list: [{(Lit_Other "*")}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:revs) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (C {(git)} {(rev-parse)} {(--sq-quote)} {(DQ ($ VSub_Name "$arg"))} ) ] ) left_token: spids: [1545 1555] ) } spids: [1544] ) ] spids: [1544] ) ] spids: [1540 1541 1557 -1] ) ] spids: [1495 1501 1560] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:all) op: Equal rhs: {(DQ ($ VSub_Name "$all") (" ") ($ VSub_Name "$revs"))} spids: [1563] ) ] spids: [1563] ) ] spids: [1492 1571] ) spids: [1486 -1] ) (C {(eval)} {(bisect_state)} {(SQ )} {($ VSub_Name "$all")}) ] spids: [1473] ) spids: [1469 1472] ) (FuncDef name: bisect_state body: (BraceGroup children: [ (C {(bisect_autostart)}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:state) op: Equal rhs: {($ VSub_Number "$1")} spids: [1597] ) ] spids: [1597] ) (C {(check_and_set_terms)} {($ VSub_Name "$state")}) (Case to_match: {(DQ ($ VSub_Pound "$#") (",") ($ VSub_Name "$state"))} arms: [ (case_arm pat_list: [{(0) (Lit_Comma ",") (Lit_Other "*")}] action: [(C {(die)} {(DQ ("Please call 'bisect_state' with at least one argument."))})] spids: [1617 1620 1629 -1] ) (case_arm pat_list: [ {(1) (Lit_Comma ",") (DQ ($ VSub_Name "$TERM_BAD"))} {(1) (Lit_Comma ",") (DQ ($ VSub_Name "$TERM_GOOD"))} {(1) (Lit_Comma ",") (skip)} ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:bisected_head) op: Equal rhs: { (CommandSubPart command_list: (CommandList children:[(C {(bisect_head)})]) left_token: spids: [1651 1653] ) } spids: [1650] ) ] spids: [1650] ) (AndOr children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:rev) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (C {(git)} {(rev-parse)} {(--verify)} {(DQ ($ VSub_Name "$bisected_head"))} ) ] ) left_token: spids: [1657 1667] ) } spids: [1656] ) ] spids: [1656] ) (C {(die)} { (DQ (CommandSubPart command_list: (CommandList children: [ (C {(eval_gettext)} { (DQ ("Bad rev input: ") (EscapedLiteralPart token: ) (bisected_head) ) } ) ] ) left_token: spids: [1675 1683] ) ) } ) ] op_id: Op_DPipe ) (C {(bisect_write)} {(DQ ($ VSub_Name "$state"))} {(DQ ($ VSub_Name "$rev"))}) (C {(check_expected_revs)} {(DQ ($ VSub_Name "$rev"))}) ] spids: [1632 1647 1704 -1] ) (case_arm pat_list: [ {(2) (Lit_Comma ",") (DQ ($ VSub_Name "$TERM_BAD"))} {(Lit_Other "*") (Lit_Comma ",") (DQ ($ VSub_Name "$TERM_GOOD"))} {(Lit_Other "*") (Lit_Comma ",") (skip)} ] action: [ (C {(shift)}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:hash_list) op: Equal rhs: {(SQ )} spids: [1728] ) ] spids: [1728] ) (ForEach iter_name: rev iter_words: [{(DQ ($ VSub_At "$@"))}] do_arg_iter: False body: (DoGroup children: [ (AndOr children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:sha) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (C {(git)} {(rev-parse)} {(--verify)} {(DQ ($ VSub_Name "$rev") ("^{commit}"))} ) ] ) left_token: spids: [1748 1759] ) } spids: [1747] ) ] spids: [1747] ) (C {(die)} { (DQ (CommandSubPart command_list: (CommandList children: [ (C {(eval_gettext)} { (DQ ("Bad rev input: ") (EscapedLiteralPart token: ) (rev) ) } ) ] ) left_token: spids: [1767 1775] ) ) } ) ] op_id: Op_DPipe ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:hash_list) op: Equal rhs: {(DQ ($ VSub_Name "$hash_list") (" ") ($ VSub_Name "$sha"))} spids: [1779] ) ] spids: [1779] ) ] spids: [1744 1787] ) spids: [1738 -1] ) (ForEach iter_name: rev iter_words: [{($ VSub_Name "$hash_list")}] do_arg_iter: False body: (DoGroup children: [ (C {(bisect_write)} {(DQ ($ VSub_Name "$state"))} {(DQ ($ VSub_Name "$rev"))}) ] spids: [1799 1813] ) spids: [1795 -1] ) (C {(check_expected_revs)} {($ VSub_Name "$hash_list")}) ] spids: [1707 1722 1820 -1] ) (case_arm pat_list: [{(Lit_Other "*") (Lit_Comma ",") (DQ ($ VSub_Name "$TERM_BAD"))}] action: [ (C {(die)} { (DQ (CommandSubPart command_list: (CommandList children: [ (C {(eval_gettext)} { (DQ ("'git bisect ") (EscapedLiteralPart token: ) ("TERM_BAD' can take only one argument.") ) } ) ] ) left_token: spids: [1834 1842] ) ) } ) ] spids: [1823 1828 1845 -1] ) (case_arm pat_list: [{(Lit_Other "*")}] action: [(C {(usage)})] spids: [1848 1849 1854 -1] ) ] spids: [1606 1614 1857] ) (C {(bisect_auto_next)}) ] spids: [1591] ) spids: [1587 1590] ) (FuncDef name: bisect_next_check body: (BraceGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:missing_good) op: Equal rhs: {(SQ )} spids: [1872] ) (assign_pair lhs: (LhsName name:missing_bad) op: Equal rhs: {(SQ )} spids: [1874] ) ] spids: [1872] ) (AndOr children: [ (C {(git)} {(show-ref)} {(-q)} {(--verify)} {(refs/bisect/) ($ VSub_Name "$TERM_BAD")}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:missing_bad) op: Equal rhs: {(t)} spids: [1890] ) ] spids: [1890] ) ] op_id: Op_DPipe ) (AndOr children: [ (C {(test)} {(-n)} { (DQ (CommandSubPart command_list: (CommandList children: [ (C {(git)} {(for-each-ref)} {(DQ (refs/bisect/) ($ VSub_Name "$TERM_GOOD") ("-*"))} ) ] ) left_token: spids: [1899 1909] ) ) } ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:missing_good) op: Equal rhs: {(t)} spids: [1914] ) ] spids: [1914] ) ] op_id: Op_DPipe ) (Case to_match: { (DQ ($ VSub_Name "$missing_good") (",") ($ VSub_Name "$missing_bad") (",") ($ VSub_Number "$1") ) } arms: [ (case_arm pat_list: [{(Lit_Comma ",") (Lit_Comma ",") (Lit_Other "*")}] action: [ (C {(Lit_Other ":")} {(have)} {(both)} {($ VSub_Name "$TERM_GOOD")} {(and)} {($ VSub_Name "$TERM_BAD")} {(-)} {(ok)} ) ] spids: [1932 1935 1955 -1] ) (case_arm pat_list: [{(Lit_Other "*") (Lit_Comma ",")}] action: [(C {(false)})] spids: [1958 1960 1970 -1] ) (case_arm pat_list: [{(t) (Lit_Comma ",") (Lit_Comma ",") (DQ ($ VSub_Name "$TERM_GOOD"))}] action: [ (SimpleCommand words: [ {(eval_gettextln)} { (DQ ("Warning: bisecting only with a ") (EscapedLiteralPart token: ) ("TERM_BAD commit.") ) } ] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[1998])] ) (If arms: [ (if_arm cond: [(C {(test)} {(-t)} {(0)})] action: [ (SimpleCommand words: [{(gettext)} {(DQ ("Are you sure [Y/n]? "))}] redirects: [ (Redir op_id: Redir_GreatAnd fd: -1 arg_word: {(2)} spids: [2032] ) ] ) (C {(read)} {(yesno)}) (Case to_match: {(DQ ($ VSub_Name "$yesno"))} arms: [ (case_arm pat_list: [{(Lit_Other "[") (Nn) (Lit_Other "]") (Lit_Other "*")}] action: [(C {(exit)} {(1)})] spids: [2049 2053 2059 -1] ) ] spids: [2041 2047 2061] ) ] spids: [-1 2011] ) ] spids: [-1 2064] ) (C {(Lit_Other ":")} {(bisect)} {(without)} {($ VSub_Name "$TERM_GOOD") (...)}) ] spids: [1973 1979 2077 -1] ) (case_arm pat_list: [{(Lit_Other "*")}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:bad_syn) op: Equal rhs: { (CommandSubPart command_list: (CommandList children:[(C {(bisect_voc)} {(bad)})]) left_token: spids: [2085 2089] ) } spids: [2084] ) ] spids: [2084] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:good_syn) op: Equal rhs: { (CommandSubPart command_list: (CommandList children:[(C {(bisect_voc)} {(good)})]) left_token: spids: [2093 2097] ) } spids: [2092] ) ] spids: [2092] ) (If arms: [ (if_arm cond: [(C {(test)} {(-s)} {(DQ ($ VSub_Name "$GIT_DIR") (/BISECT_START))})] action: [ (SimpleCommand words: [ {(eval_gettextln)} { (DQ ("You need to give me at least one ") (EscapedLiteralPart token: ) ("bad_syn and one ") (EscapedLiteralPart token:) ("good_syn revision.\n") ("(You can use ") (EscapedLiteralPart token:) ("git bisect ") (EscapedLiteralPart token: ) (bad_syn) (EscapedLiteralPart token:) (" and ") (EscapedLiteralPart token: ) ("git bisect ") (EscapedLiteralPart token:) (good_syn) (EscapedLiteralPart token: ) (" for that.)") ) } ] redirects: [ (Redir op_id: Redir_GreatAnd fd: -1 arg_word: {(2)} spids: [2139] ) ] ) ] spids: [-1 2112] ) ] else_action: [ (SimpleCommand words: [ {(eval_gettextln)} { (DQ ("You need to start by ") (EscapedLiteralPart token: ) ("git bisect start") (EscapedLiteralPart token:) (".\n") ("You then need to give me at least one ") (EscapedLiteralPart token:) ("good_syn and one ") (EscapedLiteralPart token: ) ("bad_syn revision.\n") ("(You can use ") (EscapedLiteralPart token:) ("git bisect ") (EscapedLiteralPart token:) (bad_syn) (EscapedLiteralPart token: ) (" and ") (EscapedLiteralPart token:) ("git bisect ") (EscapedLiteralPart token: ) (good_syn) (EscapedLiteralPart token:) (" for that.)") ) } ] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[2174])] ) ] spids: [2143 2178] ) (C {(exit)} {(1)}) ] spids: [2080 2081 2185 -1] ) ] spids: [1919 1929 2188] ) ] spids: [1869] ) spids: [1865 1868] ) (FuncDef name: bisect_auto_next body: (BraceGroup children: [ (AndOr children: [ (C {(bisect_next_check)}) (AndOr children: [(C {(bisect_next)}) (C {(Lit_Other ":")})] op_id: Op_DPipe ) ] op_id: Op_DAmp ) ] spids: [2197] ) spids: [2193 2196] ) (FuncDef name: bisect_next body: (BraceGroup children: [ (Case to_match: {(DQ ($ VSub_Pound "$#"))} arms: [ (case_arm pat_list:[{(0)}] spids:[222822292231-1]) (case_arm pat_list: [{(Lit_Other "*")}] action: [(C {(usage)})] spids: [2233 2234 2238 -1] ) ] spids: [2220 2226 2240] ) (C {(bisect_autostart)}) (C {(bisect_next_check)} {($ VSub_Name "$TERM_GOOD")}) (C {(git)} {(bisect--helper)} {(--next-all)} { (CommandSubPart command_list: (CommandList children: [ (AndOr children: [ (C {(test)} {(-f)} {(DQ ($ VSub_Name "$GIT_DIR") (/BISECT_HEAD))}) (C {(echo)} {(--no-checkout)}) ] op_id: Op_DAmp ) ] ) left_token: spids: [2262 2277] ) } ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:res) op: Equal rhs: {($ VSub_QMark "$?")} spids: [2280] ) ] spids: [2280] ) (If arms: [ (if_arm cond: [(C {(test)} {($ VSub_Name "$res")} {(-eq)} {(10)})] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:bad_rev) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (C {(git)} {(show-ref)} {(--hash)} {(--verify)} {(refs/bisect/) ($ VSub_Name "$TERM_BAD")} ) ] ) left_token: spids: [2304 2315] ) } spids: [2303] ) ] spids: [2303] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:bad_commit) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [(C {(git)} {(show-branch)} {($ VSub_Name "$bad_rev")})] ) left_token: spids: [2319 2325] ) } spids: [2318] ) ] spids: [2318] ) (SimpleCommand words: [ {(echo)} { (DQ ("# first ") ($ VSub_Name "$TERM_BAD") (" commit: ") ($ VSub_Name "$bad_commit") ) } ] redirects: [ (Redir op_id: Redir_DGreat fd: -1 arg_word: {(DQ ($ VSub_Name "$GIT_DIR") (/BISECT_LOG))} spids: [2337] ) ] ) (C {(exit)} {(0)}) ] spids: [-1 2300] ) (if_arm cond: [(C {(test)} {($ VSub_Name "$res")} {(-eq)} {(2)})] action: [ (SimpleCommand words: [{(echo)} {(DQ ("# only skipped commits left to test"))}] redirects: [ (Redir op_id: Redir_DGreat fd: -1 arg_word: {(DQ ($ VSub_Name "$GIT_DIR") (/BISECT_LOG))} spids: [2369] ) ] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:good_revs) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (C {(git)} {(for-each-ref)} {(--format) (Lit_Other "=") (DQ ("%(objectname)"))} {(DQ (refs/bisect/) ($ VSub_Name "$TERM_GOOD") ("-*"))} ) ] ) left_token: spids: [2377 2393] ) } spids: [2376] ) ] spids: [2376] ) (ForEach iter_name: skipped iter_words: [ { (CommandSubPart command_list: (CommandList children: [ (C {(git)} {(rev-list)} {(refs/bisect/) ($ VSub_Name "$TERM_BAD")} {(--not)} {($ VSub_Name "$good_revs")} ) ] ) left_token: spids: [2402 2413] ) } ] do_arg_iter: False body: (DoGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:skipped_commit) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (C {(git)} {(show-branch)} {($ VSub_Name "$skipped")}) ] ) left_token: spids: [2420 2426] ) } spids: [2419] ) ] spids: [2419] ) (SimpleCommand words: [ {(echo)} { (DQ ("# possible first ") ($ VSub_Name "$TERM_BAD") (" commit: ") ($ VSub_Name "$skipped_commit") ) } ] redirects: [ (Redir op_id: Redir_DGreat fd: -1 arg_word: {(DQ ($ VSub_Name "$GIT_DIR") (/BISECT_LOG))} spids: [2438] ) ] ) ] spids: [2416 2445] ) spids: [2401 -1] ) (C {(exit)} {($ VSub_Name "$res")}) ] spids: [2349 2360] ) ] spids: [-1 2453] ) (AndOr children: [ (C {(test)} {($ VSub_Name "$res")} {(-ne)} {(0)}) (C {(exit)} {($ VSub_Name "$res")}) ] op_id: Op_DAmp ) (ControlFlow token: arg_word:{(0)}) ] spids: [2217] ) spids: [2213 2216] ) (FuncDef name: bisect_visualize body: (BraceGroup children: [ (C {(bisect_next_check)} {(fail)}) (If arms: [ (if_arm cond: [(C {(test)} {($ VSub_Pound "$#")} {(Lit_Other "=")} {(0)})] action: [ (If arms: [ (if_arm cond: [ (AndOr children: [ (C {(test)} {(-n)} { (DQ (BracedVarSub token: suffix_op: (StringUnary op_id:VTest_Plus arg_word:{(set)}) spids: [2518 2522] ) (BracedVarSub token: suffix_op: (StringUnary op_id:VTest_Plus arg_word:{(set)}) spids: [2523 2527] ) (BracedVarSub token: suffix_op: (StringUnary op_id:VTest_Plus arg_word:{(set)}) spids: [2528 2532] ) (BracedVarSub token: suffix_op: (StringUnary op_id:VTest_Plus arg_word:{(set)}) spids: [2533 2537] ) ) } ) (SimpleCommand words: [{(type)} {(gitk)}] redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {(/dev/null)} spids: [2547] ) (Redir op_id: Redir_GreatAnd fd: 2 arg_word: {(1)} spids: [2550] ) ] ) ] op_id: Op_DAmp ) ] action: [(C {(set)} {(gitk)})] spids: [-1 2554] ) ] else_action: [(C {(set)} {(git)} {(log)})] spids: [2562 2572] ) ] spids: [-1 2508] ) ] else_action: [ (Case to_match: {(DQ ($ VSub_Number "$1"))} arms: [ (case_arm pat_list: [{(git) (Lit_Other "*")} {(tig)}] spids: [2587 2591 2593 -1] ) (case_arm pat_list: [{(-) (Lit_Other "*")}] action: [(C {(set)} {(git)} {(log)} {(DQ ($ VSub_At "$@"))})] spids: [2596 2598 2610 -1] ) (case_arm pat_list: [{(Lit_Other "*")}] action: [(C {(set)} {(git)} {(DQ ($ VSub_At "$@"))})] spids: [2613 2614 2624 -1] ) ] spids: [2578 2584 2627] ) ] spids: [2575 2630] ) (C {(eval)} {(SQ <"\"$@\"">)} {(--bisect)} {(--)} { (CommandSubPart command_list: (CommandList children: [(C {(cat)} {(DQ ($ VSub_Name "$GIT_DIR") (/BISECT_NAMES))})] ) left_token: spids: [2644 2651] ) } ) ] spids: [2488] ) spids: [2484 2487] ) (FuncDef name: bisect_reset body: (BraceGroup children: [ (AndOr children: [ (C {(test)} {(-s)} {(DQ ($ VSub_Name "$GIT_DIR") (/BISECT_START))}) (BraceGroup children: [ (C {(gettextln)} {(DQ ("We are not bisecting."))}) (ControlFlow token:) ] spids: [2674] ) ] op_id: Op_DPipe ) (Case to_match: {(DQ ($ VSub_Pound "$#"))} arms: [ (case_arm pat_list: [{(0)}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:branch) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (C {(cat)} {(DQ ($ VSub_Name "$GIT_DIR") (/BISECT_START))}) ] ) left_token: spids: [2703 2710] ) } spids: [2702] ) ] spids: [2702] ) ] spids: [2699 2700 2712 -1] ) (case_arm pat_list: [{(1)}] action: [ (AndOr children: [ (SimpleCommand words: [ {(git)} {(rev-parse)} {(--quiet)} {(--verify)} {(DQ ($ VSub_Number "$1") ("^{commit}"))} ] redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {(/dev/null)} spids: [2731] ) ] ) (BraceGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:invalid) op: Equal rhs: {(DQ ($ VSub_Number "$1"))} spids: [2739] ) ] spids: [2739] ) (C {(die)} { (DQ (CommandSubPart command_list: (CommandList children: [ (C {(eval_gettext)} { (DQ ("'") (EscapedLiteralPart token: ) ("invalid' is not a valid commit") ) } ) ] ) left_token: spids: [2748 2756] ) ) } ) ] spids: [2736] ) ] op_id: Op_DPipe ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:branch) op: Equal rhs: {(DQ ($ VSub_Number "$1"))} spids: [2763] ) ] spids: [2763] ) ] spids: [2715 2716 2768 -1] ) (case_arm pat_list: [{(Lit_Other "*")}] action: [(C {(usage)})] spids: [2771 2772 2777 -1] ) ] spids: [2690 2696 2780] ) (If arms: [ (if_arm cond: [ (AndOr children: [ (Pipeline children: [(C {(test)} {(-f)} {(DQ ($ VSub_Name "$GIT_DIR") (/BISECT_HEAD))})] negated: True ) (Pipeline children: [(C {(git)} {(checkout)} {(DQ ($ VSub_Name "$branch"))} {(--)})] negated: True ) ] op_id: Op_DAmp ) ] action: [ (C {(die)} { (DQ (CommandSubPart command_list: (CommandList children: [ (C {(eval_gettext)} { (DQ ("Could not check out original HEAD '") (EscapedLiteralPart token: ) ("branch'.\n") ("Try 'git bisect reset '.") ) } ) ] ) left_token: spids: [2818 2827] ) ) } ) ] spids: [-1 2812] ) ] spids: [-1 2831] ) (C {(bisect_clean_state)}) ] spids: [2660] ) spids: [2656 2659] ) (FuncDef name: bisect_clean_state body: (BraceGroup children: [ (Pipeline children: [ (C {(git)} {(for-each-ref)} {(--format) (Lit_Other "=") (SQ <"%(refname) %(objectname)">)} {(refs/bisect/) (EscapedLiteralPart token:)} ) (While cond: [(C {(read)} {(ref)} {(hash)})] body: (DoGroup children: [ (AndOr children: [ (C {(git)} {(update-ref)} {(-d)} {($ VSub_Name "$ref")} {($ VSub_Name "$hash")} ) (C {(exit)}) ] op_id: Op_DPipe ) ] spids: [2875 2893] ) ) ] negated: False ) (AndOr children: [ (C {(rm)} {(-f)} {(DQ ($ VSub_Name "$GIT_DIR") (/BISECT_EXPECTED_REV))}) (AndOr children: [ (C {(rm)} {(-f)} {(DQ ($ VSub_Name "$GIT_DIR") (/BISECT_ANCESTORS_OK))}) (AndOr children: [ (C {(rm)} {(-f)} {(DQ ($ VSub_Name "$GIT_DIR") (/BISECT_LOG))}) (AndOr children: [ (C {(rm)} {(-f)} {(DQ ($ VSub_Name "$GIT_DIR") (/BISECT_NAMES))}) (AndOr children: [ (C {(rm)} {(-f)} {(DQ ($ VSub_Name "$GIT_DIR") (/BISECT_RUN))}) (AndOr children: [ (C {(rm)} {(-f)} {(DQ ($ VSub_Name "$GIT_DIR") (/BISECT_TERMS))}) (AndOr children: [ (C {(rm)} {(-f)} {(DQ ($ VSub_Name "$GIT_DIR") (/head-name))}) (AndOr children: [ (C {(git)} {(update-ref)} {(-d)} {(--no-deref)} {(BISECT_HEAD)} ) (C {(rm)} {(-f)} {(DQ ($ VSub_Name "$GIT_DIR") (/BISECT_START))} ) ] op_id: Op_DAmp ) ] op_id: Op_DAmp ) ] op_id: Op_DAmp ) ] op_id: Op_DAmp ) ] op_id: Op_DAmp ) ] op_id: Op_DAmp ) ] op_id: Op_DAmp ) ] op_id: Op_DAmp ) ] spids: [2843] ) spids: [2839 2842] ) (FuncDef name: bisect_replay body: (BraceGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:file) op: Equal rhs: {(DQ ($ VSub_Number "$1"))} spids: [3021] ) ] spids: [3021] ) (AndOr children: [ (C {(test)} {(DQ ($ VSub_Pound "$#"))} {(-eq)} {(1)}) (C {(die)} { (DQ (CommandSubPart command_list: (CommandList children: [(C {(gettext)} {(DQ ("No logfile given"))})] ) left_token: spids: [3042 3048] ) ) } ) ] op_id: Op_DPipe ) (AndOr children: [ (C {(test)} {(-r)} {(DQ ($ VSub_Name "$file"))}) (C {(die)} { (DQ (CommandSubPart command_list: (CommandList children: [ (C {(eval_gettext)} { (DQ ("cannot read ") (EscapedLiteralPart token: ) ("file for replaying") ) } ) ] ) left_token: spids: [3065 3073] ) ) } ) ] op_id: Op_DPipe ) (C {(bisect_reset)}) (While cond: [(C {(read)} {(git)} {(bisect)} {(command)} {(rev)})] body: (DoGroup children: [ (AndOr children: [ (C {(test)} {(DQ ($ VSub_Name "$git") (" ") ($ VSub_Name "$bisect"))} {(Lit_Other "=")} {(DQ ("git bisect"))} ) (AndOr children: [ (C {(test)} {(DQ ($ VSub_Name "$git"))} {(Lit_Other "=")} {(DQ (git-bisect))}) (ControlFlow token: ) ] op_id: Op_DPipe ) ] op_id: Op_DPipe ) (If arms: [ (if_arm cond: [ (C {(test)} {(DQ ($ VSub_Name "$git"))} {(Lit_Other "=")} {(DQ (git-bisect))}) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:rev) op: Equal rhs: {(DQ ($ VSub_Name "$command"))} spids: [3147] ) ] spids: [3147] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:command) op: Equal rhs: {(DQ ($ VSub_Name "$bisect"))} spids: [3153] ) ] spids: [3153] ) ] spids: [-1 3144] ) ] spids: [-1 3159] ) (C {(get_terms)}) (C {(check_and_set_terms)} {(DQ ($ VSub_Name "$command"))}) (Case to_match: {(DQ ($ VSub_Name "$command"))} arms: [ (case_arm pat_list: [{(start)}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:cmd) op: Equal rhs: {(DQ ("bisect_start ") ($ VSub_Name "$rev"))} spids: [3185] ) ] spids: [3185] ) (C {(eval)} {(DQ ($ VSub_Name "$cmd"))}) ] spids: [3181 3182 3198 -1] ) (case_arm pat_list: [ {(DQ ($ VSub_Name "$TERM_GOOD"))} {(DQ ($ VSub_Name "$TERM_BAD"))} {(skip)} ] action: [ (C {(bisect_write)} {(DQ ($ VSub_Name "$command"))} {(DQ ($ VSub_Name "$rev"))} ) ] spids: [3202 3210 3223 -1] ) (case_arm pat_list: [{(terms)}] action: [(C {(bisect_terms)} {($ VSub_Name "$rev")})] spids: [3226 3227 3234 -1] ) (case_arm pat_list: [{(Lit_Other "*")}] action: [ (C {(die)} { (DQ (CommandSubPart command_list: (CommandList children: [ (C {(gettext)} {(DQ ("?? what are you talking about?"))}) ] ) left_token: spids: [3244 3250] ) ) } ) ] spids: [3237 3238 3253 -1] ) ] spids: [3172 3178 3256] ) ] spids: [3093 3259] ) redirects: [ (Redir op_id: Redir_Less fd: -1 arg_word: {(DQ ($ VSub_Name "$file"))} spids: [3261] ) ] ) (C {(bisect_auto_next)}) ] spids: [3018] ) spids: [3013 3017] ) (FuncDef name: bisect_run body: (BraceGroup children: [ (C {(bisect_next_check)} {(fail)}) (While cond: [(C {(true)})] body: (DoGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:command) op: Equal rhs: {(DQ ($ VSub_At "$@"))} spids: [3294] ) ] spids: [3294] ) (C {(eval_gettextln)} { (DQ ("running ") (EscapedLiteralPart token:) (command)) } ) (C {(DQ ($ VSub_At "$@"))}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:res) op: Equal rhs: {($ VSub_QMark "$?")} spids: [3314] ) ] spids: [3314] ) (If arms: [ (if_arm cond: [ (C {(Lit_Other "[")} {($ VSub_Name "$res")} {(-lt)} {(0)} {(-o)} {($ VSub_Name "$res")} {(-ge)} {(128)} {(Lit_Other "]")} ) ] action: [ (SimpleCommand words: [ {(eval_gettextln)} { (DQ ("bisect run failed:\n") ("exit code ") (EscapedLiteralPart token: ) ("res from '") (EscapedLiteralPart token:) ("command' is < 0 or >= 128") ) } ] redirects: [ (Redir op_id: Redir_GreatAnd fd: -1 arg_word: {(2)} spids: [3358] ) ] ) (C {(exit)} {($ VSub_Name "$res")}) ] spids: [-1 3344] ) ] spids: [-1 3367] ) (If arms: [ (if_arm cond: [ (C {(Lit_Other "[")} {($ VSub_Name "$res")} {(-eq)} {(125)} {(Lit_Other "]")}) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:state) op: Equal rhs: {(SQ )} spids: [3395] ) ] spids: [3395] ) ] spids: [-1 3392] ) (if_arm cond: [ (C {(Lit_Other "[")} {($ VSub_Name "$res")} {(-gt)} {(0)} {(Lit_Other "]")}) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:state) op: Equal rhs: {(DQ ($ VSub_Name "$TERM_BAD"))} spids: [3417] ) ] spids: [3417] ) ] spids: [3401 3414] ) ] else_action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:state) op: Equal rhs: {(DQ ($ VSub_Name "$TERM_GOOD"))} spids: [3426] ) ] spids: [3426] ) ] spids: [3423 3432] ) (Subshell child: (SimpleCommand words: [{(bisect_state)} {($ VSub_Name "$state")}] redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {(DQ ($ VSub_Name "$GIT_DIR") (/BISECT_RUN))} spids: [3446] ) ] ) spids: [3440 3452] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:res) op: Equal rhs: {($ VSub_QMark "$?")} spids: [3455] ) ] spids: [3455] ) (C {(cat)} {(DQ ($ VSub_Name "$GIT_DIR") (/BISECT_RUN))}) (If arms: [ (if_arm cond: [ (SimpleCommand words: [ {(sane_grep)} { (DQ ("first ") ($ VSub_Name "$TERM_BAD") (" commit could be any of")) } {(DQ ($ VSub_Name "$GIT_DIR") (/BISECT_RUN))} ] redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {(/dev/null)} spids: [3486] ) ] ) ] action: [ (SimpleCommand words: [{(gettextln)} {(DQ ("bisect run cannot continue any more"))}] redirects: [ (Redir op_id: Redir_GreatAnd fd: -1 arg_word: {(2)} spids: [3499] ) ] ) (C {(exit)} {($ VSub_Name "$res")}) ] spids: [-1 3490] ) ] spids: [-1 3508] ) (If arms: [ (if_arm cond: [ (C {(Lit_Other "[")} {($ VSub_Name "$res")} {(-ne)} {(0)} {(Lit_Other "]")}) ] action: [ (SimpleCommand words: [ {(eval_gettextln)} { (DQ ("bisect run failed:\n") ("'bisect_state ") (EscapedLiteralPart token: ) ("state' exited with error code ") (EscapedLiteralPart token:) (res) ) } ] redirects: [ (Redir op_id: Redir_GreatAnd fd: -1 arg_word: {(2)} spids: [3539] ) ] ) (C {(exit)} {($ VSub_Name "$res")}) ] spids: [-1 3525] ) ] spids: [-1 3548] ) (If arms: [ (if_arm cond: [ (SimpleCommand words: [ {(sane_grep)} {(DQ ("is the first ") ($ VSub_Name "$TERM_BAD") (" commit"))} {(DQ ($ VSub_Name "$GIT_DIR") (/BISECT_RUN))} ] redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {(/dev/null)} spids: [3567] ) ] ) ] action: [ (C {(gettextln)} {(DQ ("bisect run success"))}) (Sentence child: (C {(exit)} {(0)}) terminator: ) ] spids: [-1 3571] ) ] spids: [-1 3587] ) ] spids: [3291 3591] ) ) ] spids: [3277] ) spids: [3272 3276] ) (FuncDef name: bisect_log body: (BraceGroup children: [ (AndOr children: [ (C {(test)} {(-s)} {(DQ ($ VSub_Name "$GIT_DIR") (/BISECT_LOG))}) (C {(die)} { (DQ (CommandSubPart command_list: (CommandList children: [(C {(gettext)} {(DQ ("We are not bisecting."))})] ) left_token: spids: [3618 3624] ) ) } ) ] op_id: Op_DPipe ) (C {(cat)} {(DQ ($ VSub_Name "$GIT_DIR") (/BISECT_LOG))}) ] spids: [3601] ) spids: [3596 3600] ) (FuncDef name: get_terms body: (BraceGroup children: [ (If arms: [ (if_arm cond: [(C {(test)} {(-s)} {(DQ ($ VSub_Name "$GIT_DIR") (/BISECT_TERMS))})] action: [ (BraceGroup children: [(C {(read)} {(TERM_BAD)}) (C {(read)} {(TERM_GOOD)})] redirects: [ (Redir op_id: Redir_Less fd: -1 arg_word: {(DQ ($ VSub_Name "$GIT_DIR") (/BISECT_TERMS))} spids: [3676] ) ] spids: [3661] ) ] spids: [-1 3658] ) ] spids: [-1 3683] ) ] spids: [3643] ) spids: [3638 3642] ) (FuncDef name: write_terms body: (BraceGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:TERM_BAD) op: Equal rhs: {($ VSub_Number "$1")} spids: [3696] ) ] spids: [3696] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:TERM_GOOD) op: Equal rhs: {($ VSub_Number "$2")} spids: [3700] ) ] spids: [3700] ) (If arms: [ (if_arm cond: [ (C {(test)} {(DQ ($ VSub_Name "$TERM_BAD"))} {(Lit_Other "=")} {(DQ ($ VSub_Name "$TERM_GOOD"))} ) ] action: [ (C {(die)} { (DQ (CommandSubPart command_list: (CommandList children: [(C {(gettext)} {(DQ ("please use two different terms"))})] ) left_token: spids: [3725 3731] ) ) } ) ] spids: [-1 3719] ) ] spids: [-1 3735] ) (C {(check_term_format)} {(DQ ($ VSub_Name "$TERM_BAD"))} {(bad)}) (C {(check_term_format)} {(DQ ($ VSub_Name "$TERM_GOOD"))} {(good)}) (SimpleCommand words: [ {(printf)} {(SQ <"%s\\n%s\\n">)} {(DQ ($ VSub_Name "$TERM_BAD"))} {(DQ ($ VSub_Name "$TERM_GOOD"))} ] redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {(DQ ($ VSub_Name "$GIT_DIR") (/BISECT_TERMS))} spids: [3770] ) ] ) ] spids: [3693] ) spids: [3688 3692] ) (FuncDef name: check_term_format body: (BraceGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:term) op: Equal rhs: {($ VSub_Number "$1")} spids: [3787] ) ] spids: [3787] ) (AndOr children: [ (C {(git)} {(check-ref-format)} {(refs/bisect/) (DQ ($ VSub_Name "$term"))}) (C {(die)} { (DQ (CommandSubPart command_list: (CommandList children: [ (C {(eval_gettext)} { (DQ ("'") (EscapedLiteralPart token:) ("term' is not a valid term") ) } ) ] ) left_token: spids: [3806 3814] ) ) } ) ] op_id: Op_DPipe ) (Case to_match: {(DQ ($ VSub_Name "$term"))} arms: [ (case_arm pat_list: [ {(help)} {(start)} {(terms)} {(skip)} {(next)} {(reset)} {(visualize)} {(replay)} {(log)} {(run)} ] action: [ (C {(die)} { (DQ (CommandSubPart command_list: (CommandList children: [ (C {(eval_gettext)} { (DQ ("can't use the builtin command '") (EscapedLiteralPart token: ) ("term' as a term") ) } ) ] ) left_token: spids: [3852 3860] ) ) } ) ] spids: [3827 3846 3864 -1] ) (case_arm pat_list: [{(bad)} {(new)}] action: [ (If arms: [ (if_arm cond: [ (C {(test)} {(DQ ($ VSub_Number "$2"))} {(KW_Bang "!") (Lit_Other "=")} {(bad)} ) ] action: [ (C {(die)} { (DQ (CommandSubPart command_list: (CommandList children: [ (C {(eval_gettext)} { (DQ ("can't change the meaning of term '") (EscapedLiteralPart token: ) ("term'") ) } ) ] ) left_token: spids: [3909 3917] ) ) } ) ] spids: [-1 3887] ) ] spids: [-1 3921] ) ] spids: [3867 3870 3924 -1] ) (case_arm pat_list: [{(good)} {(old)}] action: [ (If arms: [ (if_arm cond: [ (C {(test)} {(DQ ($ VSub_Number "$2"))} {(KW_Bang "!") (Lit_Other "=")} {(good)} ) ] action: [ (C {(die)} { (DQ (CommandSubPart command_list: (CommandList children: [ (C {(eval_gettext)} { (DQ ("can't change the meaning of term '") (EscapedLiteralPart token: ) ("term'") ) } ) ] ) left_token: spids: [3953 3961] ) ) } ) ] spids: [-1 3947] ) ] spids: [-1 3965] ) ] spids: [3927 3930 3968 -1] ) ] spids: [3818 3824 3971] ) ] spids: [3784] ) spids: [3779 3783] ) (FuncDef name: check_and_set_terms body: (BraceGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:cmd) op: Equal rhs: {(DQ ($ VSub_Number "$1"))} spids: [3984] ) ] spids: [3984] ) (Case to_match: {(DQ ($ VSub_Name "$cmd"))} arms: [ (case_arm pat_list: [{(skip)} {(start)} {(terms)}] spids: [3999 4004 4006 -1] ) (case_arm pat_list: [{(Lit_Other "*")}] action: [ (If arms: [ (if_arm cond: [ (AndOr children: [ (C {(test)} {(-s)} {(DQ ($ VSub_Name "$GIT_DIR") (/BISECT_TERMS))}) (AndOr children: [ (C {(test)} {(DQ ($ VSub_Name "$cmd"))} {(KW_Bang "!") (Lit_Other "=")} {(DQ ($ VSub_Name "$TERM_BAD"))} ) (C {(test)} {(DQ ($ VSub_Name "$cmd"))} {(KW_Bang "!") (Lit_Other "=")} {(DQ ($ VSub_Name "$TERM_GOOD"))} ) ] op_id: Op_DAmp ) ] op_id: Op_DAmp ) ] action: [ (C {(die)} { (DQ (CommandSubPart command_list: (CommandList children: [ (C {(eval_gettext)} { (DQ ("Invalid command: you're currently in a ") (EscapedLiteralPart token: ) (TERM_BAD/) (EscapedLiteralPart token:) ("TERM_GOOD bisect.") ) } ) ] ) left_token: spids: [4061 4071] ) ) } ) ] spids: [-1 4055] ) ] spids: [-1 4075] ) (Case to_match: {(DQ ($ VSub_Name "$cmd"))} arms: [ (case_arm pat_list: [{(bad)} {(good)}] action: [ (If arms: [ (if_arm cond: [ (Pipeline children: [ (C {(test)} {(-s)} {(DQ ($ VSub_Name "$GIT_DIR") (/BISECT_TERMS))} ) ] negated: True ) ] action: [(C {(write_terms)} {(bad)} {(good)})] spids: [-1 4107] ) ] spids: [-1 4117] ) ] spids: [4087 4090 4120 -1] ) (case_arm pat_list: [{(new)} {(old)}] action: [ (If arms: [ (if_arm cond: [ (Pipeline children: [ (C {(test)} {(-s)} {(DQ ($ VSub_Name "$GIT_DIR") (/BISECT_TERMS))} ) ] negated: True ) ] action: [(C {(write_terms)} {(new)} {(old)})] spids: [-1 4143] ) ] spids: [-1 4153] ) ] spids: [4123 4126 4156 -1] ) ] spids: [4078 4084 4159] ) ] spids: [4009 4010 4161 -1] ) ] spids: [3990 3996 4164] ) ] spids: [3981] ) spids: [3976 3980] ) (FuncDef name: bisect_voc body: (BraceGroup children: [ (Case to_match: {(DQ ($ VSub_Number "$1"))} arms: [ (case_arm pat_list: [{(bad)}] action: [(C {(echo)} {(DQ ("bad|new"))})] spids: [4186 4187 4195 -1] ) (case_arm pat_list: [{(good)}] action: [(C {(echo)} {(DQ ("good|old"))})] spids: [4198 4199 4207 -1] ) ] spids: [4177 4183 4210] ) ] spids: [4174] ) spids: [4169 4173] ) (FuncDef name: bisect_terms body: (BraceGroup children: [ (C {(get_terms)}) (If arms: [ (if_arm cond: [ (Pipeline children: [(C {(test)} {(-s)} {(DQ ($ VSub_Name "$GIT_DIR") (/BISECT_TERMS))})] negated: True ) ] action: [ (C {(die)} { (DQ (CommandSubPart command_list: (CommandList children: [(C {(gettext)} {(DQ ("no terms defined"))})] ) left_token: spids: [4246 4252] ) ) } ) ] spids: [-1 4240] ) ] spids: [-1 4256] ) (Case to_match: {(DQ ($ VSub_Pound "$#"))} arms: [ (case_arm pat_list: [{(0)}] action: [ (C {(gettextln)} { (DQ ("Your current terms are ") ($ VSub_Name "$TERM_GOOD") (" for the old state\n") ("and ") ($ VSub_Name "$TERM_BAD") (" for the new state.") ) } ) ] spids: [4268 4269 4284 -1] ) (case_arm pat_list: [{(1)}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:arg) op: Equal rhs: {($ VSub_Number "$1")} spids: [4291] ) ] spids: [4291] ) (Case to_match: {(DQ ($ VSub_Name "$arg"))} arms: [ (case_arm pat_list: [{(--term-good)} {(--term-old)}] action: [(C {(printf)} {(SQ <"%s\\n">)} {(DQ ($ VSub_Name "$TERM_GOOD"))})] spids: [4304 4307 4321 -1] ) (case_arm pat_list: [{(--term-bad)} {(--term-new)}] action: [(C {(printf)} {(SQ <"%s\\n">)} {(DQ ($ VSub_Name "$TERM_BAD"))})] spids: [4324 4327 4341 -1] ) (case_arm pat_list: [{(Lit_Other "*")}] action: [ (C {(die)} { (DQ (CommandSubPart command_list: (CommandList children: [ (C {(eval_gettext)} { (DQ ("invalid argument ") (EscapedLiteralPart token: ) ("arg for 'git bisect terms'.\n") ( "Supported options are: --term-good|--term-old and --term-bad|--term-new." ) ) } ) ] ) left_token: spids: [4351 4360] ) ) } ) ] spids: [4344 4345 4364 -1] ) ] spids: [4295 4301 4367] ) ] spids: [4287 4288 4370 -1] ) (case_arm pat_list: [{(Lit_Other "*")}] action: [(C {(usage)})] spids: [4373 4374 4379 -1] ) ] spids: [4259 4265 4382] ) ] spids: [4220] ) spids: [4215 4219] ) (Case to_match: {(DQ ($ VSub_Pound "$#"))} arms: [ (case_arm pat_list:[{(0)}] action:[(C {(usage)})] spids:[439543964401-1]) (case_arm pat_list: [{(Lit_Other "*")}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:cmd) op: Equal rhs: {(DQ ($ VSub_Number "$1"))} spids: [4407] ) ] spids: [4407] ) (C {(get_terms)}) (C {(shift)}) (Case to_match: {(DQ ($ VSub_Name "$cmd"))} arms: [ (case_arm pat_list: [{(help)}] action: [(C {(git)} {(bisect)} {(-h)})] spids: [4428 4429 4438 -1] ) (case_arm pat_list: [{(start)}] action: [(C {(bisect_start)} {(DQ ($ VSub_At "$@"))})] spids: [4441 4442 4451 -1] ) (case_arm pat_list: [ {(bad)} {(good)} {(new)} {(old)} {(DQ ($ VSub_Name "$TERM_BAD"))} {(DQ ($ VSub_Name "$TERM_GOOD"))} ] action: [(C {(bisect_state)} {(DQ ($ VSub_Name "$cmd"))} {(DQ ($ VSub_At "$@"))})] spids: [4454 4469 4482 -1] ) (case_arm pat_list: [{(skip)}] action: [(C {(bisect_skip)} {(DQ ($ VSub_At "$@"))})] spids: [4485 4486 4495 -1] ) (case_arm pat_list: [{(next)}] action: [(C {(bisect_next)} {(DQ ($ VSub_At "$@"))})] spids: [4498 4499 4512 -1] ) (case_arm pat_list: [{(visualize)} {(view)}] action: [(C {(bisect_visualize)} {(DQ ($ VSub_At "$@"))})] spids: [4515 4518 4527 -1] ) (case_arm pat_list: [{(reset)}] action: [(C {(bisect_reset)} {(DQ ($ VSub_At "$@"))})] spids: [4530 4531 4540 -1] ) (case_arm pat_list: [{(replay)}] action: [(C {(bisect_replay)} {(DQ ($ VSub_At "$@"))})] spids: [4543 4544 4553 -1] ) (case_arm pat_list: [{(log)}] action: [(C {(bisect_log)})] spids: [4556 4557 4562 -1] ) (case_arm pat_list: [{(run)}] action: [(C {(bisect_run)} {(DQ ($ VSub_At "$@"))})] spids: [4565 4566 4575 -1] ) (case_arm pat_list: [{(terms)}] action: [(C {(bisect_terms)} {(DQ ($ VSub_At "$@"))})] spids: [4578 4579 4588 -1] ) (case_arm pat_list: [{(Lit_Other "*")}] action: [(C {(usage)})] spids: [4591 4592 4597 -1] ) ] spids: [4419 4425 4600] ) ] spids: [4403 4404 -1 4602] ) ] spids: [4387 4393 4602] ) ] )