From: Jonathan Nieder <jrnieder@gmail.com>
To: Jeff King <peff@peff.net>
Cc: "Felipe Contreras" <felipe.contreras@gmail.com>,
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 01/12] tests: add initial bash completion tests
Date: Sun, 8 Apr 2012 05:30:02 -0500 [thread overview]
Message-ID: <20120408103002.GA3177@burratino> (raw)
In-Reply-To: <20120408050140.GA5862@sigill.intra.peff.net>
(dropping Shawn from cc list since he hasn't been working on the
completion script for a couple of years now)
Jeff King wrote:
> On Sun, Apr 08, 2012 at 06:07:48AM +0300, Felipe Contreras wrote:
>> + cat >expected <<-\EOF &&
>> + fetch
>> + filter-branch
>> + filter-branch.sh
>> + format-patch
>> + fsck
>> + EOF
>> + test_completion "git f"
>
> This test fails for me. The problem is that I have other git-f* programs
> in my PATH
[...]
> We can't just sanitize the PATH in
> test-lib.sh, since those git programs might be in /usr/bin or some other
> directory containing other commands necessary to run the test suite. We
> could sanitize it temporarily just for the _git completion invocation,
> which consists only of builtins (and we know we're running under bash,
> so we can trust that things like "test" are builtins). But it still
> feels horribly hacky.
Not to mention that it would break the TEST_INSTALLED_GIT facility.
Is there some reason we care about the exact list of completions for
"git f"? The above also looks a little bogus because if someone were
to remove the +x bit on the git-filter-branch.sh source file or ensure
it is not on the PATH when tests are run (I have no particular opinion
about whether that's a good idea; it's just an example) then this
would change the actual output. That doesn't seem particularly
important to check for when talking about how the tab completion
behaves on the installed system.
Maybe it would make sense to check a few representative items.
# builtin
grep "^fetch\$" out &&
# builtin whose implementation is not in builtin/cmd.c
grep "^format-patch\$" out &&
# script
grep "^filter-branch\$" out &&
# plumbing
! grep "^fsck-objects\$" out &&
sort out >out.sorted &&
test_cmp out.sorted out
next prev parent reply other threads:[~2012-04-08 10:30 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-08 3:07 [PATCH 00/12] Bash completion rework Felipe Contreras
2012-04-08 3:07 ` [PATCH 01/12] tests: add initial bash completion tests Felipe Contreras
2012-04-08 4:25 ` Junio C Hamano
2012-04-08 4:48 ` Jeff King
2012-04-08 5:41 ` Junio C Hamano
2012-04-08 5:42 ` Jeff King
2012-04-08 8:12 ` Jeff King
2012-04-08 9:07 ` Andreas Schwab
2012-04-08 11:04 ` Jeff King
2012-04-11 21:59 ` Felipe Contreras
2012-04-11 23:49 ` Junio C Hamano
2012-04-08 5:01 ` Jeff King
2012-04-08 10:30 ` Jonathan Nieder [this message]
2012-04-08 11:06 ` Jeff King
2012-04-09 19:58 ` Junio C Hamano
2012-04-08 10:28 ` John Keeping
2012-04-08 3:07 ` [PATCH 02/12] completion: simplify __gitcomp Felipe Contreras
2012-04-08 12:46 ` SZEDER Gábor
2012-04-08 13:07 ` Felipe Contreras
2012-04-08 13:27 ` Jonathan Nieder
2012-04-08 13:47 ` Felipe Contreras
2012-04-08 14:36 ` Jonathan Nieder
2012-04-08 14:58 ` Felipe Contreras
2012-04-09 18:57 ` Johannes Sixt
2012-04-09 19:12 ` Felipe Contreras
2012-04-08 14:11 ` Felipe Contreras
2012-04-08 14:39 ` Jonathan Nieder
2012-04-09 18:22 ` Junio C Hamano
2012-04-08 3:07 ` [PATCH 03/12] completion: simplify __gitcomp_1 Felipe Contreras
2012-04-08 3:07 ` [PATCH 04/12] completion: trivial simplification Felipe Contreras
2012-04-08 3:07 ` [PATCH 05/12] completion: add missing global options Felipe Contreras
2012-04-08 10:22 ` John Keeping
2012-04-08 12:36 ` SZEDER Gábor
2012-04-08 3:07 ` [PATCH 06/12] tests: add more bash completion tests Felipe Contreras
2012-04-08 3:07 ` [PATCH 07/12] completion: simplify command stuff Felipe Contreras
2012-04-11 22:14 ` SZEDER Gábor
2012-04-11 22:21 ` Felipe Contreras
2012-04-11 23:01 ` SZEDER Gábor
2012-04-11 23:45 ` Felipe Contreras
2012-04-12 23:08 ` Felipe Contreras
2012-04-08 3:07 ` [PATCH 08/12] completion: simplify _git_bundle Felipe Contreras
2012-04-08 3:07 ` [PATCH 09/12] completion: calculate argument position properly Felipe Contreras
2012-04-08 3:07 ` [PATCH 10/12] completion: add new git_complete helper Felipe Contreras
2012-04-11 22:50 ` SZEDER Gábor
2012-04-11 23:44 ` Felipe Contreras
2012-04-08 3:07 ` [PATCH 11/12] test: add tests for aliases in bash completion Felipe Contreras
2012-04-08 3:20 ` Felipe Contreras
2012-04-08 3:07 ` [PATCH 12/12] completion: rename _git and _gitk 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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120408103002.GA3177@burratino \
--to=jrnieder@gmail.com \
--cc=felipe.contreras@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=peff@peff.net \
--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).