Thread (13 messages) flat view 13 messages, 3 authors, 2021-01-30

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

From: Christian Couder <hidden>
Date: 2021-01-30 09:50:22

On Sat, Jan 30, 2021 at 2:46 AM Đoàn Trần Công Danh
[off-list ref] wrote:
quoted
@@ -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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help