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

Re: [PATCH] bisect: Store first bad commit as comment in log file

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 15, 2013, 06:50 UTC
Message-ID
<7v4nf82soy.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20130413152257.GB16040@pvv.ntnu.no>
Torstein Hegge <hegge@resisty.net> writes:
Show 30 quoted lines
> When bisect successfully finds a single revision, the first bad commit
> should be shown to human readers of 'git bisect log'.
>
> This resolves the apparent disconnect between the bisection result and
> the log when a bug reporter says "I know that the first bad commit is
> $rev, as you can see from $(git bisect log)".
>
> Signed-off-by: Torstein Hegge <hegge@resisty.net>
> ---
> I don't know how useful the added test is, I didn't find any existing
> tests that looks at the comment parts of bisect log.
>
>  git-bisect.sh               |    8 +++++++-
>  t/t6030-bisect-porcelain.sh |   18 ++++++++++++++++++
>  2 files changed, 25 insertions(+), 1 deletion(-)
>
> diff --git a/git-bisect.sh b/git-bisect.sh
> index 99efbe8..c58eea7 100755
> --- a/git-bisect.sh
> +++ b/git-bisect.sh
> @@ -311,7 +311,13 @@ bisect_next() {
>  	res=$?
>  
>  	# Check if we should exit because bisection is finished
> -	test $res -eq 10 && exit 0
> +	if test $res -eq 10
> +	then
> +		bad_rev=$(git show-ref --hash --verify refs/bisect/bad)
> +		bad_commit=$(git show-branch $bad_rev)
> +		echo "# first bad commit: $bad_commit" >>"$GIT_DIR/BISECT_LOG"

As this is "# commented out", replaying will safely ignore this new record, so this should be safe.

Previous: Torstein Hegge
Message 11 of 11 in “bisect: Store first bad commit as comment in log file”
  1. bisect: Store first bad commit as comment in log fileTorstein Hegge, Apr 13, 2013
  2. Christian CouderApr 15, 2013
  3. Torstein HeggeApr 15, 2013
  4. Junio C HamanoApr 15, 2013
  5. Torstein HeggeApr 22, 2013
  6. Junio C HamanoApr 22, 2013
  7. Torstein HeggeApr 22, 2013
  8. Junio C HamanoApr 22, 2013
  9. Christian CouderApr 25, 2013
  10. bisect: Fix log output for multi-parent skip rangesTorstein Hegge, May 22, 2013
  11. Junio C HamanoApr 15, 2013

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.