git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Nieder <jrnieder@gmail.com>
To: Felipe Contreras <felipe.contreras@gmail.com>
Cc: git@vger.kernel.org, "SZEDER Gábor" <szeder@ira.uka.de>,
	"Junio C Hamano" <gitster@pobox.com>,
	"Thomas Rast" <trast@student.ethz.ch>
Subject: Re: [PATCH v3] completion: add new _GIT_complete helper
Date: Sat, 5 May 2012 10:54:23 -0500	[thread overview]
Message-ID: <20120505155423.GA14684@burratino> (raw)
In-Reply-To: <1336231400-6878-1-git-send-email-felipe.contreras@gmail.com>

Felipe Contreras wrote:

> Since v3:
>
>  * Rename to _GIT_complete to follow bash completion "guidelines"
>  * Get rid of foo_wrap name

Thanks.  Gábor, does the "all caps _GIT_ prefix for public API
functions" convention look like one we should adopt?  If I understand
correctly, previously contrib/completion/git-completion.bash used
leading double underscores for everything except completion functions,
so this is a change.

Following a convention similar to the bash-completion project's
proposed future convention doesn't really help compatibility.  If we
want to be able to include this function in that project without
change some day, we'd have to call it _BC_git_complete. :)

I personally would be happier with a git_complete function provided
by another script, like this:

	contrib/completion/git-completion.bash:

		__git_complete () {
			...
		}

	contrib/completion/bash-helpers.bash:

		git_complete () {
			__git_complete "$@"
		}

One might object that if the user includes bash-helpers.bash (name is
just a strawman) in .bashrc for interactive shells because he is
defining some custom completion functions,

	git<TAB>

would show the git_complete function.  I think that's fine.  Maybe
the user would enjoy the reminder.  git<TAB> also shows any
dashed-form git commands that happen to be on the $PATH.

Please don't take this as a strong objection.  Maybe the
user-unfriendly version would be called _GIT_complete and someone
interested can provide the friendly git_complete and git_ps1 wrappers
separately, for example.  I just think it is worth thinking carefully
and being consistent about.

Hope that helps,
Jonathan

  reply	other threads:[~2012-05-05 15:54 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-05 15:23 [PATCH v3] completion: add new _GIT_complete helper Felipe Contreras
2012-05-05 15:54 ` Jonathan Nieder [this message]
2012-05-05 16:38   ` Felipe Contreras
2012-05-05 16:47     ` Jonathan Nieder
2012-05-05 16:52       ` Jonathan Nieder
2012-05-05 17:20       ` Felipe Contreras
2012-05-05 17:33         ` Jonathan gives feedback --> flamewars inevitable? (Re: [PATCH v3] completion: add new _GIT_complete helper) Jonathan Nieder
2012-05-05 18:23           ` Felipe Contreras
2012-05-05 18:39             ` Jonathan gives feedback --> flamewars inevitable? Jonathan Nieder
2012-05-05 18:42             ` Jonathan Nieder
2012-05-06  5:23           ` Jonathan gives feedback --> flamewars inevitable? (Re: [PATCH v3] completion: add new _GIT_complete helper) Tay Ray Chuan
2012-05-14  9:11             ` Felipe Contreras
2012-05-05 17:44         ` [PATCH v3] completion: add new _GIT_complete helper Jonathan Nieder
2012-05-06 10:30   ` SZEDER Gábor
2012-05-06 20:47     ` Jonathan Nieder
2012-05-06 11:14 ` SZEDER Gábor
2012-05-06 11:30   ` SZEDER Gábor
2012-05-06 11:36     ` SZEDER Gábor
2012-05-06 12:12   ` SZEDER Gábor
2012-05-06 20:53     ` Felipe Contreras
2012-05-06 20:37   ` Felipe Contreras
2012-05-06 23:32     ` SZEDER Gábor
2012-05-07  0:20       ` Felipe Contreras
2012-05-07  9:22         ` SZEDER Gábor

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=20120505155423.GA14684@burratino \
    --to=jrnieder@gmail.com \
    --cc=felipe.contreras@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=szeder@ira.uka.de \
    --cc=trast@student.ethz.ch \
    /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).