git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nazri Ramliy <ayiehere@gmail.com>
To: Git Mailing List <git@vger.kernel.org>
Subject: "git grep --no-index" doesn't do what it says on the tin?
Date: Wed, 15 May 2013 13:32:51 +0800	[thread overview]
Message-ID: <CAEY4ZpP8txhCCmw-Ck7_rQL+Xn4bJw-RgVa7iDaHzQ6mcS5oLQ@mail.gmail.com> (raw)

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

             reply	other threads:[~2013-05-15  5:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-15  5:32 Nazri Ramliy [this message]
2013-05-15  6:54 ` "git grep --no-index" doesn't do what it says on the tin? Antoine Pelisse

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAEY4ZpP8txhCCmw-Ck7_rQL+Xn4bJw-RgVa7iDaHzQ6mcS5oLQ@mail.gmail.com \
    --to=ayiehere@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).