git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Felipe Contreras <felipe.contreras@gmail.com>
To: Carsten Mattner <carstenmattner@googlemail.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 12:28:35 +0200	[thread overview]
Message-ID: <CAMP44s2sJaW-n7EGTu+hNNkaEnGkk7wKDQD56bgq2=qeeFqWrw@mail.gmail.com> (raw)
In-Reply-To: <CACY+HvqhJf6ywTaDgT5ie-3iBQAGwngTYPiCvKgw6mJB=1+fOg@mail.gmail.com>

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).

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

Cheers.

-- 
Felipe Contreras

  reply	other threads:[~2012-05-20 10:28 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 [this message]
2012-05-20 17:27     ` Carsten Mattner

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAMP44s2sJaW-n7EGTu+hNNkaEnGkk7wKDQD56bgq2=qeeFqWrw@mail.gmail.com' \
    --to=felipe.contreras@gmail.com \
    --cc=carstenmattner@googlemail.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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).