提交 3145b1a2 编写于 作者: J Jon Seymour 提交者: Junio C Hamano

bisect: take advantage of gettextln, eval_gettextln.

Signed-off-by: NJon Seymour <jon.seymour@gmail.com>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 95745005
...@@ -45,10 +45,7 @@ bisect_head() ...@@ -45,10 +45,7 @@ bisect_head()
bisect_autostart() { bisect_autostart() {
test -s "$GIT_DIR/BISECT_START" || { test -s "$GIT_DIR/BISECT_START" || {
( gettextln "You need to start by \"git bisect start\"" >&2
gettext "You need to start by \"git bisect start\"" &&
echo
) >&2
if test -t 0 if test -t 0
then then
# TRANSLATORS: Make sure to include [Y] and [n] in your # TRANSLATORS: Make sure to include [Y] and [n] in your
...@@ -272,10 +269,7 @@ bisect_next_check() { ...@@ -272,10 +269,7 @@ bisect_next_check() {
t,,good) t,,good)
# have bad but not good. we could bisect although # have bad but not good. we could bisect although
# this is less optimum. # this is less optimum.
( gettextln "Warning: bisecting only with a bad commit." >&2
gettext "Warning: bisecting only with a bad commit." &&
echo
) >&2
if test -t 0 if test -t 0
then then
# TRANSLATORS: Make sure to include [Y] and [n] in your # TRANSLATORS: Make sure to include [Y] and [n] in your
...@@ -291,18 +285,12 @@ bisect_next_check() { ...@@ -291,18 +285,12 @@ bisect_next_check() {
if test -s "$GIT_DIR/BISECT_START" if test -s "$GIT_DIR/BISECT_START"
then then
( gettextln "You need to give me at least one good and one bad revisions.
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.)" >&2
(You can use \"git bisect bad\" and \"git bisect good\" for that.)" &&
echo
) >&2
else else
( gettextln "You need to start by \"git bisect start\".
gettext "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.)" && (You can use \"git bisect bad\" and \"git bisect good\" for that.)" >&2
echo
) >&2
fi fi
exit 1 ;; exit 1 ;;
esac esac
...@@ -355,7 +343,7 @@ bisect_visualize() { ...@@ -355,7 +343,7 @@ bisect_visualize() {
bisect_reset() { bisect_reset() {
test -s "$GIT_DIR/BISECT_START" || { test -s "$GIT_DIR/BISECT_START" || {
gettext "We are not bisecting."; echo gettextln "We are not bisecting."
return return
} }
case "$#" in case "$#" in
...@@ -428,18 +416,15 @@ bisect_run () { ...@@ -428,18 +416,15 @@ bisect_run () {
while true while true
do do
command="$@" command="$@"
eval_gettext "running \$command"; echo eval_gettextln "running \$command"
"$@" "$@"
res=$? res=$?
# Check for really bad run error. # Check for really bad run error.
if [ $res -lt 0 -o $res -ge 128 ] if [ $res -lt 0 -o $res -ge 128 ]
then then
( eval_gettextln "bisect run failed:
eval_gettext "bisect run failed: exit code \$res from '\$command' is < 0 or >= 128" >&2
exit code \$res from '\$command' is < 0 or >= 128" &&
echo
) >&2
exit $res exit $res
fi fi
...@@ -464,26 +449,20 @@ exit code \$res from '\$command' is < 0 or >= 128" && ...@@ -464,26 +449,20 @@ exit code \$res from '\$command' is < 0 or >= 128" &&
if sane_grep "first bad commit could be any of" "$GIT_DIR/BISECT_RUN" \ if sane_grep "first bad commit could be any of" "$GIT_DIR/BISECT_RUN" \
> /dev/null > /dev/null
then then
( gettextln "bisect run cannot continue any more" >&2
gettext "bisect run cannot continue any more" &&
echo
) >&2
exit $res exit $res
fi fi
if [ $res -ne 0 ] if [ $res -ne 0 ]
then then
( eval_gettextln "bisect run failed:
eval_gettext "bisect run failed: 'bisect_state \$state' exited with error code \$res" >&2
'bisect_state \$state' exited with error code \$res" &&
echo
) >&2
exit $res exit $res
fi fi
if sane_grep "is the first bad commit" "$GIT_DIR/BISECT_RUN" > /dev/null if sane_grep "is the first bad commit" "$GIT_DIR/BISECT_RUN" > /dev/null
then then
gettext "bisect run success"; echo gettextln "bisect run success"
exit 0; exit 0;
fi fi
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册