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

Re: [PATCH 1/3] contrib/subtree: stop explicitly using a bash shell

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 25, 2013, 17:57 UTC
Message-ID
<7vy5dbxszy.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1364153863-27437-2-git-send-email-pcampbell@kemitix.net>
Paul Campbell <pcampbell@kemitix.net> writes:
Show 22 quoted lines
> Don't explicitly use the Bash shell but allow the system to provide a
> hopefully POSIX compatible shell at /bin/sh.
>
> Signed-off-by: Paul Campbell <pcampbell@kemitix.net>
> ---
>
> Only the system's I was able to test this on (Debian squeeze) /bin/sh is
> the dash shell.
>
>  contrib/subtree/git-subtree.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/contrib/subtree/git-subtree.sh b/contrib/subtree/git-subtree.sh
> index 8a23f58..5701376 100755
> --- a/contrib/subtree/git-subtree.sh
> +++ b/contrib/subtree/git-subtree.sh
> @@ -1,4 +1,4 @@
> -#!/bin/bash
> +#!/bin/sh
>  #
>  # git-subtree.sh: split/join git repositories in subdirectories of this one
>  #

Interesting. I'll leave the final "yeah, this is safe" declaration to David and Avery, but I've always assumed without checking that this script relied on bash-isms like local variable semantics, arrays, regexp/substring variable substitutions, etc.

With a quick scan, however, I do not seem to find anythning glaringly unportable.

Previous: Paul CampbellNext: Paul Campbell
Message 3 of 6 in “Improve POSIX compatibility and general portablity”
  1. 0/3 Improve POSIX compatibility and general portablityPaul Campbell, Mar 24, 2013
  2. 1/3 contrib/subtree: stop explicitly using a bash shellPaul Campbell, Mar 24, 2013
  3. Junio C HamanoMar 25, 2013
  4. 2/3 contrib/subtree: remove use of -a/-o in [ commandsPaul Campbell, Mar 24, 2013
  5. Simon RuderichMar 24, 2013
  6. 3/3 contrib/subtree: replace echo options with printfPaul Campbell, Mar 24, 2013

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.