From: Junio C Hamano <gitster@pobox•com>
To: "Jean-Noël Avila" <avila.jn@gmail•com>
Cc: "Jeff King" <peff@peff•net>, "Jean-Noël AVILA" <jn.avila@free•fr>,
git@vger•kernel.org
Subject: Re: [RFC] Instruct git-completion.bash that we are in test mode
Date: Tue, 22 Jan 2013 08:31:28 -0800 [thread overview]
Message-ID: <7vham9b2n3.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <50FE47F4.20104@gmail.com> ("Jean-Noël Avila"'s message of "Tue, 22 Jan 2013 09:04:04 +0100")
Jean-Noël Avila <avila.jn@gmail•com> writes:
> Le 22/01/2013 05:31, Junio C Hamano a écrit :
>> Jeff King <peff@peff•net> writes:
>>
>>> I really hate to suggest this, but should it be more like:
>>>
>>> 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
>>>
>>> That gives us a nice predictable starting point for actually
>>> testing the completion code. The downside is that it doesn't let
>>> us test that we remain compatible with the output of "help -a".
> ...
> Instead of imposing the list of command, we could use the command
> list argument to filter the ouput of git help -a. This would ensure that the
> completions we want to test are still present in the installation while
> still restricting them to the test case.
In order to "filter the output", you still need to know how output
from "git help -a" looks like, and adjust the code to filter when
the shape of the output changes. The effort to do so is pretty
similar to the amount of effort needed to maintain FAKE_COMMAND_LIST
to look like the output from "git help -a". It is of dubious value
compared to the simplicity of "printf" FAKE_COMMAND_LIST approach, I
think.
next prev parent reply other threads:[~2013-01-22 16:31 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-21 22:30 [RFC] Instruct git-completion.bash that we are in test mode Jean-Noël AVILA
2013-01-21 23:32 ` Junio C Hamano
2013-01-22 0:39 ` Jeff King
2013-01-22 4:31 ` Junio C Hamano
2013-01-22 8:04 ` Jean-Noël Avila
2013-01-22 16:31 ` Junio C Hamano [this message]
2013-01-24 23:07 ` [PATCH] t9902: protect test from stray build artifacts Junio C Hamano
2013-01-25 1:13 ` Jeff King
2013-01-25 2:59 ` Jonathan Nieder
2013-01-25 4:11 ` Junio C Hamano
2013-01-25 4:13 ` Jeff King
2013-01-25 4:19 ` Junio C Hamano
2013-01-25 4:23 ` Jeff King
2013-01-25 18:34 ` Junio C Hamano
2013-01-25 22:06 ` Jeff King
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=7vham9b2n3.fsf@alter.siamese.dyndns.org \
--to=gitster@pobox$(echo .)com \
--cc=avila.jn@gmail$(echo .)com \
--cc=git@vger$(echo .)kernel.org \
--cc=jn.avila@free$(echo .)fr \
--cc=peff@peff$(echo .)net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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