git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Bisect: add checks at the beginning of "git bisect run".

From
Junio C Hamano <junkio@cox.net>
Date
Mar 28, 2007, 07:57 UTC
Message-ID
<7vbqidls13.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<200703280952.57058.chriscool@tuxfamily.org>
Christian Couder <chriscool@tuxfamily.org> writes:
Show 5 quoted lines
> git bisect run --not grep string my_file
>
> instead of something like
>
> git bisect run ! grep string my_file

How's the former more useful than the latter was what I was wondering but I do not care too deeply.

Show 10 quoted lines
> For example one could write:
>
> git bisect run --good rev1 --bad rev2 my_script
>
> instead of
>
> git bisect start
> git bisect good rev1
> git bisect bad rev2
> git bisect run my_script
Likewise.
Show 16 quoted lines
>> > --check or --test
>> > run the script once and then do nothing if the result is good
>>
>> How would you use this? 
>
> For example if you know that the last nightly build 
> tagged "nightly_2007_03_27" was ok, you could use:
>
> git bisect start
> git bisect good nightly_2007_03_27
> git bisect run --check make > /dev/null || {
> 	# extract commit and author email address from "$GIT_DIR/BISECT_RUN"
> 	# and send flame to author who broke the build with the commit
> }
>
> to automatically check that current source code builds ok.

As I said, bisect fundamentally needs one bad commit to start bisecting, so after you give only one good commit, it would not move to bisect branch nor suggest which commit to test. I assume you intend to run the test on the tip of the current branch here, but then your "git bisect run --check ./run-script" is equivalent to running ./run-script and checking the exit value.

In other words, the above would be equilvalent to
  git bisect start
  git bisect good nightly_2007_03_27
  make >/dev/null || {
	  git bisect bad
          git bisect run make >/dev/null
          # extract commit and author email address from "$GIT_DIR/BISECT_RUN"
          # and send flame to author who broke the build with the commit
  }
I happen to find the latter easier to read as a shell script.
Previous: Christian CouderNext: Christian Couder
Message 9 of 13 in “Bisect: add checks at the beginning of "git bisect run".”
  1. Bisect: add checks at the beginning of "git bisect run".Christian Couder, Mar 27, 2007
  2. Junio C HamanoMar 27, 2007
  3. Christian CouderMar 27, 2007
  4. Junio C HamanoMar 27, 2007
  5. Junio C HamanoMar 27, 2007
  6. Christian CouderMar 28, 2007
  7. Junio C HamanoMar 28, 2007
  8. Christian CouderMar 28, 2007
  9. Junio C HamanoMar 28, 2007
  10. Christian CouderMar 29, 2007
  11. Junio C HamanoMar 29, 2007
  12. Christian CouderApr 5, 2007
  13. Christian CouderApr 5, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.