git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* "git grep --no-index" doesn't do what it says on the tin?
@ 2013-05-15  5:32 Nazri Ramliy
  2013-05-15  6:54 ` Antoine Pelisse
  0 siblings, 1 reply; 2+ messages in thread
From: Nazri Ramliy @ 2013-05-15  5:32 UTC (permalink / raw)
  To: Git Mailing List

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: "git grep --no-index" doesn't do what it says on the tin?
  2013-05-15  5:32 "git grep --no-index" doesn't do what it says on the tin? Nazri Ramliy
@ 2013-05-15  6:54 ` Antoine Pelisse
  0 siblings, 0 replies; 2+ messages in thread
From: Antoine Pelisse @ 2013-05-15  6:54 UTC (permalink / raw)
  To: Nazri Ramliy; +Cc: Git Mailing List

On Wed, May 15, 2013 at 7:32 AM, Nazri Ramliy <ayiehere@gmail.com> wrote:
> 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.

The difference is in the "not managed by Git". Inside a repository,
they will do the same thing. But only the first can work outside a
repository.

Cheers,
Antoine

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-05-15  6:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-15  5:32 "git grep --no-index" doesn't do what it says on the tin? Nazri Ramliy
2013-05-15  6:54 ` Antoine Pelisse

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).