{"thread":{"id":"16954","subject":"[RFC/PATCH] git-web--browse: don't add start as candidate on Ubuntu","startedAt":"2009-01-01T21:45:08Z","lastAt":"2009-01-12T21:05:56Z","messageCount":5,"participants":["Ramsay Jones","Christian Couder","Junio C Hamano","Petr Baudis"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"99118","messageId":"495D3964.6040006@ramsay1.demon.co.uk","threadId":"16954","inReplyTo":null,"subject":"[RFC/PATCH] git-web--browse: don't add start as candidate on Ubuntu","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsay1.demon.co.uk","sentAt":"2009-01-01T21:45:08Z","receivedAt":"2009-01-01T21:45:08Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"\nSigned-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>\n---\n\nHi *,\n\nWhen upgrading to v1.6.1, I noticed that the html help had stopped\nworking on Linux (Ububtu), viz:\n\n    $ git help -w tag\n    start: Need to be root\n\nSo, after squinting at git-web--browse.sh, I tried a few things:\n\n    $ ls /bin/start\n    ls: /bin/start: No such file or directory\n    $ test -n /bin/start; echo $?\n    0\n    $ which start\n    /sbin/start\n    $ start fred\n    start: Need to be root\n    $ ls -l /sbin/start\n    lrwxrwxrwx 1 root root 7 2007-06-24 19:45 /sbin/start -> initctl*\n\nSo, it would seem that /sbin/start is part of upstart, which would\nexplain the \"Need to be root\" ;-)\n\n    $ test -x /bin/start; echo $?\n    1\n    $ \n\nSo, the patch below fixes the issue for me, but as I don't have MinGW\ninstalled, I can't test this fix works there.\n\nDoes anybody else see this issue and can someone test the patch?\n\nATB,\nRamsay Jones\n\n git-web--browse.sh |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/git-web--browse.sh b/git-web--browse.sh\nindex 78d236b..7ed0fad 100755\n--- a/git-web--browse.sh\n+++ b/git-web--browse.sh\n@@ -115,7 +115,7 @@ if test -z \"$browser\" ; then\n \tbrowser_candidates=\"open $browser_candidates\"\n     fi\n     # /bin/start indicates MinGW\n-    if test -n /bin/start; then\n+    if test -x /bin/start; then\n \tbrowser_candidates=\"start $browser_candidates\"\n     fi\n \n-- \n1.6.1\n"},{"id":"99282","messageId":"200901040833.25849.chriscool@tuxfamily.org","threadId":"16954","inReplyTo":"495D3964.6040006@ramsay1.demon.co.uk","subject":"Re: [RFC/PATCH] git-web--browse: don't add start as candidate on Ubuntu","fromName":"Christian Couder","fromEmail":"chriscool@tuxfamily.org","sentAt":"2009-01-04T07:33:25Z","receivedAt":"2009-01-04T07:33:25Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"Le jeudi 1 janvier 2009, Ramsay Jones a écrit :\n> Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>\n> ---\n>\n> Hi *,\n>\n> When upgrading to v1.6.1, I noticed that the html help had stopped\n> working on Linux (Ububtu), viz:\n>\n>     $ git help -w tag\n>     start: Need to be root\n>\n> So, after squinting at git-web--browse.sh, I tried a few things:\n>\n>     $ ls /bin/start\n>     ls: /bin/start: No such file or directory\n>     $ test -n /bin/start; echo $?\n>     0\n>     $ which start\n>     /sbin/start\n>     $ start fred\n>     start: Need to be root\n>     $ ls -l /sbin/start\n>     lrwxrwxrwx 1 root root 7 2007-06-24 19:45 /sbin/start -> initctl*\n>\n> So, it would seem that /sbin/start is part of upstart, which would\n> explain the \"Need to be root\" ;-)\n>\n>     $ test -x /bin/start; echo $?\n>     1\n>     $\n>\n> So, the patch below fixes the issue for me, but as I don't have MinGW\n> installed, I can't test this fix works there.\n>\n> Does anybody else see this issue and can someone test the patch?\n\nPetr, as you added support for using /bin/start on MinGW, could you test?\n\nThanks,\nChristian.\n"},{"id":"99283","messageId":"7vljtr33sb.fsf@gitster.siamese.dyndns.org","threadId":"16954","inReplyTo":"200901040833.25849.chriscool@tuxfamily.org","subject":"Re: [RFC/PATCH] git-web--browse: don't add start as candidate on Ubuntu","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-01-04T07:53:56Z","receivedAt":"2009-01-04T07:53:56Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Christian Couder <chriscool@tuxfamily.org> writes:\n\n> Le jeudi 1 janvier 2009, Ramsay Jones a écrit :\n> ...\n>> Does anybody else see this issue and can someone test the patch?\n>\n> Petr, as you added support for using /bin/start on MinGW, could you test?\n>\n> Thanks,\n> Christian.\n\n> diff --git a/git-web--browse.sh b/git-web--browse.sh\n> index 78d236b..7ed0fad 100755\n> --- a/git-web--browse.sh\n> +++ b/git-web--browse.sh\n> @@ -115,7 +115,7 @@ if test -z \"$browser\" ; then\n>  \tbrowser_candidates=\"open $browser_candidates\"\n>      fi\n>      # /bin/start indicates MinGW\n> -    if test -n /bin/start; then\n> +    if test -x /bin/start; then\n>  \tbrowser_candidates=\"start $browser_candidates\"\n>      fi\n\nIn any case, the original test is simply bogus.  'test -n \"$foo\"' is to\nsee if $foo is an empty string, and giving a constant /bin/start always\nyields true.\n\nAs an old timer, I tend to prefer \"test -f\" in this context, as anybody\nsane can expect that the directory /bin will contain executables and\nnothing else.  Another reason is purely stylistic.  Historically \"-f\" has\nbeen much more portable than \"-x\" (which came from SVID), even though it\nwouldn't make much difference in practice in the real world these days.\n"},{"id":"99302","messageId":"20090104132947.GV12275@machine.or.cz","threadId":"16954","inReplyTo":"7vljtr33sb.fsf@gitster.siamese.dyndns.org","subject":"Re: [RFC/PATCH] git-web--browse: don't add start as candidate on Ubuntu","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2009-01-04T13:29:47Z","receivedAt":"2009-01-04T13:29:47Z","isPatch":true,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"On Sat, Jan 03, 2009 at 11:53:56PM -0800, Junio C Hamano wrote:\n> Christian Couder <chriscool@tuxfamily.org> writes:\n> \n> > Le jeudi 1 janvier 2009, Ramsay Jones a écrit :\n> > ...\n> >> Does anybody else see this issue and can someone test the patch?\n> >\n> > Petr, as you added support for using /bin/start on MinGW, could you test?\n\nSorry, I don't have access to MinGW system anymore.\n\n> > diff --git a/git-web--browse.sh b/git-web--browse.sh\n> > index 78d236b..7ed0fad 100755\n> > --- a/git-web--browse.sh\n> > +++ b/git-web--browse.sh\n> > @@ -115,7 +115,7 @@ if test -z \"$browser\" ; then\n> >  \tbrowser_candidates=\"open $browser_candidates\"\n> >      fi\n> >      # /bin/start indicates MinGW\n> > -    if test -n /bin/start; then\n> > +    if test -x /bin/start; then\n> >  \tbrowser_candidates=\"start $browser_candidates\"\n> >      fi\n> \n> In any case, the original test is simply bogus.  'test -n \"$foo\"' is to\n> see if $foo is an empty string, and giving a constant /bin/start always\n> yields true.\n\nOops. :-) That should've obviously been -f.\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nThe average, healthy, well-adjusted adult gets up at seven-thirty\nin the morning feeling just terrible. -- Jean Kerr\n"},{"id":"100159","messageId":"496BB0B4.7070303@ramsay1.demon.co.uk","threadId":"16954","inReplyTo":"7vljtr33sb.fsf@gitster.siamese.dyndns.org","subject":"[PATCH v2] git-web--browse: don't add start as candidate on Ubuntu","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsay1.demon.co.uk","sentAt":"2009-01-12T21:05:56Z","receivedAt":"2009-01-12T21:05:56Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>\n---\n\n  Junio C Hamano wrote:\n  > Christian Couder <chriscool@tuxfamily.org> writes:\n  >> Le jeudi 1 janvier 2009, Ramsay Jones a écrit :\n  >> ...\n  >>> Does anybody else see this issue and can someone test the patch?\n  >> Petr, as you added support for using /bin/start on MinGW, could you test?\n  >>\n  >> diff --git a/git-web--browse.sh b/git-web--browse.sh\n  >> index 78d236b..7ed0fad 100755\n  >> --- a/git-web--browse.sh\n  >> +++ b/git-web--browse.sh\n  >> @@ -115,7 +115,7 @@ if test -z \"$browser\" ; then\n  >>  \tbrowser_candidates=\"open $browser_candidates\"\n  >>      fi\n  >>      # /bin/start indicates MinGW\n  >> -    if test -n /bin/start; then\n  >> +    if test -x /bin/start; then\n  >>  \tbrowser_candidates=\"start $browser_candidates\"\n  >>      fi\n  > \n  > In any case, the original test is simply bogus.  'test -n \"$foo\"' is to\n  > see if $foo is an empty string, and giving a constant /bin/start always\n  > yields true.\n  > \n  > As an old timer, I tend to prefer \"test -f\" in this context, as anybody\n  > sane can expect that the directory /bin will contain executables and\n  > nothing else.  Another reason is purely stylistic.  Historically \"-f\" has\n  > been much more portable than \"-x\" (which came from SVID), even though it\n  > wouldn't make much difference in practice in the real world these days.\n\nSorry for the late reply; if this has already been resolved, then sorry for\nthe noise.\n\nI was expecting to be castigated for having /sbin in my $PATH. Indeed, I was\na bit surprised... So, I checked my initialization files and then the system\ninitialization files and could not find where it was being set...\n\n    $ strings /bin/bash | grep sbin\n    /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\n    $ strings /bin/sh | grep sbin\n    PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\n\nSo I don't think it's anything I'm doing...\n\nAnyway, I've changed the patch as you suggested. It would still be good\nif someone on MinGW could test it.\n\nATB,\nRamsay Jones\n\n git-web--browse.sh |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/git-web--browse.sh b/git-web--browse.sh\nindex 78d236b..c5e62a6 100755\n--- a/git-web--browse.sh\n+++ b/git-web--browse.sh\n@@ -115,7 +115,7 @@ if test -z \"$browser\" ; then\n \tbrowser_candidates=\"open $browser_candidates\"\n     fi\n     # /bin/start indicates MinGW\n-    if test -n /bin/start; then\n+    if test -f /bin/start; then\n \tbrowser_candidates=\"start $browser_candidates\"\n     fi\n \n-- \n1.6.1\n"}]}