Re: [PATCH] Add two grep config options
- From
Jeff King <peff@peff.net>
- Date
- Mar 28, 2011, 12:09 UTC
- Message-ID
- <20110328120938.GA14198@sigill.intra.peff.net>
- In-Reply-To
- <4D90787A.8010403@drmicha.warpmail.net>
On Mon, Mar 28, 2011 at 02:00:58PM +0200, Michael J Gruber wrote:
Show 13 quoted lines
> >> We could safeguard scripts from this by > >> > >> - checking istty and > >> - checking env for GIT_PLUMBING > > > > I'm not sure isatty is a good check. In the example above, grep's output > > was not going to a tty, but I did want to respect the user's choice of > > "-E". > > I'm not saying it's good either, but it is something that a new git > (i.e. between the time we introduce ui.* and GIT_PLUMBING/--no-plum and > the time we rely on the latter) could do to make use of (and promote) > the new ui.* options.
The example I gave was a false negative (we could have used the user's preference but the isatty check said no). Which is OK for a transitional period, because we err on the side of being conservative. But I wonder if there are false positives (i.e., cases where the isatty check says it's OK, but we are breaking a script). Maybe something where the script prepares a BRE to hand to git-grep, but we want to show the user the output in their usual way.
That seems pretty contrived, though. Maybe it is a non-issue.
-Peff