git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "brian m. carlson" <sandals@crustytoothpaste.net>
Cc: Ramkumar Ramachandra <artagnon@gmail.com>,
	Git List <git@vger.kernel.org>
Subject: Re: [PATCH v2 1/4] completion: prioritize ./git-completion.bash
Date: Fri, 03 Jan 2014 15:03:00 -0800	[thread overview]
Message-ID: <xmqqtxdkllcr.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <20140103225541.GG3338@vauxhall.crustytoothpaste.net> (brian m. carlson's message of "Fri, 3 Jan 2014 22:55:41 +0000")

"brian m. carlson" <sandals@crustytoothpaste.net> writes:

> On Fri, Jan 03, 2014 at 01:30:28PM +0530, Ramkumar Ramachandra wrote:
>> To ease development, prioritize ./git-completion.bash over other
>> standard system paths.
>> 
>> Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
>> ---
>>  contrib/completion/git-completion.zsh | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/contrib/completion/git-completion.zsh b/contrib/completion/git-completion.zsh
>> index fac5e71..6fca145 100644
>> --- a/contrib/completion/git-completion.zsh
>> +++ b/contrib/completion/git-completion.zsh
>> @@ -30,10 +30,10 @@ if [ -z "$script" ]; then
>>  	local -a locations
>>  	local e
>>  	locations=(
>> +		$(dirname ${funcsourcetrace[1]%:*})/git-completion.bash
>>  		'/etc/bash_completion.d/git' # fedora, old debian
>>  		'/usr/share/bash-completion/completions/git' # arch, ubuntu, new debian
>>  		'/usr/share/bash-completion/git' # gentoo
>> -		$(dirname ${funcsourcetrace[1]%:*})/git-completion.bash
>>  		)
>>  	for e in $locations; do
>>  		test -f $e && script="$e" && break
>
> I'm not clear on this change.  It looks like this loads
> git-completion.bash from the same directory as git-completion.zsh.  Is
> this correct?

I think the idea is to help those who have installed a closer to
bleeding-edge version of completion scripts --- they will not be
reading their zsh completions from the system default locations,
and the place next to it would be a place more likely to have the
matching bleeding-edge version of bash completion than the system
default place.

> Your commit message says "./", and if that's the case, it
> has the same security problems as putting "." first in your PATH.

A correct observation. I think

	Subject: zsh completion: find matching custom bash completion

	If zsh completion is being read from a location that is
	different from system-wide default, it is likely that the
	user is trying to use a custom version, perhaps closer to
	the bleeding edge, installed in her own directory. We will
	more likely to find the matching bash completion script in
	the same directory than in those system default places.

would probably a lot closer to what the patch really does.

  reply	other threads:[~2014-01-03 23:03 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-03  8:00 [PATCH v2 0/4] Fix branch.autosetup(merge|rebase) completion Ramkumar Ramachandra
2014-01-03  8:00 ` [PATCH v2 1/4] completion: prioritize ./git-completion.bash Ramkumar Ramachandra
2014-01-03 22:55   ` brian m. carlson
2014-01-03 23:03     ` Junio C Hamano [this message]
2014-01-05 10:08     ` Ramkumar Ramachandra
2014-01-03  8:00 ` [PATCH v2 2/4] completion: introduce __gitcomp_2 () Ramkumar Ramachandra
2014-01-03  8:00 ` [PATCH v2 3/4] completion: fix branch.autosetup(merge|rebase) Ramkumar Ramachandra
2014-01-03  8:00 ` [PATCH v2 4/4] completion: fix remote.pushdefault Ramkumar Ramachandra

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=xmqqtxdkllcr.fsf@gitster.dls.corp.google.com \
    --to=gitster@pobox.com \
    --cc=artagnon@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=sandals@crustytoothpaste.net \
    /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).