git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Asgeir S. Nilsen" <asgeir@twingine.no>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] contrib: Replaced /bin/sh with /bin/bash to make scripts with Bash syntax work on Solaris.
Date: Fri, 06 Aug 2010 09:00:12 -0700	[thread overview]
Message-ID: <7veiebafzn.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <1281099365-11978-1-git-send-email-asgeir@twingine.no> (Asgeir S. Nilsen's message of "Fri\,  6 Aug 2010 14\:56\:05 +0200")

"Asgeir S. Nilsen" <asgeir@twingine.no> writes:

> Signed-off-by: Asgeir S. Nilsen <asgeir@twingine.no>
> ---
>  contrib/ciabot/ciabot.sh           |    2 +-
>  contrib/examples/git-checkout.sh   |    2 +-
>  ...
>  contrib/examples/git-verify-tag.sh |    2 +-
>  contrib/fast-import/git-import.sh  |    2 +-
>  contrib/git-resurrect.sh           |    2 +-
>  contrib/hooks/post-receive-email   |    2 +-
>  contrib/hooks/pre-auto-gc-battery  |    2 +-
>  contrib/remotes2config.sh          |    2 +-
>  contrib/rerere-train.sh            |    2 +-
>  contrib/workdir/git-new-workdir    |    2 +-

Thanks.

The ones in contrib/examples used to be part of git and they were meant to
get their shebang "#!/bin/sh" line replaced by the toplevel Makefile to
whatever shell suitable on the platform.  As you already know, /bin/sh on
Solaris is non-POSIX and we recommend people to use a POSIX compilant
shell.  The current Makefile suggests /bin/bash on Solaris, but either ksh
or /usr/xpg[46]/bin/sh should work.

So a NAK on contrib/examples/ part.

And replacing /bin/sh with /bin/bash for everybody is _wrong_, as bash is
not the only POSIX compliant shell.

Some of the scripts in contrib/ may be using bash-specific construct, but
I think they are already marked with "#!/bin/bash" on their first lines.
If there are some that use bash-ism without "#!/bin/bash", we should first
try to see if we can reasonably rewrite them to avoid bash-ism, and mark
them as bash scripts if we can't.  I wounld't be so surprised if there are
some, but what I sampled randomly while writing this response were pure
POSIX as far as I can tell.

  reply	other threads:[~2010-08-06 16:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-06 12:56 [PATCH] contrib: Replaced /bin/sh with /bin/bash to make scripts with Bash syntax work on Solaris Asgeir S. Nilsen
2010-08-06 16:00 ` Junio C Hamano [this message]
     [not found]   ` <AANLkTi=niNfKy0JgOG4hqNtXYQPfbkd10NRDDKM1rhfB@mail.gmail.com>
2010-08-09 16:44     ` Junio C Hamano
2010-08-10 12:33       ` Greg Troxel
2010-08-08  3:11 ` Jonathan Nieder
2010-08-09 16:57   ` Junio C Hamano
2010-08-09 20:16     ` Jonathan Nieder

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=7veiebafzn.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=asgeir@twingine.no \
    --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).