* [RFC/PATCH] git-web--browse: don't add start as candidate on Ubuntu
@ 2009-01-01 21:45 Ramsay Jones
2009-01-04 7:33 ` Christian Couder
0 siblings, 1 reply; 5+ messages in thread
From: Ramsay Jones @ 2009-01-01 21:45 UTC (permalink / raw)
To: Junio C Hamano; +Cc: GIT Mailing-list
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
---
Hi *,
When upgrading to v1.6.1, I noticed that the html help had stopped
working on Linux (Ububtu), viz:
$ git help -w tag
start: Need to be root
So, after squinting at git-web--browse.sh, I tried a few things:
$ ls /bin/start
ls: /bin/start: No such file or directory
$ test -n /bin/start; echo $?
0
$ which start
/sbin/start
$ start fred
start: Need to be root
$ ls -l /sbin/start
lrwxrwxrwx 1 root root 7 2007-06-24 19:45 /sbin/start -> initctl*
So, it would seem that /sbin/start is part of upstart, which would
explain the "Need to be root" ;-)
$ test -x /bin/start; echo $?
1
$
So, the patch below fixes the issue for me, but as I don't have MinGW
installed, I can't test this fix works there.
Does anybody else see this issue and can someone test the patch?
ATB,
Ramsay Jones
git-web--browse.sh | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
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
--
1.6.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [RFC/PATCH] git-web--browse: don't add start as candidate on Ubuntu
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
0 siblings, 1 reply; 5+ messages in thread
From: Christian Couder @ 2009-01-04 7:33 UTC (permalink / raw)
To: Petr Baudis; +Cc: Ramsay Jones, Junio C Hamano, GIT Mailing-list
Le jeudi 1 janvier 2009, Ramsay Jones a écrit :
> Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
> ---
>
> Hi *,
>
> When upgrading to v1.6.1, I noticed that the html help had stopped
> working on Linux (Ububtu), viz:
>
> $ git help -w tag
> start: Need to be root
>
> So, after squinting at git-web--browse.sh, I tried a few things:
>
> $ ls /bin/start
> ls: /bin/start: No such file or directory
> $ test -n /bin/start; echo $?
> 0
> $ which start
> /sbin/start
> $ start fred
> start: Need to be root
> $ ls -l /sbin/start
> lrwxrwxrwx 1 root root 7 2007-06-24 19:45 /sbin/start -> initctl*
>
> So, it would seem that /sbin/start is part of upstart, which would
> explain the "Need to be root" ;-)
>
> $ test -x /bin/start; echo $?
> 1
> $
>
> So, the patch below fixes the issue for me, but as I don't have MinGW
> installed, I can't test this fix works there.
>
> 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.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [RFC/PATCH] git-web--browse: don't add start as candidate on Ubuntu
2009-01-04 7:33 ` Christian Couder
@ 2009-01-04 7:53 ` Junio C Hamano
2009-01-04 13:29 ` Petr Baudis
2009-01-12 21:05 ` [PATCH v2] " Ramsay Jones
0 siblings, 2 replies; 5+ messages in thread
From: Junio C Hamano @ 2009-01-04 7:53 UTC (permalink / raw)
To: Christian Couder; +Cc: Petr Baudis, Ramsay Jones, GIT Mailing-list
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.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [RFC/PATCH] git-web--browse: don't add start as candidate on Ubuntu
2009-01-04 7:53 ` Junio C Hamano
@ 2009-01-04 13:29 ` Petr Baudis
2009-01-12 21:05 ` [PATCH v2] " Ramsay Jones
1 sibling, 0 replies; 5+ messages in thread
From: Petr Baudis @ 2009-01-04 13:29 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Christian Couder, Ramsay Jones, GIT Mailing-list
On Sat, Jan 03, 2009 at 11:53:56PM -0800, Junio C Hamano wrote:
> 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?
Sorry, I don't have access to MinGW system anymore.
> > 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.
Oops. :-) That should've obviously been -f.
--
Petr "Pasky" Baudis
The average, healthy, well-adjusted adult gets up at seven-thirty
in the morning feeling just terrible. -- Jean Kerr
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v2] git-web--browse: don't add start as candidate on Ubuntu
2009-01-04 7:53 ` Junio C Hamano
2009-01-04 13:29 ` Petr Baudis
@ 2009-01-12 21:05 ` Ramsay Jones
1 sibling, 0 replies; 5+ messages in thread
From: Ramsay Jones @ 2009-01-12 21:05 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Christian Couder, Petr Baudis, GIT Mailing-list
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
---
Junio C Hamano wrote:
> 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?
>>
>> 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.
Sorry for the late reply; if this has already been resolved, then sorry for
the noise.
I was expecting to be castigated for having /sbin in my $PATH. Indeed, I was
a bit surprised... So, I checked my initialization files and then the system
initialization files and could not find where it was being set...
$ strings /bin/bash | grep sbin
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
$ strings /bin/sh | grep sbin
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
So I don't think it's anything I'm doing...
Anyway, I've changed the patch as you suggested. It would still be good
if someone on MinGW could test it.
ATB,
Ramsay Jones
git-web--browse.sh | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/git-web--browse.sh b/git-web--browse.sh
index 78d236b..c5e62a6 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 -f /bin/start; then
browser_candidates="start $browser_candidates"
fi
--
1.6.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-01-12 21:10 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2009-01-04 13:29 ` Petr Baudis
2009-01-12 21:05 ` [PATCH v2] " Ramsay Jones
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).