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

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
Previous: Michael J GruberNext: Junio C Hamano
Message 6 of 19 in “Add two grep config options”
  1. Add two grep config optionsJoe Ratterman, Mar 25, 2011
  2. Junio C HamanoMar 25, 2011
  3. Michael J GruberMar 28, 2011
  4. Jeff KingMar 28, 2011
  5. Michael J GruberMar 28, 2011
  6. Jeff KingMar 28, 2011
  7. Junio C HamanoMar 28, 2011
  8. Jeff KingMar 28, 2011
  9. Junio C HamanoMar 28, 2011
  10. Joe RattermanMar 28, 2011
  11. Bert WesargMar 28, 2011
  12. Joe RattermanMar 28, 2011
  13. Junio C HamanoMar 28, 2011
  14. grep: allow -E and -n to be turned on by default via configurationJunio C Hamano, Mar 28, 2011
  15. Junio C HamanoMar 28, 2011
  16. Joe RattermanMar 28, 2011
  17. Junio C HamanoMar 28, 2011
  18. Joe RattermanMar 29, 2011
  19. grep: allow -E and -n to be turned on by default via configurationJoe Ratterman, Mar 30, 2011

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.