All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Felipe Contreras <felipe.contreras@gmail.com>
Cc: Jeff King <peff@peff.net>, git@vger.kernel.org
Subject: Re: [RFC/PATCH] tests: add initial bash completion tests
Date: Fri, 06 Apr 2012 16:33:58 -0700	[thread overview]
Message-ID: <7vbon4zb89.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <7vfwcgzbrd.fsf@alter.siamese.dyndns.org> (Junio C. Hamano's message of "Fri, 06 Apr 2012 16:22:30 -0700")

Junio C Hamano <gitster@pobox.com> writes:

> Felipe Contreras <felipe.contreras@gmail.com> writes:
>
>> What about this instead?
>>
>> #!/bin/sh
>>
>> if type bash >/dev/null 2>&1
>> then
>> 	# execute inside bash
>> 	[ -z "$BASH" ] && exec bash $0
>> else
>> 	echo '1..0 #SKIP skipping bash completion tests; bash not available'
>> 	exit 0
>> fi
> ...
> Other than that, it is very much simple and straight-forward.  I like it.

It probably is even simpler to do it like this.

if test -z "$BASH" && ! exec bash "$0" "$@"
then
	echo '1..0 #SKIP...'
        exit 0
fi

... rest of the test starting with ". ./test-lib.sh" ...

  reply	other threads:[~2012-04-06 23: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
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 [this message]
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=7vbon4zb89.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=felipe.contreras@gmail.com \
    --cc=git@vger.kernel.org \
    --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 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.