From: Junio C Hamano Date: Tue, 08 Sep 2020 16:25:31 GMT Subject: Re: [PATCH 2/2] add--interactive.perl: specify --no-color explicitly Message-ID: In-Reply-To: <20200907082510.GA1264377@coredump.intra.peff.net> Jeff King writes: > 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.