Skip to content

Commit a536a9d

Browse files
committed
Merge branch 'js/i18n-scripts-2'
* js/i18n-scripts-2: bisect: take advantage of gettextln, eval_gettextln.
2 parents 57c0810 + 3145b1a commit a536a9d

File tree

1 file changed

+14
-35
lines changed

1 file changed

+14
-35
lines changed

git-bisect.sh

Lines changed: 14 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,7 @@ bisect_head()
4545

4646
bisect_autostart() {
4747
test -s "$GIT_DIR/BISECT_START" || {
48-
(
49-
gettext "You need to start by \"git bisect start\"" &&
50-
echo
51-
) >&2
48+
gettextln "You need to start by \"git bisect start\"" >&2
5249
if test -t 0
5350
then
5451
# TRANSLATORS: Make sure to include [Y] and [n] in your
@@ -272,10 +269,7 @@ bisect_next_check() {
272269
t,,good)
273270
# have bad but not good. we could bisect although
274271
# this is less optimum.
275-
(
276-
gettext "Warning: bisecting only with a bad commit." &&
277-
echo
278-
) >&2
272+
gettextln "Warning: bisecting only with a bad commit." >&2
279273
if test -t 0
280274
then
281275
# TRANSLATORS: Make sure to include [Y] and [n] in your
@@ -291,18 +285,12 @@ bisect_next_check() {
291285

292286
if test -s "$GIT_DIR/BISECT_START"
293287
then
294-
(
295-
gettext "You need to give me at least one good and one bad revisions.
296-
(You can use \"git bisect bad\" and \"git bisect good\" for that.)" &&
297-
echo
298-
) >&2
288+
gettextln "You need to give me at least one good and one bad revisions.
289+
(You can use \"git bisect bad\" and \"git bisect good\" for that.)" >&2
299290
else
300-
(
301-
gettext "You need to start by \"git bisect start\".
291+
gettextln "You need to start by \"git bisect start\".
302292
You then need to give me at least one good and one bad revisions.
303-
(You can use \"git bisect bad\" and \"git bisect good\" for that.)" &&
304-
echo
305-
) >&2
293+
(You can use \"git bisect bad\" and \"git bisect good\" for that.)" >&2
306294
fi
307295
exit 1 ;;
308296
esac
@@ -355,7 +343,7 @@ bisect_visualize() {
355343

356344
bisect_reset() {
357345
test -s "$GIT_DIR/BISECT_START" || {
358-
gettext "We are not bisecting."; echo
346+
gettextln "We are not bisecting."
359347
return
360348
}
361349
case "$#" in
@@ -428,18 +416,15 @@ bisect_run () {
428416
while true
429417
do
430418
command="$@"
431-
eval_gettext "running \$command"; echo
419+
eval_gettextln "running \$command"
432420
"$@"
433421
res=$?
434422

435423
# Check for really bad run error.
436424
if [ $res -lt 0 -o $res -ge 128 ]
437425
then
438-
(
439-
eval_gettext "bisect run failed:
440-
exit code \$res from '\$command' is < 0 or >= 128" &&
441-
echo
442-
) >&2
426+
eval_gettextln "bisect run failed:
427+
exit code \$res from '\$command' is < 0 or >= 128" >&2
443428
exit $res
444429
fi
445430

@@ -464,26 +449,20 @@ exit code \$res from '\$command' is < 0 or >= 128" &&
464449
if sane_grep "first bad commit could be any of" "$GIT_DIR/BISECT_RUN" \
465450
> /dev/null
466451
then
467-
(
468-
gettext "bisect run cannot continue any more" &&
469-
echo
470-
) >&2
452+
gettextln "bisect run cannot continue any more" >&2
471453
exit $res
472454
fi
473455

474456
if [ $res -ne 0 ]
475457
then
476-
(
477-
eval_gettext "bisect run failed:
478-
'bisect_state \$state' exited with error code \$res" &&
479-
echo
480-
) >&2
458+
eval_gettextln "bisect run failed:
459+
'bisect_state \$state' exited with error code \$res" >&2
481460
exit $res
482461
fi
483462

484463
if sane_grep "is the first bad commit" "$GIT_DIR/BISECT_RUN" > /dev/null
485464
then
486-
gettext "bisect run success"; echo
465+
gettextln "bisect run success"
487466
exit 0;
488467
fi
489468

0 commit comments

Comments
 (0)