git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Felipe Contreras <felipe.contreras@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [RFC/PATCH] tests: add initial bash completion tests
Date: Fri, 6 Apr 2012 17:34:48 -0400	[thread overview]
Message-ID: <20120406213448.GA5436@sigill.intra.peff.net> (raw)
In-Reply-To: <CAMP44s0n+dyp-QNOPtiKtGX1VNOsM8GJOLLCksqwPArR+FS8ng@mail.gmail.com>

On Sat, Apr 07, 2012 at 12:21:35AM +0300, Felipe Contreras wrote:

> On Fri, Apr 6, 2012 at 11:19 PM, Jeff King <peff@peff.net> wrote:
> > On Fri, Apr 06, 2012 at 10:28:39PM +0300, Felipe Contreras wrote:
> 
> > I think you need to start with something like:
> >
> >  #!/bin/sh
> 
> That is irrelevant, even if it's '#!/bin/foobar', it wouldn't make any
> difference since the actual command would be something like
> '$(SHELL_PATH) t9902-completion.sh'.

True; I thought "prove" would run them directly, but even it uses
$(SHELL_PATH) to run the tests. However, doesn't that mean your test
will fail completely when $(SHELL_PATH) isn't bash?

So yes, the #! isn't relevant to "make test" (though marking it as
#!/bin/sh does serve as documentation for what you expect, and does let
people with a sane /bin/sh more easily run the test directly).

But my point still stands that you cannot assume that you are running
bash, and you need to either find bash, or gracefully exit the test
script if it is not available. Anything else will cause "make test" to
fail on some systems (and indeed, applying and running your test, it
breaks "make test" on my debian box with dash as /bin/sh).

>Plus /bin/sh does not always point to bash, even when bash is available
>(see debian).

Yes, that was my point, and why the example code I showed executed bash
explicitly instead of relying on $(SHELL_PATH) to be set to it.

-Peff

  reply	other threads:[~2012-04-06 21:34 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-06 19:28 [RFC/PATCH] tests: add initial bash completion tests Felipe Contreras
2012-04-06 20:19 ` Jeff King
2012-04-06 20:24   ` Junio C Hamano
2012-04-06 21:28     ` Felipe Contreras
2012-04-06 21:42       ` Jeff King
2012-04-06 22:22         ` Felipe Contreras
2012-04-06 21:42       ` Junio C Hamano
2012-04-06 21:21   ` Felipe Contreras
2012-04-06 21:34     ` Jeff King [this message]
2012-04-06 22:05       ` Felipe Contreras
2012-04-06 22:46         ` Junio C Hamano
2012-04-06 23:30           ` Felipe Contreras
2012-04-06 23:45         ` Jeff King
2012-04-06 23:12   ` Felipe Contreras
2012-04-06 23:22     ` Junio C Hamano
2012-04-06 23:33       ` Junio C Hamano
2012-04-07  0:02         ` Felipe Contreras
2012-04-06 23:52     ` 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=20120406213448.GA5436@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=felipe.contreras@gmail.com \
    --cc=git@vger.kernel.org \
    /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).