threads / patch / 7951

patchDocumentation: "bisect run" can be given bangs before the run script.

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

## tl;dr

4 messages between May 3, 2007 and May 5, 2007. Diffs are folded; open one to read it.

replies: 3people: 3as markdown or json

Christian Couder· May 3, 2007, 05:06 UTC · lore
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(-)
Show changes to Documentation/git-bisect.txt +6 −0
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· May 3, 2007, 05:29 UTC · re: Christian Couder · lore

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

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· May 3, 2007, 07:03 UTC · re: Junio C Hamano · lore

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

Hello,
Junio C Hamano wrote:
Show 25 quoted lines
> 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· May 5, 2007, 12:57 UTC · re: Junio C Hamano · lore

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

Hi Junio and Uwe,
Le jeudi 3 mai 2007 07:29, Junio C Hamano a écrit :
Show 9 quoted lines
> 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.

Show 7 quoted lines
>  * 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).

← back to recent threads