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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]