Thread (14 messages) flat view 14 messages, 8 authors, 2016-06-15

Re: git locate

From: John Tapsell <hidden>
Date: 2016-06-15 22:48:53

On 15 February 2010 22:20, Sverre Rabbelier [off-list ref] wrote:
Heya,

On Thu, Jan 21, 2010 at 01:11, SungHyun Nam [off-list ref] wrote:
quoted
The alias 'git locate' and the command 'git ls-files' runs
differently if I run them in a subdirectory.
Is it expected?
I just ran into this (I wanted to alias 'git find' but to me the 'run
ls-files from cwd' is desirable. Also, I prefer to have a trailing
glob as well, so I added one :). An easy solution is to drop
'git-find' in your path somewhere:
I have finally settled on:

[alias]
    locate = !sh -c 'git ls-files | grep --color=auto "$1"' -

This acts as if there is a leading and trailing wildcard, and also
colors the output nicely.

Can we add this as default please?  There didn't seem to be any
resistance in this thread to making it default, just that nobody did
it :)

John
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help