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

Re: [PATCH 2/2] add--interactive.perl: specify --no-color explicitly

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 8, 2020, 16:25 UTC
Message-ID
<xmqqo8mgz150.fsf@gitster.c.googlers.com>
In-Reply-To
<20200907082510.GA1264377@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 14 quoted lines
> By the way, this is an instance of a more generic bug, which is that:
>
>   git -p my-script
>
> will cause any sub-programs of git-my-script to think their stdout is
> going to a pager, even if my-script redirects them to a file or another
> pipe.
>
> I had a solution long ago in:
>
>   https://lore.kernel.org/git/20150810052353.GB15441@sigill.intra.peff.net/
>
> but it raises a bunch of interesting portability questions. Since this
> comes up so rarely, I never really pursued it further.

That indeed is from long ago ;-) and I still kind of like it. Is the issue that some platforms do not even have inum of the "thing" connected to a file descriptor? I think a fallback code for such a system can just return a constant pipe ID to anybody asks, so that an exported GIT_PAGER_PIPE_ID would always match, which gives the behaviour identical to what we currently do with GIT_PAGER_IN_USE, and that would be one way to help those capable of giving useful IDs while not harming others.

Thanks.
Previous: Jeff KingNext: Johannes Schindelin
Message 5 of 7 in “some minor add--interactive fixes”
  1. 0/2 some minor add--interactive fixesJeff King, Sep 7, 2020
  2. 1/2 add-patch: fix inverted return code of repo_read_index()Jeff King, Sep 7, 2020
  3. 2/2 add--interactive.perl: specify --no-color explicitlyJeff King, Sep 7, 2020
  4. Jeff KingSep 7, 2020
  5. Junio C HamanoSep 8, 2020
  6. Johannes SchindelinSep 8, 2020
  7. Jeff KingSep 9, 2020

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.