{"thread":{"id":"33878","subject":"[PATCH] contrib/git-subtree: Use /bin/sh interpreter instead of /bin/bash","startedAt":"2013-05-20T20:24:34Z","lastAt":"2013-05-21T07:55:05Z","messageCount":3,"participants":["Dmitry Marakasov","Junio C Hamano","John Keeping"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"218001","messageId":"20130520202434.GA3151@hades.panopticon","threadId":"33878","inReplyTo":null,"subject":"[PATCH] contrib/git-subtree: Use /bin/sh interpreter instead of /bin/bash","fromName":"Dmitry Marakasov","fromEmail":"amdmi3@amdmi3.ru","sentAt":"2013-05-20T20:24:34Z","receivedAt":"2013-05-20T20:24:34Z","isPatch":true,"sender":{"key":"amdmi3@amdmi3.ru","avatar":"https://avatars.githubusercontent.com/u/474217?v=4"},"body":"Use /bin/sh interpreter instead of /bin/bash for contrib/git-subtree:\nit's required for systems which don't use bash by default (for example,\nFreeBSD), while there seem to be no bashisms in the script (confirmed\nby looking through the source and tesing subtree functionality with\nFreeBSD's /bin/sh) to require specifically bash and not the generic\nposix shell.\n\nSigned-off-by: Dmitry Marakasov <amdmi3@amdmi3.ru>\n---\n contrib/subtree/git-subtree.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/contrib/subtree/git-subtree.sh b/contrib/subtree/git-subtree.sh\nindex 8a23f58..5701376 100755\n--- a/contrib/subtree/git-subtree.sh\n+++ b/contrib/subtree/git-subtree.sh\n@@ -1,4 +1,4 @@\n-#!/bin/bash\n+#!/bin/sh\n #\n # git-subtree.sh: split/join git repositories in subdirectories of this one\n #\n-- \n1.8.2.3\n"},{"id":"218009","messageId":"7vsj1hth11.fsf@alter.siamese.dyndns.org","threadId":"33878","inReplyTo":"20130520202434.GA3151@hades.panopticon","subject":"Re: [PATCH] contrib/git-subtree: Use /bin/sh interpreter instead of /bin/bash","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-05-20T22:36:58Z","receivedAt":"2013-05-20T22:36:58Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Dmitry Marakasov <amdmi3@amdmi3.ru> writes:\n\n> Use /bin/sh interpreter instead of /bin/bash for contrib/git-subtree:\n> it's required for systems which don't use bash by default (for example,\n> FreeBSD), while there seem to be no bashisms in the script (confirmed\n> by looking through the source and tesing subtree functionality with\n> FreeBSD's /bin/sh) to require specifically bash and not the generic\n> posix shell.\n\nHas anybody audited to make sure that the script itself is free of\nbash-isms?\n\nI somehow had an impression that in the past it was littered with\nbash-isms like function local variables and array variables and\nassumed that the #!/bin/bash was necessary.  I did a quick\neyeballing and did not see anything glaringly bash-only, but I may\nhave missed something (the coding style is so different from the\ncore part of Git Porcelains and distracting for me to efficiently\ndo a good job of scanning).\n\n>\n> Signed-off-by: Dmitry Marakasov <amdmi3@amdmi3.ru>\n> ---\n>  contrib/subtree/git-subtree.sh | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n>\n> diff --git a/contrib/subtree/git-subtree.sh b/contrib/subtree/git-subtree.sh\n> index 8a23f58..5701376 100755\n> --- a/contrib/subtree/git-subtree.sh\n> +++ b/contrib/subtree/git-subtree.sh\n> @@ -1,4 +1,4 @@\n> -#!/bin/bash\n> +#!/bin/sh\n>  #\n>  # git-subtree.sh: split/join git repositories in subdirectories of this one\n>  #\n"},{"id":"218040","messageId":"20130521075505.GN27005@serenity.lan","threadId":"33878","inReplyTo":"7vsj1hth11.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] contrib/git-subtree: Use /bin/sh interpreter instead of /bin/bash","fromName":"John Keeping","fromEmail":"john@keeping.me.uk","sentAt":"2013-05-21T07:55:05Z","receivedAt":"2013-05-21T07:55:05Z","isPatch":true,"sender":{"key":"john@keeping.me.uk","avatar":"https://avatars.githubusercontent.com/u/1702081?v=4"},"body":"On Mon, May 20, 2013 at 03:36:58PM -0700, Junio C Hamano wrote:\n> Dmitry Marakasov <amdmi3@amdmi3.ru> writes:\n> \n> > Use /bin/sh interpreter instead of /bin/bash for contrib/git-subtree:\n> > it's required for systems which don't use bash by default (for example,\n> > FreeBSD), while there seem to be no bashisms in the script (confirmed\n> > by looking through the source and tesing subtree functionality with\n> > FreeBSD's /bin/sh) to require specifically bash and not the generic\n> > posix shell.\n> \n> Has anybody audited to make sure that the script itself is free of\n> bash-isms?\n> \n> I somehow had an impression that in the past it was littered with\n> bash-isms like function local variables and array variables and\n> assumed that the #!/bin/bash was necessary.  I did a quick\n> eyeballing and did not see anything glaringly bash-only, but I may\n> have missed something (the coding style is so different from the\n> core part of Git Porcelains and distracting for me to efficiently\n> do a good job of scanning).\n\nI ran the test suite with dash and everything passed.\n\ncheckbashisms doesn't find any problems either.\n\n> >\n> > Signed-off-by: Dmitry Marakasov <amdmi3@amdmi3.ru>\n> > ---\n> >  contrib/subtree/git-subtree.sh | 2 +-\n> >  1 file changed, 1 insertion(+), 1 deletion(-)\n> >\n> > diff --git a/contrib/subtree/git-subtree.sh b/contrib/subtree/git-subtree.sh\n> > index 8a23f58..5701376 100755\n> > --- a/contrib/subtree/git-subtree.sh\n> > +++ b/contrib/subtree/git-subtree.sh\n> > @@ -1,4 +1,4 @@\n> > -#!/bin/bash\n> > +#!/bin/sh\n> >  #\n> >  # git-subtree.sh: split/join git repositories in subdirectories of this one\n> >  #\n"}]}