From: Junio C Hamano <gitster@pobox.com>
To: "Jean-Noël AVILA" <jn.avila@free.fr>
Cc: git@vger.kernel.org, Jeff King <peff@peff.net>
Subject: Re: [PATCH] t9902: Instruct git-completion.bash about a test mode
Date: Thu, 24 Jan 2013 14:29:33 -0800 [thread overview]
Message-ID: <7vlibi8baq.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <201301242304.16078.jn.avila@free.fr> ("Jean-Noël AVILA"'s message of "Thu, 24 Jan 2013 23:04:15 +0100")
"Jean-Noël AVILA" <jn.avila@free.fr> writes:
> My rational was to be sure to put the environment variable out of the
> way once the script has been sourced. I can make two alternative
> definitions of __git_list_all_commands () depending on the presence of
> $AUTHORIZED_CMD_LIST if you are worried about performance.
Actually, it does not matter, as once __git_list_all_commands is
run, its result is kept in a variable.
So Peff's
if test -z "$FAKE_COMMAND_LIST"; then
__git_cmdlist() {
git help -a | egrep '^ [a-zA-Z0-9]'
}
else
__git_cmdlist() {
printf '%s' "$FAKE_COMMAND_LIST"
}
fi
would be just as simple if not simpler, does the same thing, and is
sufficient, I think.
The t9902 test is only interested in making sure that the completion
works, and we do not want "git help -a" that omits a subcommand from
its output that is not built in your particular environment to get
in the way, which will not be an issue with this approach.
next prev parent reply other threads:[~2013-01-24 22:29 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-24 21:20 [PATCH] t9902: Instruct git-completion.bash about a test mode Jean-Noël AVILA
2013-01-24 21:46 ` Junio C Hamano
2013-01-24 22:04 ` Jean-Noël AVILA
2013-01-24 22:29 ` Junio C Hamano [this message]
2013-01-24 22:56 ` Jean-Noël AVILA
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=7vlibi8baq.fsf@alter.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=jn.avila@free.fr \
--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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox