threads / discuss / 20379

is there a 'git find'?

Subject: is there a 'git find'?

## tl;dr

3 messages between Aug 5, 2009 and Aug 5, 2009.

replies: 2people: 3as markdown or json

E R· Aug 5, 2009, 04:14 UTC · lore
Hi,

Within a specific commit I'd like to find all the files whose path names match a regular expression.

Without checking out the commit, is there a way to do this? I'd like to add this feature to gitweb.

Thanks,
ER
Sverre Rabbelier· Aug 5, 2009, 04:37 UTC · re: E R · lore

Re: is there a 'git find'?

Heya,
On Tue, Aug 4, 2009 at 21:14, E R<pc88mxer@gmail.com> wrote:
> Within a specific commit I'd like to find all the files whose path
> names match a regular expression.
Try 'git ls-files' [0].
[0] https://www.cs.drexel.edu/cgi-bin/manServer.pl/usr/share/man/man1/git-ls-files.1
-- 
Cheers,

Sverre Rabbelier
Junio C Hamano· Aug 5, 2009, 04:38 UTC · re: E R · lore

Re: is there a 'git find'?

E R <pc88mxer@gmail.com> writes:
> Within a specific commit I'd like to find all the files whose path
> names match a regular expression.
    git ls-tree -r [--name-only | -t] "$commit" | grep -e "$pattern"
?

← back to recent threads