From: Felipe Contreras <felipe.contreras@gmail.com>
To: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] completion: add new zsh completion
Date: Mon, 30 Jan 2012 13:28:19 +0200 [thread overview]
Message-ID: <CAMP44s2MmqEeyvztk8_3q9Ms_-su0D12GYD_LLWCKPAmb2ZKXg@mail.gmail.com> (raw)
In-Reply-To: <CAMP44s3QeZuXrR=UE4qvDadu66Cmi-txmSps8Ow24om27URxOg@mail.gmail.com>
On Mon, Jan 30, 2012 at 12:59 PM, Felipe Contreras
<felipe.contreras@gmail.com> wrote:
> On Mon, Jan 30, 2012 at 10:39 AM, Matthieu Moy
> <Matthieu.Moy@grenoble-inp.fr> wrote:
>> Felipe Contreras <felipe.contreras@gmail.com> writes:
>>
>>> +ZSH_VERSION='' . /usr/share/git/completion/git-completion.bash
>>
>> Probably stating the obvious, but this path shouldn't be hardcoded.
>>
>> Something along the lines of
>>
>> ZSH_VERSION='' . $(dirname ${funcsourcetrace[1]%:*})/git-completion.bash
>>
>> should do it (mostly untested, and written by a non-ZSH expert).
>
> Yes, it's hard-coded, because there's no way to know where is this
> file. In my case, it's on ~/.git-completion.sh, and this one that I am
> proposing sits in ~/.zsh/completion/_zsh, so your proposal breaks
> things completely for me.
>
> I will think about it, but I think for now, users of this script
> should set that manually--if for some reason they don't want to use
> the default.
>
> Maybe we should use zstyle so they can configure it on their .zshrc?
This seems to do the trick:
zstyle -s ":completion:$curcontext:" script script
test -z "$script" && script="$(dirname
${funcsourcetrace[1]%:*})"/git-completion.bash
ZSH_VERSION='' . "$script"
.zshrc:
zstyle ':completion:*:*:git:*' script ~/.git-completion.sh
--
Felipe Contreras
next prev parent reply other threads:[~2012-01-30 11:28 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-30 0:01 [PATCH] completion: add new zsh completion Felipe Contreras
2012-01-30 8:39 ` Matthieu Moy
2012-01-30 10:59 ` Felipe Contreras
2012-01-30 11:28 ` Felipe Contreras [this message]
2012-01-30 11:11 ` Johannes Sixt
2012-01-30 11:32 ` Felipe Contreras
2012-01-30 18:52 ` Junio C Hamano
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=CAMP44s2MmqEeyvztk8_3q9Ms_-su0D12GYD_LLWCKPAmb2ZKXg@mail.gmail.com \
--to=felipe.contreras@gmail.com \
--cc=Matthieu.Moy@grenoble-inp.fr \
--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).