git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] contrib: Replaced /bin/sh with /bin/bash to make scripts with Bash syntax work on Solaris.

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 6, 2010, 16:00 UTC
Message-ID
<7veiebafzn.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1281099365-11978-1-git-send-email-asgeir@twingine.no>
"Asgeir S. Nilsen" <asgeir@twingine.no> writes:
Show 13 quoted lines
> 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.

Previous: Asgeir S. NilsenNext: Jonathan Nieder
Message 2 of 7 in “contrib: Replaced /bin/sh with /bin/bash to make scripts with Bash syntax work on Solaris.”
  1. contrib: Replaced /bin/sh with /bin/bash to make scripts with Bash syntax work on Solaris.Asgeir S. Nilsen, Aug 6, 2010
  2. Junio C HamanoAug 6, 2010
  3. Jonathan NiederAug 8, 2010
  4. Junio C HamanoAug 9, 2010
  5. Jonathan NiederAug 9, 2010
  6. Junio C HamanoAug 9, 2010
  7. Greg TroxelAug 10, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.