git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git locate

From
John Tapsell <johnflux@gmail.com>
Date
Jun 2, 2010, 05:00 UTC
Message-ID
<AANLkTim6cLkr5BFTRTh2nZGwsfVgHZi3M-b9IER8dHf3@mail.gmail.com>
In-Reply-To
<fabb9a1e1002150520v29cf8d59ke27cde3e9697b011@mail.gmail.com>
On 15 February 2010 22:20, Sverre Rabbelier <srabbelier@gmail.com> wrote:
Show 11 quoted lines
> Heya,
>
> On Thu, Jan 21, 2010 at 01:11, SungHyun Nam <goweol@gmail.com> wrote:
>> 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
Previous: Sverre RabbelierNext: John Tapsell
Message 12 of 17 in “git locate”
  1. John TapsellJan 20, 2010
  2. Johannes SchindelinJan 20, 2010
  3. Jakub NarebskiJan 20, 2010
  4. Johannes SchindelinJan 20, 2010
  5. Jakub NarebskiJan 20, 2010
  6. John TapsellJan 20, 2010
  7. Johannes SchindelinJan 20, 2010
  8. SungHyun NamJan 21, 2010
  9. Michael J GruberJan 21, 2010
  10. Štěpán NěmecJan 21, 2010
  11. Sverre RabbelierFeb 15, 2010
  12. John TapsellJun 2, 2010
  13. John TapsellJun 2, 2010
  14. Bruce StephensJun 2, 2010
  15. Matthieu MoyJun 2, 2010
  16. Clemens BuchacherJun 3, 2010
  17. Nguyen Thai Ngoc DuyJun 2, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.