bisect: take advantage of gettextln, eval_gettextln.
Signed-off-by: Jon Seymour <jon.seymour@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jon Seymour committed
Aug 31, 2011 at 09:09 UTC
3145b1a282fde9a4485662fbc77e0075f6fe7517
1 file changed
+14
-35
git-bisect.sh
+14
-35
@@ -45,10 +45,7 @@ bisect_head()
45
46
bisect_autostart() {
47
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
49
if test -t 0
50
then
51
# TRANSLATORS: Make sure to include [Y] and [n] in your
@@ -272,10 +269,7 @@ bisect_next_check() {
269
t,,good)
270
# have bad but not good. we could bisect although
271
# 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
273
if test -t 0
274
then
275
# TRANSLATORS: Make sure to include [Y] and [n] in your
@@ -291,18 +285,12 @@ bisect_next_check() {
285
286
if test -s "$GIT_DIR/BISECT_START"
287
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
290
else
300
- (
301
- gettext "You need to start by \"git bisect start\".
291
+ gettextln "You need to start by \"git bisect start\".
292
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
294
fi
295
exit 1 ;;
296
esac
@@ -355,7 +343,7 @@ bisect_visualize() {
343
344
bisect_reset() {
345
test -s "$GIT_DIR/BISECT_START" || {
358
- gettext "We are not bisecting."; echo
346
+ gettextln "We are not bisecting."
347
return
348
}
349
case "$#" in
@@ -428,18 +416,15 @@ bisect_run () {
416
while true
417
do
418
command="$@"
431
- eval_gettext "running \$command"; echo
419
+ eval_gettextln "running \$command"
420
"$@"
421
res=$?
422
423
# Check for really bad run error.
424
if [ $res -lt 0 -o $res -ge 128 ]
425
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
428
exit $res
429
fi
430
@@ -464,26 +449,20 @@ exit code \$res from '\$command' is < 0 or >= 128" &&
449
if sane_grep "first bad commit could be any of" "$GIT_DIR/BISECT_RUN" \
450
> /dev/null
451
then
467
- (
468
- gettext "bisect run cannot continue any more" &&
469
- echo
470
- ) >&2
452
+ gettextln "bisect run cannot continue any more" >&2
453
exit $res
454
fi
455
456
if [ $res -ne 0 ]
457
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
460
exit $res
461
fi
462
463
if sane_grep "is the first bad commit" "$GIT_DIR/BISECT_RUN" > /dev/null
464
then
486
- gettext "bisect run success"; echo
465
+ gettextln "bisect run success"
466
exit 0;
467
fi
468