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

Re: [PATCH] log: if --decorate is not given, default to --decorate=auto

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 21, 2017, 22:28 UTC
Message-ID
<xmqqzigemfij.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<xmqqinn2sfdw.fsf@gitster.mtv.corp.google.com>
Junio C Hamano <gitster@pobox.com> writes:
Show 12 quoted lines
>>  test_expect_success 'log.decorate configuration' '
>> -	git log --oneline >expect.none &&
>> +	git log --oneline --no-decorate >expect.none &&
>>  	git log --oneline --decorate >expect.short &&
>>  	git log --oneline --decorate=full >expect.full &&
>
> This ensures that an explicit --no-decorate from the command line
> does give "none" output, which we failed to do so far, and is a good
> change.  Don't we also need a _new_ test to ensure that "auto" kicks
> in without any explicit request?  Knowing the implementation that
> pager-in-use triggers the "auto" behaviour, perhaps testing the
> output from "git -p log" would be sufficient?
BTW,
Show 5 quoted lines
>  
> +static int auto_decoration_style()
> +{
> +	return (isatty(1) || pager_in_use()) ? DECORATE_SHORT_REFS : 0;
> +}
FYI, I fixed this to
	static int auto_decoration_style(void)
while queuing to make it compile.
Previous: Junio C HamanoNext: Alex Henrie
Message 3 of 13 in “log: if --decorate is not given, default to --decorate=auto”
  1. log: if --decorate is not given, default to --decorate=autoAlex Henrie, Mar 21, 2017
  2. Junio C HamanoMar 21, 2017
  3. Junio C HamanoMar 21, 2017
  4. Alex HenrieMar 22, 2017
  5. Junio C HamanoMar 22, 2017
  6. Alex HenrieMar 23, 2017
  7. Junio C HamanoMar 23, 2017
  8. Alex HenrieMar 23, 2017
  9. Junio C HamanoMar 23, 2017
  10. Alex HenrieMar 24, 2017
  11. Jeff KingMar 24, 2017
  12. pager_in_use: use git_env_bool()Jeff King, Mar 24, 2017
  13. Junio C HamanoMar 24, 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.