Re: [PATCH v4 1/7] bisect--helper: reimplement `bisect_log` shell function in C

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Jan 30, 2021 at 2:46 AM Đoàn Trần Công Danh
<congdanhqx@xxxxxxxxx> wrote:

> > @@ -210,7 +205,7 @@ case "$#" in
> >       replay)
> >               bisect_replay "$@" ;;
> >       log)
> > -             bisect_log ;;
> > +             git bisect--helper --bisect-log || exit ;;
>
> The original code was "die" when no bisect_log available.
>
> I think we need to "exit 1" here to indicate a failure, i.e.
>
>         git bisect--helper --bisect-log || exit 1 ;;

Actually:

             git bisect--helper --bisect-log || exit ;;

will indicate failure. See:

$ ( false || exit )
$ echo $?
1

The difference with what you suggest is that the exit code will be the
same instead of always 1:

$ ( ( exit 4 ) || exit )
echo $?
4

which is a good thing, as die() exits with code 128, so if `git
bisect--helper --bisect-log` die()s then we will get a 128 exit code
with `|| exit` instead of 1 with `|| exit 1`.

Thanks for your review,
Christian.




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux