diff --git a/git-bisect.sh b/git-bisect.sh
index e0ca3fb853083d0ebdfe11e5eb3fead4723248ad..99efbe884528ffa730d6c0297e20d9de93d5ad9e 100755 (executable)
--- a/git-bisect.sh
+++ b/git-bisect.sh
bisect_autostart() {
test -s "$GIT_DIR/BISECT_START" || {
bisect_autostart() {
test -s "$GIT_DIR/BISECT_START" || {
- (
- gettext "You need to start by \"git bisect start\"" &&
- echo
- ) >&2
+ gettextln "You need to start by \"git bisect start\"" >&2
if test -t 0
then
# TRANSLATORS: Make sure to include [Y] and [n] in your
if test -t 0
then
# TRANSLATORS: Make sure to include [Y] and [n] in your
start_head=$(cat "$GIT_DIR/BISECT_START")
if test "z$mode" != "z--no-checkout"
then
start_head=$(cat "$GIT_DIR/BISECT_START")
if test "z$mode" != "z--no-checkout"
then
- git checkout "$start_head" --
+ git checkout "$start_head" -- ||
+ die "$(eval_gettext "Checking out '\$start_head' failed. Try 'git bisect reset <validbranch>'.")"
fi
else
# Get rev from where we start.
fi
else
# Get rev from where we start.
t,,good)
# have bad but not good. we could bisect although
# this is less optimum.
t,,good)
# have bad but not good. we could bisect although
# this is less optimum.
- (
- gettext "Warning: bisecting only with a bad commit." &&
- echo
- ) >&2
+ gettextln "Warning: bisecting only with a bad commit." >&2
if test -t 0
then
# TRANSLATORS: Make sure to include [Y] and [n] in your
if test -t 0
then
# TRANSLATORS: Make sure to include [Y] and [n] in your
if test -s "$GIT_DIR/BISECT_START"
then
if test -s "$GIT_DIR/BISECT_START"
then
- (
- gettext "You need to give me at least one good and one bad revisions.
-(You can use \"git bisect bad\" and \"git bisect good\" for that.)" &&
- echo
- ) >&2
+ gettextln "You need to give me at least one good and one bad revisions.
+(You can use \"git bisect bad\" and \"git bisect good\" for that.)" >&2
else
else
- (
- gettext "You need to start by \"git bisect start\".
+ gettextln "You need to start by \"git bisect start\".
You then need to give me at least one good and one bad revisions.
You then need to give me at least one good and one bad revisions.
-(You can use \"git bisect bad\" and \"git bisect good\" for that.)" &&
- echo
- ) >&2
+(You can use \"git bisect bad\" and \"git bisect good\" for that.)" >&2
fi
exit 1 ;;
esac
fi
exit 1 ;;
esac
bisect_reset() {
test -s "$GIT_DIR/BISECT_START" || {
bisect_reset() {
test -s "$GIT_DIR/BISECT_START" || {
- gettext "We are not bisecting."; echo
+ gettextln "We are not bisecting."
return
}
case "$#" in
return
}
case "$#" in
while true
do
command="$@"
while true
do
command="$@"
- eval_gettext "running \$command"; echo
+ eval_gettextln "running \$command"
"$@"
res=$?
# Check for really bad run error.
if [ $res -lt 0 -o $res -ge 128 ]
then
"$@"
res=$?
# Check for really bad run error.
if [ $res -lt 0 -o $res -ge 128 ]
then
- (
- eval_gettext "bisect run failed:
-exit code \$res from '\$command' is < 0 or >= 128" &&
- echo
- ) >&2
+ eval_gettextln "bisect run failed:
+exit code \$res from '\$command' is < 0 or >= 128" >&2
exit $res
fi
exit $res
fi
if sane_grep "first bad commit could be any of" "$GIT_DIR/BISECT_RUN" \
> /dev/null
then
if sane_grep "first bad commit could be any of" "$GIT_DIR/BISECT_RUN" \
> /dev/null
then
- (
- gettext "bisect run cannot continue any more" &&
- echo
- ) >&2
+ gettextln "bisect run cannot continue any more" >&2
exit $res
fi
if [ $res -ne 0 ]
then
exit $res
fi
if [ $res -ne 0 ]
then
- (
- eval_gettext "bisect run failed:
-'bisect_state \$state' exited with error code \$res" &&
- echo
- ) >&2
+ eval_gettextln "bisect run failed:
+'bisect_state \$state' exited with error code \$res" >&2
exit $res
fi
if sane_grep "is the first bad commit" "$GIT_DIR/BISECT_RUN" > /dev/null
then
exit $res
fi
if sane_grep "is the first bad commit" "$GIT_DIR/BISECT_RUN" > /dev/null
then
- gettext "bisect run success"; echo
+ gettextln "bisect run success"
exit 0;
fi
exit 0;
fi