Re: git-grep to operate across who repository and not just CWD?

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

 



David Chanters venit, vidit, dixit 28.02.2011 01:17:
> Hi all,
> 
> [ Please Cc me as I am not subscribed to this list, thanks. ]
> 
> I'm wondering if there's an easy way to get git-grep (and I suppose
> other commands which operate on a per-repository level rather than
> per-tree) to work across the whole repository?
> 
> Often I will be in the depths of my git repository, run "git grep
> --options 'search string'", to find no results.  Of course, then I
> remember that git grep doesn't work across the whole repository, it
> works like normal grep, and only considers the CWD onwards.
> Typically I end up cursing, using {push,pop}d to recall where I am,
> cd'ing to the root of the repository and running "git grep" from there
> and then poping my CWD to go back to where I was.
> 
> Is there some clever trickery or command-line flag I've not read about
> in the "git-grep" man page to make this idea more seamless?

git grep -- $(git rev-parse --show-cdup)

is the best we have right now. I think we're still looking for a good
way to denote "root of repo" (like "." for cwd).

Also, we're thinking of changing a few defaults (to repo-wide), but "git
grep" is meant to stay close to ordinary grep.

Michael
--
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]