git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: John Tapsell <johnflux@gmail.com>
To: Git List <git@vger.kernel.org>
Subject: Re: git locate
Date: Wed, 2 Jun 2010 14:00:27 +0900	[thread overview]
Message-ID: <AANLkTim6cLkr5BFTRTh2nZGwsfVgHZi3M-b9IER8dHf3@mail.gmail.com> (raw)
In-Reply-To: <fabb9a1e1002150520v29cf8d59ke27cde3e9697b011@mail.gmail.com>

On 15 February 2010 22:20, Sverre Rabbelier <srabbelier@gmail.com> wrote:
> 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

  reply	other threads:[~2010-06-02  5:01 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-20  1:17 git locate John Tapsell
2010-01-20  1:24 ` Johannes Schindelin
2010-01-20  2:14   ` Jakub Narebski
2010-01-20  9:32     ` Johannes Schindelin
2010-01-20 10:06       ` Jakub Narebski
2010-01-20 11:07         ` John Tapsell
2010-01-20 11:43         ` Johannes Schindelin
2010-01-21  0:11       ` SungHyun Nam
2010-01-21  9:42         ` Michael J Gruber
2010-01-21  9:51         ` Štěpán Němec
2010-02-15 13:20         ` Sverre Rabbelier
2010-06-02  5:00           ` John Tapsell [this message]
2010-06-02 10:02             ` John Tapsell
2010-06-02 10:23               ` Bruce Stephens
2010-06-02 11:27                 ` Matthieu Moy
2010-06-03 13:39                 ` Clemens Buchacher
2010-06-02 11:29               ` Nguyen Thai Ngoc Duy

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=AANLkTim6cLkr5BFTRTh2nZGwsfVgHZi3M-b9IER8dHf3@mail.gmail.com \
    --to=johnflux@gmail.com \
    --cc=git@vger.kernel.org \
    /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).