From: Michael J Gruber <git@drmicha•warpmail.net>
To: SungHyun Nam <goweol@gmail•com>
Cc: Git List <git@vger•kernel.org>
Subject: Re: git locate
Date: Thu, 21 Jan 2010 10:42:19 +0100 [thread overview]
Message-ID: <4B58217B.4040205@drmicha.warpmail.net> (raw)
In-Reply-To: <4B579BA8.8050000@gmail.com>
SungHyun Nam venit, vidit, dixit 21.01.2010 01:11:
> Hello,
>
> Johannes Schindelin wrote:
>>
>> On Tue, 19 Jan 2010, Jakub Narebski wrote:
>>
>>> Johannes Schindelin<Johannes.Schindelin@gmx•de> writes:
>>>
>>>> On Wed, 20 Jan 2010, John Tapsell wrote:
>>>>
>>>>> Could we add a: git locate<filename> or git find<filename>
>>>>
>>>> How about "git ls-files \*<filename>"?
>>>
>>> Or "git ls-files '*filename'...
>>>
>>> ... but how to make an (git) alias for this?
>>
>> Add something like this to your $HOME/.gitconfig:
>>
>> [alias]
>> locate = !sh -c 'git ls-files "\\*$1"' -
>
> The alias 'git locate' and the command 'git ls-files' runs
> differently if I run them in a subdirectory.
> Is it expected?
>
> [master] ~/srcs/git[299]$ git locate urls.txt
> Documentation/urls.txt
> [master] ~/srcs/git[300]$ git ls-files '*urls.txt'
> Documentation/urls.txt
> [master] ~/srcs/git[301]$ cd t
> [master] ~/srcs/git/t[302]$ git locate urls.txt
> Documentation/urls.txt
> [master] ~/srcs/git/t[303]$ git ls-files '*urls.txt'
> [master] ~/srcs/git/t[304]$
Yes, aliases with "!" are executed from the root of the worktree,
ls-files from the current wd.
Michael
next prev parent reply other threads:[~2010-01-21 9:44 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 [this message]
2010-01-21 9:51 ` Štěpán Němec
2010-02-15 13:20 ` Sverre Rabbelier
2010-06-02 5:00 ` John Tapsell
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=4B58217B.4040205@drmicha.warpmail.net \
--to=git@drmicha$(echo .)warpmail.net \
--cc=git@vger$(echo .)kernel.org \
--cc=goweol@gmail$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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