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

Re: [PATCH] bisect: improve output when bad commit is found

From
Junio C Hamano <gitster@pobox.com>
Date
May 11, 2015, 21:12 UTC
Message-ID
<xmqq4mni3jjg.fsf@gitster.dls.corp.google.com>
In-Reply-To
<1431377939-13887-1-git-send-email-tbsaunde@tbsaunde.org>
Trevor Saunders <tbsaunde@tbsaunde.org> writes:
> When the first bad commit has been found git bisect prints something
> like this
Show 8 quoted lines
>
> <40 char sha1> is the first bad commit
> Commit <40 char sha1>
> ...
>
> <raw diff output>
>
> The raw diff output is not really useful, and its kind of silly to print

End "something like this" with a colon, and indent the example display, i.e.

        ... prints something like this:
            <40-hex object name> is the first bad commit
            Commit <40-hex object name>
        The raw diff output is ...
Show 5 quoted lines
> the sha1 twice.  Instead lets print something like
>
> the first bad commit is
> Commit <sha1>
> ...
Likewise.
> This also fixes an odd inconsistancy where if the first bad commit is a
> trivial merge git bisect will only print the first line.
> ---
Sign-off?
> -		printf("%s is the first bad commit\n", bisect_rev_hex);
> +		puts("the first bad commit is");
s/the/The/, I would think.
Show 10 quoted lines
> diff --git a/t/t6030-bisect-porcelain.sh b/t/t6030-bisect-porcelain.sh
> index 06b4868..bf50d20 100755
> --- a/t/t6030-bisect-porcelain.sh
> +++ b/t/t6030-bisect-porcelain.sh
> @@ -26,6 +26,14 @@ add_line_into_file()
>      git commit --quiet -m "$MSG" $_file
>  }
>  
> +check_bisect_msg()
> +{
Find this paragraph in Documentation/CodingGuidelines:
 - We prefer a space between the function name and the parentheses,
   and no space inside the parentheses. The opening "{" should also
   be on the same line.
> +	file=$1
> +	hash=$2
> +	grep "the first bad commit is" $file || return $?
> +	grep $hash $file || return $?
Is it OK to have these strings anywhere in the $file?
Thanks.
Previous: Trevor SaundersNext: Trevor Saunders
Message 2 of 5 in “bisect: improve output when bad commit is found”
  1. bisect: improve output when bad commit is foundTrevor Saunders, May 11, 2015
  2. Junio C HamanoMay 11, 2015
  3. Trevor SaundersMay 11, 2015
  4. Junio C HamanoMay 12, 2015
  5. Trevor SaundersMay 12, 2015

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.