bisect: cleanup whitespace errors in git-bisect.sh.

All leading whitespace is now encoded with tabs. After this patch, the following is true: RAW=$(cat git-bisect.sh | md5sum) && ROUNDTRIP=$(cat git-bisect.sh | expand -i - | unexpand --first-only - | md5sum) && LEADING=$(sed -n "/^ */p" < git-bisect.sh | wc -l) && test $RAW = $ROUNDTRIP && test $LEADING = 0 && test -z "$(git diff -w HEAD~1 HEAD)" Signed-off-by: Jon Seymour <jon.seymour@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jon Seymour committed Aug 5, 2011 at 21:31 UTC 6021be866f904914e901d55f07adee980335d07d
1 file changed +134 -134
git-bisect.sh
+134 -134
@@ -2,27 +2,27 @@
2
3 USAGE='[help|start|bad|good|skip|next|reset|visualize|replay|log|run]'
4 LONG_USAGE='git bisect help
5 - print this long help message.
5 + print this long help message.
6 git bisect start [--no-checkout] [<bad> [<good>...]] [--] [<pathspec>...]
7 - reset bisect state and start bisection.
7 + reset bisect state and start bisection.
8 git bisect bad [<rev>]
9 - mark <rev> a known-bad revision.
9 + mark <rev> a known-bad revision.
10 git bisect good [<rev>...]
11 - mark <rev>... known-good revisions.
11 + mark <rev>... known-good revisions.
12 git bisect skip [(<rev>|<range>)...]
13 - mark <rev>... untestable revisions.
13 + mark <rev>... untestable revisions.
14 git bisect next
15 - find next bisection to test and check it out.
15 + find next bisection to test and check it out.
16 git bisect reset [<commit>]
17 - finish bisection search and go back to commit.
17 + finish bisection search and go back to commit.
18 git bisect visualize
19 - show bisect status in gitk.
19 + show bisect status in gitk.
20 git bisect replay <logfile>
21 - replay bisection log.
21 + replay bisection log.
22 git bisect log
23 - show bisect log.
23 + show bisect log.
24 git bisect run <cmd>...
25 - use <cmd>... to automatically bisect.
25 + use <cmd>... to automatically bisect.
26
27 Please use "git help bisect" to get the full man page.'
28
@@ -55,7 +55,7 @@ bisect_autostart() {
55 # TRANSLATORS: Make sure to include [Y] and [n] in your
56 # translation. The program will only accept English input
57 # at this point.
58 - gettext "Do you want me to do it for you [Y/n]? " >&2
58 + gettext "Do you want me to do it for you [Y/n]? " >&2
59 read yesno
60 case "$yesno" in
61 [Nn]*)
@@ -74,38 +74,38 @@ bisect_start() {
74 #
75 has_double_dash=0
76 for arg; do
77 - case "$arg" in --) has_double_dash=1; break ;; esac
77 + case "$arg" in --) has_double_dash=1; break ;; esac
78 done
79 orig_args=$(git rev-parse --sq-quote "$@")
80 bad_seen=0
81 eval=''
82 mode=''
83 while [ $# -gt 0 ]; do
84 - arg="$1"
85 - case "$arg" in
86 - --)
87 - shift
88 - break
84 + arg="$1"
85 + case "$arg" in
86 + --)
87 + shift
88 + break
89 ;;
90 - --no-checkout)
91 - mode=--no-checkout
92 - shift ;;
93 - --*)
94 - die "$(eval_gettext "unrecognised option: '\$arg'")" ;;
95 - *)
96 - rev=$(git rev-parse -q --verify "$arg^{commit}") || {
97 - test $has_double_dash -eq 1 &&
90 + --no-checkout)
91 + mode=--no-checkout
92 + shift ;;
93 + --*)
94 + die "$(eval_gettext "unrecognised option: '\$arg'")" ;;
95 + *)
96 + rev=$(git rev-parse -q --verify "$arg^{commit}") || {
97 + test $has_double_dash -eq 1 &&
98 die "$(eval_gettext "'\$arg' does not appear to be a valid revision")"
99 - break
100 - }
101 - case $bad_seen in
102 - 0) state='bad' ; bad_seen=1 ;;
103 - *) state='good' ;;
99 + break
100 + }
101 + case $bad_seen in
102 + 0) state='bad' ; bad_seen=1 ;;
103 + *) state='good' ;;
104 + esac
105 + eval="$eval bisect_write '$state' '$rev' 'nolog' &&"
106 + shift
107 + ;;
108 esac
105 - eval="$eval bisect_write '$state' '$rev' 'nolog' &&"
106 - shift
107 - ;;
108 - esac
109 done
110
111 #
@@ -207,18 +207,18 @@ check_expected_revs() {
207 }
208
209 bisect_skip() {
210 - all=''
210 + all=''
211 for arg in "$@"
212 do
213 - case "$arg" in
214 - *..*)
215 - revs=$(git rev-list "$arg") || die "$(eval_gettext "Bad rev input: \$arg")" ;;
216 - *)
217 - revs=$(git rev-parse --sq-quote "$arg") ;;
218 - esac
219 - all="$all $revs"
220 - done
221 - eval bisect_state 'skip' $all
213 + case "$arg" in
214 + *..*)
215 + revs=$(git rev-list "$arg") || die "$(eval_gettext "Bad rev input: \$arg")" ;;
216 + *)
217 + revs=$(git rev-parse --sq-quote "$arg") ;;
218 + esac
219 + all="$all $revs"
220 + done
221 + eval bisect_state 'skip' $all
222 }
223
224 bisect_state() {
@@ -316,7 +316,7 @@ bisect_next() {
316 git bisect--helper --next-all $(test -f "$GIT_DIR/BISECT_HEAD" && echo --no-checkout)
317 res=$?
318
319 - # Check if we should exit because bisection is finished
319 + # Check if we should exit because bisection is finished
320 test $res -eq 10 && exit 0
321
322 # Check for an error in the bisection process
@@ -355,12 +355,12 @@ bisect_reset() {
355 case "$#" in
356 0) branch=$(cat "$GIT_DIR/BISECT_START") ;;
357 1) git rev-parse --quiet --verify "$1^{commit}" > /dev/null || {
358 - invalid="$1"
359 - die "$(eval_gettext "'\$invalid' is not a valid commit")"
360 - }
361 - branch="$1" ;;
358 + invalid="$1"
359 + die "$(eval_gettext "'\$invalid' is not a valid commit")"
360 + }
361 + branch="$1" ;;
362 *)
363 - usage ;;
363 + usage ;;
364 esac
365 if ! test -f "$GIT_DIR/BISECT_HEAD"
366 then
@@ -418,65 +418,65 @@ bisect_replay () {
418 }
419
420 bisect_run () {
421 - bisect_next_check fail
422 -
423 - while true
424 - do
425 - command="$@"
426 - eval_gettext "running \$command"; echo
427 - "$@"
428 - res=$?
429 -
430 - # Check for really bad run error.
431 - if [ $res -lt 0 -o $res -ge 128 ]; then
432 - (
433 - eval_gettext "bisect run failed:
421 + bisect_next_check fail
422 +
423 + while true
424 + do
425 + command="$@"
426 + eval_gettext "running \$command"; echo
427 + "$@"
428 + res=$?
429 +
430 + # Check for really bad run error.
431 + if [ $res -lt 0 -o $res -ge 128 ]; then
432 + (
433 + eval_gettext "bisect run failed:
434 exit code \$res from '\$command' is < 0 or >= 128" &&
435 - echo
436 - ) >&2
437 - exit $res
438 - fi
439 -
440 - # Find current state depending on run success or failure.
441 - # A special exit code of 125 means cannot test.
442 - if [ $res -eq 125 ]; then
443 - state='skip'
444 - elif [ $res -gt 0 ]; then
445 - state='bad'
446 - else
447 - state='good'
448 - fi
449 -
450 - # We have to use a subshell because "bisect_state" can exit.
451 - ( bisect_state $state > "$GIT_DIR/BISECT_RUN" )
452 - res=$?
453 -
454 - cat "$GIT_DIR/BISECT_RUN"
455 -
456 - if sane_grep "first bad commit could be any of" "$GIT_DIR/BISECT_RUN" \
457 - > /dev/null; then
458 - (
459 - gettext "bisect run cannot continue any more" &&
460 - echo
461 - ) >&2
462 - exit $res
463 - fi
464 -
465 - if [ $res -ne 0 ]; then
466 - (
467 - eval_gettext "bisect run failed:
435 + echo
436 + ) >&2
437 + exit $res
438 + fi
439 +
440 + # Find current state depending on run success or failure.
441 + # A special exit code of 125 means cannot test.
442 + if [ $res -eq 125 ]; then
443 + state='skip'
444 + elif [ $res -gt 0 ]; then
445 + state='bad'
446 + else
447 + state='good'
448 + fi
449 +
450 + # We have to use a subshell because "bisect_state" can exit.
451 + ( bisect_state $state > "$GIT_DIR/BISECT_RUN" )
452 + res=$?
453 +
454 + cat "$GIT_DIR/BISECT_RUN"
455 +
456 + if sane_grep "first bad commit could be any of" "$GIT_DIR/BISECT_RUN" \
457 + > /dev/null; then
458 + (
459 + gettext "bisect run cannot continue any more" &&
460 + echo
461 + ) >&2
462 + exit $res
463 + fi
464 +
465 + if [ $res -ne 0 ]; then
466 + (
467 + eval_gettext "bisect run failed:
468 'bisect_state \$state' exited with error code \$res" &&
469 - echo
470 - ) >&2
471 - exit $res
472 - fi
469 + echo
470 + ) >&2
471 + exit $res
472 + fi
473
474 - if sane_grep "is the first bad commit" "$GIT_DIR/BISECT_RUN" > /dev/null; then
475 - gettext "bisect run success"; echo
476 - exit 0;
477 - fi
474 + if sane_grep "is the first bad commit" "$GIT_DIR/BISECT_RUN" > /dev/null; then
475 + gettext "bisect run success"; echo
476 + exit 0;
477 + fi
478
479 - done
479 + done
480 }
481
482 bisect_log () {
@@ -486,33 +486,33 @@ bisect_log () {
486
487 case "$#" in
488 0)
489 - usage ;;
489 + usage ;;
490 *)
491 - cmd="$1"
492 - shift
493 - case "$cmd" in
494 - help)
495 - git bisect -h ;;
496 - start)
497 - bisect_start "$@" ;;
498 - bad|good)
499 - bisect_state "$cmd" "$@" ;;
500 - skip)
501 - bisect_skip "$@" ;;
502 - next)
503 - # Not sure we want "next" at the UI level anymore.
504 - bisect_next "$@" ;;
505 - visualize|view)
506 - bisect_visualize "$@" ;;
507 - reset)
508 - bisect_reset "$@" ;;
509 - replay)
510 - bisect_replay "$@" ;;
511 - log)
512 - bisect_log ;;
513 - run)
514 - bisect_run "$@" ;;
515 - *)
516 - usage ;;
517 - esac
491 + cmd="$1"
492 + shift
493 + case "$cmd" in
494 + help)
495 + git bisect -h ;;
496 + start)
497 + bisect_start "$@" ;;
498 + bad|good)
499 + bisect_state "$cmd" "$@" ;;
500 + skip)
501 + bisect_skip "$@" ;;
502 + next)
503 + # Not sure we want "next" at the UI level anymore.
504 + bisect_next "$@" ;;
505 + visualize|view)
506 + bisect_visualize "$@" ;;
507 + reset)
508 + bisect_reset "$@" ;;
509 + replay)
510 + bisect_replay "$@" ;;
511 + log)
512 + bisect_log ;;
513 + run)
514 + bisect_run "$@" ;;
515 + *)
516 + usage ;;
517 + esac
518 esac