# [PATCH] Documentation: "bisect run" can be given bangs before the run script.

4 messages from 2007-05-03 to 2007-05-05. Participants: Christian Couder, Junio C Hamano, Uwe Kleine-König.
Thread: https://gitlist.dev/t/7951

## Christian Couder, 2007-05-03 05:06

Subject: [PATCH] Documentation: "bisect run" can be given bangs before the run script.
Message-ID: <20070503070607.fa2ffe92.chriscool@tuxfamily.org>
URL: https://gitlist.dev/e/20070503070607.fa2ffe92.chriscool%40tuxfamily.org

```
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
---

Hi Uwe and Junio,

This is the documentation related to my latest patch:

[RFC/PATCH] Bisect: add special treatment for bangs passed to "bisect run".

(http://article.gmane.org/gmane.comp.version-control.git/45943)

Thanks in advance,
Christian.

 Documentation/git-bisect.txt |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/Documentation/git-bisect.txt b/Documentation/git-bisect.txt
index 5f68ee1..a1cceb5 100644
--- a/Documentation/git-bisect.txt
+++ b/Documentation/git-bisect.txt
@@ -175,6 +175,12 @@ Any other exit code will abort the automatic bisect process. (A
 program that does "exit(-1)" leaves $? = 255, see exit(3) manual page,
 the value is chopped with "& 0377".)
 
+You can use one or more "!" argument immediately after "git bisect
+run" if you want to revert once or more times the "run" script exit
+code, even if your current shell does not support the "!"
+keyword. Reverting the exit code means 0 gives 1 and anything other
+than 0 gives 0.
+
 You may often find that during bisect you want to have near-constant
 tweaks (e.g., s/#define DEBUG 0/#define DEBUG 1/ in a header file, or
 "revision that does not have this commit needs this patch applied to
-- 
1.5.2.rc0.71.g4342-dirty

```

## Junio C Hamano, 2007-05-03 05:29

Subject: Re: [PATCH] Documentation: "bisect run" can be given bangs before the run script.
Message-ID: <7vmz0m3261.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7vmz0m3261.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <20070503070607.fa2ffe92.chriscool@tuxfamily.org>

```
I am not convinced that '!' is a good extension for two and half
reasons.

 * The expected use is not quite clear.  If it is not used to
   run a custom test script but something stock as "make", by
   the nature of UNIX exit status convention, you are looking
   for the commit that _fixed_ some breakage (i.e. "which commit
   fixed the compilation error?").  While sometimes that is a
   useful thing to do, it feels somewhat of limited value.

   On the other hand, if you are running a custom test script, I
   do not think it is unreasonable to always require that a test
   script to signal "bad" with small non-zero, "good" with zero,
   and error with high non-zero status, as we already do.

 * How should this interact with the "high non-zero status means
   an error and we cannot bisect" return convention?

 * I was hoping that we can officially support "don't know,
   cannot test this one, please give me another" for interactive
   use, and at the same time allow the run-script used by
   "git bisect run" to signal such with a special exit value
   (perhaps "exit 42").  Taken together with the previous point,
   it is not clear how '!' should interact with such an
   enhancement.

```

## Uwe Kleine-König, 2007-05-03 07:03

Subject: Re: [PATCH] Documentation: "bisect run" can be given bangs before the run script.
Message-ID: <20070503070302.GA4491@informatik.uni-freiburg.de>
URL: https://gitlist.dev/e/20070503070302.GA4491%40informatik.uni-freiburg.de
In-Reply-To: <7vmz0m3261.fsf@assigned-by-dhcp.cox.net>

```
Hello,

Junio C Hamano wrote:
> I am not convinced that '!' is a good extension for two and half
> reasons.
> 
>  * The expected use is not quite clear.  If it is not used to
>    run a custom test script but something stock as "make", by
>    the nature of UNIX exit status convention, you are looking
>    for the commit that _fixed_ some breakage (i.e. "which commit
>    fixed the compilation error?").  While sometimes that is a
>    useful thing to do, it feels somewhat of limited value.
> 
>    On the other hand, if you are running a custom test script, I
>    do not think it is unreasonable to always require that a test
>    script to signal "bad" with small non-zero, "good" with zero,
>    and error with high non-zero status, as we already do.
> 
>  * How should this interact with the "high non-zero status means
>    an error and we cannot bisect" return convention?
> 
>  * I was hoping that we can officially support "don't know,
>    cannot test this one, please give me another" for interactive
>    use, and at the same time allow the run-script used by
>    "git bisect run" to signal such with a special exit value
>    (perhaps "exit 42").  Taken together with the previous point,
>    it is not clear how '!' should interact with such an
>    enhancement.
Ack for all 2½ reasons.

Uwe

-- 
Uwe Kleine-König

http://www.google.com/search?q=1+newton+in+kg*m+%2F+s%5E2

```

## Christian Couder, 2007-05-05 12:57

Subject: Re: [PATCH] Documentation: "bisect run" can be given bangs before the run script.
Message-ID: <200705051457.03277.chriscool@tuxfamily.org>
URL: https://gitlist.dev/e/200705051457.03277.chriscool%40tuxfamily.org
In-Reply-To: <7vmz0m3261.fsf@assigned-by-dhcp.cox.net>

```
Hi Junio and Uwe,

Le jeudi 3 mai 2007 07:29, Junio C Hamano a écrit :
> I am not convinced that '!' is a good extension for two and half
> reasons.
>
>  * The expected use is not quite clear.  If it is not used to
>    run a custom test script but something stock as "make", by
>    the nature of UNIX exit status convention, you are looking
>    for the commit that _fixed_ some breakage (i.e. "which commit
>    fixed the compilation error?").  While sometimes that is a
>    useful thing to do, it feels somewhat of limited value.

Well, of course the main expected use is for something like "make" or "grep" 
or "./test_something.sh" where "test_something.sh" is an already existing 
script.

Especially because "git bisect run ! grep foo bar.txt" seems to me like a 
nice way to find the commit that introduced "foo" in "bar.txt" and I have 
been frustrated that it does not work. (Perhaps "git blame" can do it too, 
but I think "git bisect run" should be faster and more specific.)

>    On the other hand, if you are running a custom test script, I
>    do not think it is unreasonable to always require that a test
>    script to signal "bad" with small non-zero, "good" with zero,
>    and error with high non-zero status, as we already do.

I agree this is probably the most usefull use of "git bisect run". But 
sometimes, perhaps for a one shot use, you already have something that 
could work if only you could revert the exist status. I think it is a good 
idea to give user some rope for this case.

>  * How should this interact with the "high non-zero status means
>    an error and we cannot bisect" return convention?

If you use a bare "! grep foobar /*/*" on the command line for example and 
you kill it before it's finished, you will still get a 0 exit code. This 
means that, with the bash "!" keyword, any error gives a "good" result. I 
think it's better to keep this behavior.

If we still wants something that keeps the "high non-zero status means an 
error and we cannot bisect" return convention, then let's call it a "--not" 
option or something like that. I will implement that if you prefer. I can 
even implement both "!" and "--not" if you want.

By the way I think that sometimes it could happens that any exit code other 
than 0 means a "bad" revision and not "we cannot bisect". In this case 
using "git bisect run ! ! my_script" can be usefull. 

>  * I was hoping that we can officially support "don't know,
>    cannot test this one, please give me another" for interactive
>    use, and at the same time allow the run-script used by
>    "git bisect run" to signal such with a special exit value
>    (perhaps "exit 42").  Taken together with the previous point,
>    it is not clear how '!' should interact with such an
>    enhancement.

My bang patch does not in any way prevents from adding such a "don't know, 
cannot test this one, please give me another" improvement. It's just 
another option to make "git bisect run" more convenient in some cases.

Christian (a give them rope proponent).

```
