From: Junio C Hamano <gitster@pobox.com>
To: "Florian Gamböck" <mail@floga.de>
Cc: git@vger.kernel.org, "Szeder Gábor" <szeder.dev@gmail.com>
Subject: Re: [RFC PATCH 1/1] completion: load completion file for external subcommand
Date: Mon, 09 Apr 2018 07:59:16 +0900 [thread overview]
Message-ID: <xmqq37059uez.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <20180408182552.26289-3-mail@floga.de> ("Florian Gamböck"'s message of "Sun, 8 Apr 2018 20:26:13 +0200")
Florian Gamböck <mail@floga.de> writes:
> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
> index b09c8a236..e6114822c 100644
> --- a/contrib/completion/git-completion.bash
> +++ b/contrib/completion/git-completion.bash
> @@ -3096,12 +3096,20 @@ __git_main ()
> fi
>
Sorry if I am asking something obvious, as I am not fluent in
bash-isms, but
> local completion_func="_git_${command//-/_}"
> + if ! declare -f $completion_func >/dev/null 2>/dev/null; then
> + declare -f __load_completion >/dev/null 2>/dev/null &&
> + __load_completion "git-$command"
wouldn't the above be easier to read if it were
if ! declare ... $completion_func ... && declare -f __load_completion
then
__load_completion "git-$command"
fi
or is there a reason why it is better to &&-chain the check for
__load_completion with its use? Same comment applies to the other
hunk.
next prev parent reply other threads:[~2018-04-08 22:59 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-08 18:26 [RFC PATCH 0/1] completion: Dynamic completion loading Florian Gamböck
2018-04-08 18:26 ` [RFC PATCH 1/1] completion: Load completion file for external subcommand Florian Gamböck
2018-04-08 18:29 ` Florian Gamböck
2018-04-09 18:26 ` Stefan Beller
2018-04-09 19:49 ` Florian Gamböck
2018-04-19 14:12 ` SZEDER Gábor
2018-04-08 18:26 ` [RFC PATCH 1/1] completion: load " Florian Gamböck
2018-04-08 22:59 ` Junio C Hamano [this message]
2018-04-09 7:29 ` Florian Gamböck
2018-04-09 9:36 ` Junio C Hamano
2018-04-09 13:36 ` Florian Gamböck
2018-04-09 22:06 ` Junio C Hamano
2018-04-10 9:37 ` Florian Gamböck
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=xmqq37059uez.fsf@gitster-ct.c.googlers.com \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=mail@floga.de \
--cc=szeder.dev@gmail.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.