From: Carsten Mattner <carstenmattner@googlemail.com>
To: Felipe Contreras <felipe.contreras@gmail.com>
Cc: git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>,
Jeff King <peff@peff.net>
Subject: Re: [PATCH 0/2] completion: backwards compatibility fix
Date: Sun, 20 May 2012 19:27:20 +0200 [thread overview]
Message-ID: <CACY+Hvrj_out4Lm+8Wi3egdc+bs4MWLpVy2X98Uo__r3mSpBOQ@mail.gmail.com> (raw)
In-Reply-To: <CAMP44s2sJaW-n7EGTu+hNNkaEnGkk7wKDQD56bgq2=qeeFqWrw@mail.gmail.com>
On Sun, May 20, 2012 at 12:28 PM, Felipe Contreras
<felipe.contreras@gmail.com> wrote:
> On Sun, May 20, 2012 at 11:02 AM, Carsten Mattner
> <carstenmattner@googlemail.com> wrote:
>> On Sat, May 19, 2012 at 4:41 AM, Felipe Contreras
>> <felipe.contreras@gmail.com> wrote:
>>> Hi,
>>>
>>> These two patches are meant to fix the backwards compatibility of _git, and
>>> _gitk. This also helps my zsh's wrapper.
>>>
>>> Felipe Contreras (2):
>>> completion: rename _git and _gitk
>>> completion: add support for backwards compatibilit
>>>
>>> contrib/completion/git-completion.bash | 22 +++++++++++++++++-----
>>> t/t9902-completion.sh | 2 +-
>>> 2 files changed, 18 insertions(+), 6 deletions(-)
>>>
>>> --
>>> 1.7.10.2
>>>
>>
>> Thanks Felipe. With the 2 patches applied all the following
>> completion definitions work.
>>
>> complete -o bashdefault -o default -o nospace -F _git g 2>/dev/null \
>> || complete -o default -o nospace -F _git g
>> __git_complete g _git
>> __git_complete g _main_git
>>
>> Ignoring backwards compatibility, which one would you suggest
>> I use? Keep in mind that I originally copied the first
>> long completion defintion from git-completion.bash a long time
>> ago.
>
> I would use '__git_complete g _git', but keep in mind that none of
> these forms have a promise to stay. Eventually the final one would be
> '_GIT_complete g _git' (hopefully), but if you want to be safe from
> changes maybe the first (original) would be best; even though there's
> no promise it won't break, we would probably try our best not to break
> it (again).
What about adding a small note at the top of the completion script
together with the other documentation? Does it make sense to keep
the known to work and public invocation in there?
> BTW. If your system has the '-o bashdefault' option you probably don't
> need the full form, just:
> % complete -o bashdefault -o default -o nospace -F _git g
>
> Or if your system doesn't:
> % complete -o default -o nospace -F _git g
I like the short versions. They seem to work.
prev parent reply other threads:[~2012-05-20 17:27 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-19 2:41 [PATCH 0/2] completion: backwards compatibility fix Felipe Contreras
2012-05-19 2:41 ` [PATCH 1/2] completion: rename _git and _gitk Felipe Contreras
2012-05-22 8:24 ` SZEDER Gábor
2012-05-22 18:00 ` Junio C Hamano
2012-05-22 18:52 ` Felipe Contreras
2012-05-19 2:41 ` [PATCH 2/2] completion: add support for backwards compatibility Felipe Contreras
2012-05-19 2:45 ` [PATCH 0/2] completion: backwards compatibility fix Jeff King
2012-05-19 7:54 ` Carsten Mattner
2012-05-19 15:31 ` Jeff King
2012-05-19 17:45 ` Carsten Mattner
2012-05-20 5:11 ` Junio C Hamano
2012-05-20 9:02 ` Carsten Mattner
2012-05-20 10:28 ` Felipe Contreras
2012-05-20 17:27 ` Carsten Mattner [this message]
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=CACY+Hvrj_out4Lm+8Wi3egdc+bs4MWLpVy2X98Uo__r3mSpBOQ@mail.gmail.com \
--to=carstenmattner@googlemail.com \
--cc=felipe.contreras@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=peff@peff.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).