git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Christian Couder <chriscool@tuxfamily.org>
Cc: Petr Baudis <pasky@suse.cz>,
	Ramsay Jones <ramsay@ramsay1.demon.co.uk>,
	GIT Mailing-list <git@vger.kernel.org>
Subject: Re: [RFC/PATCH] git-web--browse: don't add start as candidate on Ubuntu
Date: Sat, 03 Jan 2009 23:53:56 -0800	[thread overview]
Message-ID: <7vljtr33sb.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <200901040833.25849.chriscool@tuxfamily.org> (Christian Couder's message of "Sun, 4 Jan 2009 08:33:25 +0100")

Christian Couder <chriscool@tuxfamily.org> writes:

> Le jeudi 1 janvier 2009, Ramsay Jones a écrit :
> ...
>> Does anybody else see this issue and can someone test the patch?
>
> Petr, as you added support for using /bin/start on MinGW, could you test?
>
> Thanks,
> Christian.

> diff --git a/git-web--browse.sh b/git-web--browse.sh
> index 78d236b..7ed0fad 100755
> --- a/git-web--browse.sh
> +++ b/git-web--browse.sh
> @@ -115,7 +115,7 @@ if test -z "$browser" ; then
>  	browser_candidates="open $browser_candidates"
>      fi
>      # /bin/start indicates MinGW
> -    if test -n /bin/start; then
> +    if test -x /bin/start; then
>  	browser_candidates="start $browser_candidates"
>      fi

In any case, the original test is simply bogus.  'test -n "$foo"' is to
see if $foo is an empty string, and giving a constant /bin/start always
yields true.

As an old timer, I tend to prefer "test -f" in this context, as anybody
sane can expect that the directory /bin will contain executables and
nothing else.  Another reason is purely stylistic.  Historically "-f" has
been much more portable than "-x" (which came from SVID), even though it
wouldn't make much difference in practice in the real world these days.

  reply	other threads:[~2009-01-04  7:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-01 21:45 [RFC/PATCH] git-web--browse: don't add start as candidate on Ubuntu Ramsay Jones
2009-01-04  7:33 ` Christian Couder
2009-01-04  7:53   ` Junio C Hamano [this message]
2009-01-04 13:29     ` Petr Baudis
2009-01-12 21:05     ` [PATCH v2] " Ramsay Jones

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=7vljtr33sb.fsf@gitster.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=chriscool@tuxfamily.org \
    --cc=git@vger.kernel.org \
    --cc=pasky@suse.cz \
    --cc=ramsay@ramsay1.demon.co.uk \
    /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).