{"thread":{"id":"27476","subject":"[PATCH] git-submodule.sh: separate parens by a space to avoid confusing some shells","startedAt":"2011-05-26T20:52:04Z","lastAt":"2011-05-26T20:52:04Z","messageCount":1,"participants":["Brandon Casey"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"168829","messageId":"vWPtQ6mu-P8TxddTGAsNGMxxRy-vaOeaUiF8WZQpA2J8HcdAc02vCzYpygwdejLhR6OIWYLtPtK7E4oxXk50vg@cipher.nrlssc.navy.mil","threadId":"27476","inReplyTo":null,"subject":"[PATCH] git-submodule.sh: separate parens by a space to avoid confusing some shells","fromName":"Brandon Casey","fromEmail":"casey@nrlssc.navy.mil","sentAt":"2011-05-26T20:52:04Z","receivedAt":"2011-05-26T20:52:04Z","isPatch":true,"sender":{"key":"drafnel@gmail.com","avatar":"https://avatars.githubusercontent.com/u/921167?v=4"},"body":"From: Brandon Casey <drafnel@gmail.com>\n\nSome shells interpret '(( ))' according to the rules for arithmetic\nexpansion.  This may not follow POSIX, but is prevalent in commonly used\nshells.  Bash does not have a problem with this particular instance of\n'((', likely because it is not followed by a '))', but the public domain\nksh does, and so does ksh on IRIX 6.5.\n\nSo, add a space between the parenthesis to avoid confusing these shells.\n\nSigned-off-by: Brandon Casey <casey@nrlssc.navy.mil>\n---\n git-submodule.sh |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/git-submodule.sh b/git-submodule.sh\nindex bf110e9..d189a24 100755\n--- a/git-submodule.sh\n+++ b/git-submodule.sh\n@@ -495,7 +495,7 @@ cmd_update()\n \t\t\t\t# Run fetch only if $sha1 isn't present or it\n \t\t\t\t# is not reachable from a ref.\n \t\t\t\t(clear_local_git_env; cd \"$path\" &&\n-\t\t\t\t\t((rev=$(git rev-list -n 1 $sha1 --not --all 2>/dev/null) &&\n+\t\t\t\t\t( (rev=$(git rev-list -n 1 $sha1 --not --all 2>/dev/null) &&\n \t\t\t\t\t test -z \"$rev\") || git-fetch)) ||\n \t\t\t\tdie \"Unable to fetch in submodule path '$path'\"\n \t\t\tfi\n-- \n1.7.4.4\n"}]}