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

Re: [PATCH] add GIT_PATHSPEC_GLOB environment variable

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 19, 2012, 22:00 UTC
Message-ID
<7v7god8zz0.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20121219215008.GA17908@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
> I included the common_prefix fix you mentioned (I do not think it
> produced incorrect results as it was, but it did not take full advantage
> of an optimization).

I do not think it would have affected the outcome; you would only have worked with more cycles.

> Subject: add GIT_PATHSPEC_GLOB environment variable
Seems cleanly done from a quick look.

Given that the normal mode of operation is to use globbing, I suspect that the names would have been more natural if the toggle were GIT_PATHSPEC_LITERAL and the boolean function were limit_pathspec_to_literal(), instead of "allow_pathspec_glob()", sounding as if using glob is done only upon request.

But that is a minor issue.
Show 6 quoted lines
> This patch introduces an environment variable to turn all
> pathspecs into literal strings. This makes it easy to turn
> off the globbing behavior for a whole environment (e.g., if
> you are serving repos via a web interface that is only going
> to use literal programmatic pathspecs), or for a particular
> run.

I am not sure if "web interface" is a particularly good example, though. Is it unusual to imagine a Web UI that takes pathspecs from the user to limit its output (e.g. "diff" or "ls-tree") to those paths that match them? In such a case, the user would expect their pathspecs to work the same way as the Git installed on their desktop, I would think.

Will queue; thanks.
Previous: Jeff KingNext: Jeff King
Message 5 of 18 in “add core.pathspecGlob config option”
  1. add core.pathspecGlob config optionJeff King, Dec 19, 2012
  2. Junio C HamanoDec 19, 2012
  3. Jeff KingDec 19, 2012
  4. add GIT_PATHSPEC_GLOB environment variableJeff King, Dec 19, 2012
  5. Junio C HamanoDec 19, 2012
  6. Jeff KingDec 19, 2012
  7. Junio C HamanoDec 19, 2012
  8. Jeff KingDec 19, 2012
  9. Jeff KingDec 19, 2012
  10. Junio C HamanoDec 19, 2012
  11. Jeff KingDec 19, 2012
  12. Nguyen Thai Ngoc DuyDec 20, 2012
  13. Jeff KingDec 20, 2012
  14. Junio C HamanoDec 20, 2012
  15. Jeff KingDec 20, 2012
  16. Jeff KingDec 20, 2012
  17. Jeff KingDec 20, 2012
  18. Junio C HamanoDec 20, 2012

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.