From: "SZEDER Gábor" <szeder@ira.uka.de>
To: Junio C Hamano <gitster@pobox.com>
Cc: "Shawn O. Pearce" <spearce@spearce.org>,
David Rhodes Clymer <david@zettazebra.com>,
git@vger.kernel.org
Subject: Re: [PATCH] bash: support user-supplied completion scripts for user's git commands
Date: Fri, 26 Feb 2010 16:27:10 +0100 [thread overview]
Message-ID: <20100226152710.GA17460@neumann> (raw)
In-Reply-To: <7viqakireb.fsf@alter.siamese.dyndns.org>
Hi,
On Fri, Jan 29, 2010 at 12:32:12PM -0800, Junio C Hamano wrote:
> Admittedly, we have already taken over _git_foo (and "_git") namespace,
> and anybody who uses bash with the completion support cannot write their
> own shell function with these names for purposes that are unrelated to
> completion,
Actually, the "_" namespace is taken over by bash completion in
general, so writing shell functions starting with "_" is probably
not a good idea anyway. E.g. to see all non-completion-related shell
functions you can do a "declare -F |grep -v ' _'", but if you name
shell functions not related to completion as _git_foo(), then this
will no longer work.
> so in that sense, the patch is not introducing a new problem,
> but making it a documented interface and casting it in stone will make the
> namespace contamination issue harder to rectify later.
>
> So if we were to go in the direction as the patch proposes (which I think
> is a good idea), we might want to rename them to __git_completion_foo or
> something that is less likely to collide with whatever names users might
> want to use. It is my understanding that the only published interface so
> far is __git_ps1.
I would say that __git_ps1() is the only interface that is advertised
as being public. If someone is unsatisfied with the completion
script, because he wanted completion for a custom git command or for a
frequently used plumbing command, then I bet he just reused existing
functions, e.g. when he needed refs, he just used __git_refs(), or
when he needed git log's options, he used _git_log(). I did that,
probably others too. If we were to rename completion functions, these
people's setup will break (although they will likely get merge
conflicts caused by this patch anyway). On the other hand: should we
really care that much about such users, who use non-pulic interfaces
from contrib/ ?
Having said all that, I don't really care either way. If you or Shawn
would prefer to have the completion functions renamed, I will do a
s/this/that/ preparation patch for the series. BTW, Mercurial's
completion script uses _hg_cmd_foo() for hg commands and
_hg_ext_bar() for extensions, so we might as well be a bit consistent,
and call our completion functions _git_cmd_foo().
Best,
Gábor
next prev parent reply other threads:[~2010-02-26 15:27 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-29 12:57 Custom git completion David Rhodes Clymer
2010-01-29 15:11 ` Shawn O. Pearce
2010-01-29 17:42 ` Junio C Hamano
2010-01-29 17:59 ` Shawn O. Pearce
2010-01-29 18:02 ` Junio C Hamano
2010-01-29 19:06 ` [PATCH] bash: support user-supplied completion scripts for user's git commands SZEDER Gábor
2010-01-29 19:13 ` Shawn O. Pearce
2010-01-29 20:00 ` SZEDER Gábor
2010-01-29 20:04 ` Shawn O. Pearce
2010-01-31 19:19 ` SZEDER Gábor
2010-02-23 21:02 ` [PATCH 0/4] bash: support user-supplied completion scripts for custom git commands and aliases SZEDER Gábor
2010-02-23 21:02 ` [PATCH 1/4] bash: improve aliased command recognition SZEDER Gábor
2010-02-23 22:11 ` Junio C Hamano
2010-02-24 1:04 ` SZEDER Gábor
2010-02-24 2:56 ` Junio C Hamano
2010-02-23 21:02 ` [PATCH 2/4] bash: support user-supplied completion scripts for user's git commands SZEDER Gábor
2010-02-23 21:02 ` [PATCH 3/4] bash: support user-supplied completion scripts for aliases SZEDER Gábor
2010-02-23 21:03 ` [PATCH 4/4] bash: completion for gitk aliases SZEDER Gábor
2010-01-29 20:32 ` [PATCH] bash: support user-supplied completion scripts for user's git commands Junio C Hamano
2010-02-26 15:27 ` SZEDER Gábor [this message]
2010-02-26 20:04 ` Junio C Hamano
2010-02-26 20:17 ` Shawn O. Pearce
2010-01-30 23:34 ` David Rhodes Clymer
2010-01-30 23:03 ` Custom git completion David Rhodes Clymer
2010-01-30 23:00 ` David Rhodes Clymer
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=20100226152710.GA17460@neumann \
--to=szeder@ira.uka.de \
--cc=david@zettazebra.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=spearce@spearce.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).