git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Manlio Perillo <manlio.perillo@gmail.com>
Cc: git@vger.kernel.org, szeder@ira.uka.de,
	felipe.contreras@gmail.com, peff@peff.net
Subject: Re: [PATCH v5] git-completion.bash: add support for path completion
Date: Sun, 13 Jan 2013 14:46:42 -0800	[thread overview]
Message-ID: <7vzk0chfal.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <50F15CB9.5090603@gmail.com> (Manlio Perillo's message of "Sat, 12 Jan 2013 13:53:13 +0100")

Manlio Perillo <manlio.perillo@gmail.com> writes:

>> +	# Skip "git" (first argument)
>> +	for ((i=1; i < ${#words[@]}; i++)); do
>> +		word="${words[i]}"
>> +
>> +		case "$word" in
>> +			--)
>
> Sorry, I have incorrectly (again) indented the case labels.
> I have now configured my editor to correctly indent this.

Yeah, thanks for spotting.

I wouldn't worry *too* much about the style in this script at this
point, though.  It uses a style on its own that is totally different
from the rest of the system (e.g. "[" instead of "test", semicolon
in "if ...; then", etc.) and it probably is better to emulate the
surrounding code, and leave the style "fixes" to a separate topic,
if we want to (as a contrib/ material that is not POSIX but bash
specific, I do not know if that is even worth it).

>> +				# Good; we can assume that the following are only non
>> +				# option arguments.
>> +				((c = 0))
>> +				;;
>
> Here I was thinking to do something like this (not tested):
>
> 		-*)
> 			if [ -n ${2-} ]; then
> 				# Assume specified git command only
>                                 # accepts simple options
> 				# (without arguments)
> 				((c = 0))
>
> Since git mv only accepts simple options, this will make the use of '--'
> not required.

Unless you have a file whose name begins with a dash, perhaps?

  reply	other threads:[~2013-01-13 22:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-11 18:48 [PATCH v5] git-completion.bash: add support for path completion Manlio Perillo
2013-01-11 22:02 ` Junio C Hamano
2013-01-12 14:52   ` Manlio Perillo
2013-01-13 22:56     ` Junio C Hamano
2013-01-12 12:53 ` Manlio Perillo
2013-01-13 22:46   ` Junio C Hamano [this message]
2013-04-21 10:14 ` Felipe Contreras
2013-04-23 15:25   ` Manlio Perillo
2013-04-27  2:52     ` Felipe Contreras

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=7vzk0chfal.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=felipe.contreras@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=manlio.perillo@gmail.com \
    --cc=peff@peff.net \
    --cc=szeder@ira.uka.de \
    /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).