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

"git grep --no-index" doesn't do what it says on the tin?

From
Nazri Ramliy <ayiehere@gmail.com>
Date
May 15, 2013, 05:32 UTC
Message-ID
<CAEY4ZpP8txhCCmw-Ck7_rQL+Xn4bJw-RgVa7iDaHzQ6mcS5oLQ@mail.gmail.com>
Hi,
>From "git help grep":
      --no-index
           Search files in the current directory that is not managed by Git.
       --untracked
           In addition to searching in the tracked files in the working tree,
           search also in untracked files.
>From the description above I would think that "git grep --no-index"

and "git grep --untracked" would behave differently, but it seems like their behavior is the same:

        $ cd ~/src/git
        $ echo superman >> git.c
        $ echo superman >> foo.txt
        $ git grep --no-index superman
        foo.txt:1:superman
        git.c:588:superman
        $ git grep --untracked superman
        foo.txt:1:superman
        git.c:588:superman
I would expect the following behavior for "git grep --no-index":
        $ git grep --no-index superman
        foo.txt:1:superman
        $
That is, it won't search inside files that are managed by git.
nazri
Next: Antoine Pelisse
Message 1 of 2 in “"git grep --no-index" doesn't do what it says on the tin?”
  1. Nazri RamliyMay 15, 2013
  2. Antoine PelisseMay 15, 2013

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.