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
Junio C Hamano <gitster@pobox.com>
Date
Mar 30, 2017, 21:54 UTC
Message-ID
<xmqq1ste2zwu.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<20170330213358.qjsobjcbons66skf@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 8 quoted lines
> On Thu, Mar 30, 2017 at 11:03:51AM -0700, Junio C Hamano wrote:
>
>> With the "--decorate=auto" option becoming the default for "git
>> log", "git tbdiff" will be broken.
>> ...
> 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"?
Interesting.  Yes, I do use 
    [pager]
	tbdiff
in my ~/.gitconfig file.
    $ git tbdiff ..@{-1} @{-1}..

is one of the most frequently used commands in my ~/.bash_history these days [*1*]. I by accident has been running the 'master' version (not my private edition 'jch' that is a bit ahead of 'next') for the past few weeks, and I just switched back to using the 'jch' version so that I can say

    $ git tbdiff ..- -..
instead, and that is when I noticed we broke "tbdiff".
Show 9 quoted lines
> 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.
Yes, that might be necessary.
[Footnote]
*1* The general flow to accept a reroll of a topic "au/topic" goes
    like this:
    $ git checkout au/topic
    $ git log master.. ;# to remind me what it was about
    $ git checkout master... ;# to go back to the original base
    $ Meta/CP ./+au-topic.mbox ;# run checkpatch
    $ git am -s3c
    $ git tbdiff ..@{-1} @{-1}..
    Then if the initial N patches are identical, e.g. when the
    output of tbdiff begins like this:
     1: f6d8dfd8b6 =  1: d681cf5ada do not check odb_mkstemp return value for errors
     2: 52dcad2c2e =  2: abf30edce4 odb_mkstemp: write filename into strbuf
     3: 033d6ae6cb =  3: 38fceca547 odb_mkstemp: use git_path_buf
     4: 55e3179076 !  4: 344267b632 diff: avoid fixed-size buffer for patch-ids
        @@ ... @@
    $ git rebase --onto 033d6ae6cb 38fceca547
    $ git tbdiff ..@{-1} @{-1}..
    That way, I can preserve the author and committer timestamps of
    the earlier part that did not change.
Previous: Jeff King
Message 6 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.