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

Re: grep --no-index and pathspec

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 11, 2011, 18:27 UTC
Message-ID
<7v8vxm1l6q.fsf@alter.siamese.dyndns.org>
In-Reply-To
<4D55500B.1070603@drmicha.warpmail.net>
Michael J Gruber <git@drmicha.warpmail.net> writes:
Show 6 quoted lines
> "grep --no-index" and "grep" have different codepaths for looking up the
> files/blobs. If I read that correctly then "grep --no-index -- pathspec"
> only does a literal match at the left boundary, whereas for the normal
> mode glob patterns are allowed.
>
> CC'ing Junio who created "--no-index".

Anything with --no-index is a quick hack, so I wouldn't be surprised if it ignored the normal pathspec logic. As I do not recall the details of the particular codepath and offhand do not know how involved a change to pay proper attention to the pathspecs would be, but I suspect that it would be more appropriate to fix it on top of nd/struct-pathspec topic than writing the current behaviour down in the documentation outside of BUGS section as if it were a feature ;-).

Previous: Michael J GruberNext: Junio C Hamano
Message 4 of 8 in “grep --no-index and pathspec”
  1. Lars NoschinskiFeb 11, 2011
  2. Michael J GruberFeb 11, 2011
  3. grep.txt: document pathspec for --no-indexMichael J Gruber, Feb 11, 2011
  4. Junio C HamanoFeb 11, 2011
  5. Junio C HamanoFeb 11, 2011
  6. Nguyen Thai Ngoc DuyFeb 12, 2011
  7. Junio C HamanoFeb 12, 2011
  8. Nguyen Thai Ngoc DuyFeb 12, 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.