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

Re: [PATCH] branch: honor --abbrev/--no-abbrev in --list mode

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 10, 2017, 16:45 UTC
Message-ID
<xmqqinnhytb0.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<4d09ad56-96ac-75d3-c9df-0c23b805b478@gmail.com>
Jakub Narębski <jnareb@gmail.com> writes:
Show 21 quoted lines
> W dniu 08.03.2017 o 23:16, Junio C Hamano pisze:
>  
>> diff --git a/builtin/branch.c b/builtin/branch.c
>> index cbaa6d03c0..537c47811a 100644
>> --- a/builtin/branch.c
>> +++ b/builtin/branch.c
>> @@ -335,9 +335,18 @@ static char *build_format(struct ref_filter *filter, int maxwidth, const char *r
>>  		    branch_get_color(BRANCH_COLOR_CURRENT));
>>  
>>  	if (filter->verbose) {
>> +		struct strbuf obname = STRBUF_INIT;
>> +
>> +		if (filter->abbrev < 0)
>> +			strbuf_addf(&obname, "%%(objectname:short)");
>> +		else if (!filter->abbrev)
>> +			strbuf_addf(&obname, "%%(objectname)");
>> +		else
>> +			strbuf_addf(&obname, " %%(objectname:short=%d) ", filter->abbrev);
>                                               ^                       ^
> I wonder why the last one has leading space --/ and trailing one -----/
> The rest (for default abbrev and for no abbrev do not).

Thanks for spotting; that's just an editor cruft that shouldn't have been there.

Previous: Jakub NarębskiNext: Guillaume Wenzek
Message 6 of 8 in “BUG Report: git branch ignore --no-abbrev flag”
  1. Guillaume WenzekMar 8, 2017
  2. Junio C HamanoMar 8, 2017
  3. Junio C HamanoMar 8, 2017
  4. branch: honor --abbrev/--no-abbrev in --list modeJunio C Hamano, Mar 8, 2017
  5. Jakub NarębskiMar 9, 2017
  6. Junio C HamanoMar 10, 2017
  7. Guillaume WenzekMar 9, 2017
  8. Jeff KingMar 9, 2017

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.