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

grep --no-index and pathspec

From
Lars Noschinski <lars@public.noschinski.de>
Date
Feb 11, 2011, 08:59 UTC
Message-ID
<20110211095938.360726y1zinab9gk@webmail.df.eu>
Hi everyone,

I encountered some strange behaviour with grep when using both the --no-index option and a pathspec. Glob patterns seem to be ignored:

---------- $ git grep -l --no-index . -- '*.bib' paper.bib paper.tex ex1.tex ----------

But on the other hands, leading path matches work: ---------- $ git grep -l --no-index . -- 'paper' paper.bib paper.tex ----------

Without the --no-index option, everything works fine: ---------- $ git grep -l --no-index . -- '*.bib' paper.bib ----------

This is with git version 1.7.4, but I encountered it also with the 1.7.2.3 Debian package.

   -- Lars
Next: Michael J Gruber
Message 1 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.