From: "Carlos Martín Nieto" <cmn@elego.de>
To: Bert Wesarg <bert.wesarg@googlemail.com>
Cc: Junio C Hamano <gitster@pobox.com>,
Git Mailing List <git@vger.kernel.org>
Subject: Re: git grep --no-index and absolute paths don't work?
Date: Fri, 21 Oct 2011 09:09:33 +0200 [thread overview]
Message-ID: <1319180973.5352.8.camel@bee.lab.cmartin.tk> (raw)
In-Reply-To: <CAKPyHN138OZRt_3PT5ChuTpSEuOdybnyAj8Baqr=3OD=y==jgw@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1058 bytes --]
On Fri, 2011-10-21 at 08:34 +0200, Bert Wesarg wrote:
> Hi,
>
> I'm currently totally confused, that a
>
> git grep --no-index foo /usr/include
>
> does not work. I know that the documentation says "in the current
> directory" for the --no-index flag. But this does not work ether:
The rest of the sentence reads ", not just those tracked by git" which
implies that the files tracked by git are also searched. This requires a
git repository.
>
> cd ~; git grep --no-index foo ~/.bashrc
>
> They all fail with 'is outside repository'. Which is for itself vary
> misleading, because I intentionally said --no-index.
Git is a tool that works on git repositories. Some commands may work
outside of a repository, like ls-remote when given an URL or init (for
obvious reasons) but it's not something that should be expected,
especially for commands that read files from the working tree.
Why are you trying to use git's grep command outside a repository? Why
isn't 'grep -nr foo /usr/include/' good enough?
cmn
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 490 bytes --]
next prev parent reply other threads:[~2011-10-21 7:09 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-21 6:34 git grep --no-index and absolute paths don't work? Bert Wesarg
2011-10-21 7:09 ` Carlos Martín Nieto [this message]
2011-10-21 11:49 ` Lars Noschinski
2011-10-21 12:44 ` Bert Wesarg
2011-10-21 17:00 ` Junio C Hamano
2011-10-21 17:35 ` Bert Wesarg
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=1319180973.5352.8.camel@bee.lab.cmartin.tk \
--to=cmn@elego.de \
--cc=bert.wesarg@googlemail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/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).