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

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

From
Jeff King <peff@peff.net>
Date
Mar 30, 2017, 21:33 UTC
Message-ID
<20170330213358.qjsobjcbons66skf@sigill.intra.peff.net>
In-Reply-To
<xmqqa88263qw.fsf@gitster.mtv.corp.google.com>
On Thu, Mar 30, 2017 at 11:03:51AM -0700, Junio C Hamano wrote:
Show 10 quoted lines
> With the "--decorate=auto" option becoming the default for "git
> log", "git tbdiff" will be broken.
> 
> The configuration variable has been already there, so in that sense
> this is not a new breakage (tbdiff wouldn't have worked well for
> those with configured default).  A fix is trivial (attached).
> 
> I suspect that Alex's change may uncover similar breakages in
> people's scripts.  Perhaps the topic should be cooked a bit longer
> than other topics on 'next'?

I'm confused. I thought "auto" would kick in only when we are outputting to a terminal. Or is the problem that the "is it a terminal" check is fooled by $GIT_PAGER_IN_USE, because you are running "git -p tbdiff"?

If so, this is the symptom of a more general problem, which is that a script outputting to a pager will have confused sub-processes, who do not know if their pipe is the pager one or not. Perhaps it is time to resurrect my patch from:

  http://public-inbox.org/git/20150810052353.GB15441@sigill.intra.peff.net/

I think it would need a Windows-specific variant, but the general idea is sound.

-Peff
PS I've been running git-tbdiff occasionally for years with log.decorate
   set to "true". I wonder why I haven't noticed any problems.
Previous: Junio C HamanoNext: Junio C Hamano
Message 5 of 6 in “log: if --decorate is not given, default to --decorate=auto”
  1. log: if --decorate is not given, default to --decorate=autoAlex Henrie, Mar 24, 2017
  2. Junio C HamanoMar 24, 2017
  3. Jonathan NiederMar 24, 2017
  4. Junio C HamanoMar 30, 2017
  5. Jeff KingMar 30, 2017
  6. Junio C HamanoMar 30, 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.