git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Elia Pinto <gitter.spiros@gmail.com>
To: git@vger.kernel.org
Cc: Elia Pinto <gitter.spiros@gmail.com>
Subject: [PATCH 007/14] git-ls-remote.sh: use the $( ... ) construct for command substitution
Date: Wed, 16 Apr 2014 10:29:51 -0700	[thread overview]
Message-ID: <1397669398-25410-7-git-send-email-gitter.spiros@gmail.com> (raw)
In-Reply-To: <1397669398-25410-1-git-send-email-gitter.spiros@gmail.com>

The Git CodingGuidelines prefer the $(...) construct for command
substitution instead of using the backquotes `...`.

The backquoted form is the traditional method for command
substitution, and is supported by POSIX.  However, all but the
simplest uses become complicated quickly.  In particular, embedded
command substitutions and/or the use of double quotes require
careful escaping with the backslash character.

The patch was generated by:

for _f in $(find . -name "*.sh")
do
   sed -i 's@`\(.*\)`@$(\1)@g' ${_f}
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <gitter.spiros@gmail.com>
---
 contrib/examples/git-ls-remote.sh |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/contrib/examples/git-ls-remote.sh b/contrib/examples/git-ls-remote.sh
index fec70bb..2aa89a7 100755
--- a/contrib/examples/git-ls-remote.sh
+++ b/contrib/examples/git-ls-remote.sh
@@ -55,11 +55,11 @@ tmpdir=$tmp-d
 case "$peek_repo" in
 http://* | https://* | ftp://* )
 	if [ -n "$GIT_SSL_NO_VERIFY" -o \
-		"`git config --bool http.sslVerify`" = false ]; then
+		"$(git config --bool http.sslVerify)" = false ]; then
 		curl_extra_args="-k"
 	fi
 	if [ -n "$GIT_CURL_FTP_NO_EPSV" -o \
-		"`git config --bool http.noEPSV`" = true ]; then
+		"$(git config --bool http.noEPSV)" = true ]; then
 		curl_extra_args="${curl_extra_args} --disable-epsv"
 	fi
 	curl -nsf $curl_extra_args --header "Pragma: no-cache" "$peek_repo/info/refs" ||
-- 
1.7.10.4

  parent reply	other threads:[~2014-04-16 17:30 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-16 17:29 [PATCH 001/14] howto-index.sh: use the $( ... ) construct for command substitution Elia Pinto
2014-04-16 17:29 ` [PATCH 002/14] install-webdoc.sh: " Elia Pinto
2014-04-16 17:29 ` [PATCH 003/14] git-checkout.sh: " Elia Pinto
2014-04-16 17:29 ` [PATCH 004/14] git-clone.sh: " Elia Pinto
2014-04-16 17:29 ` [PATCH 005/14] git-commit.sh: " Elia Pinto
2014-04-16 17:29 ` [PATCH 006/14] git-fetch.sh: " Elia Pinto
2014-04-16 17:29 ` Elia Pinto [this message]
2014-04-16 17:29 ` [PATCH 008/14] git-merge.sh: " Elia Pinto
2014-04-16 17:29 ` [PATCH 009/14] git-repack.sh: " Elia Pinto
2014-04-16 17:29 ` [PATCH 010/14] git-resolve.sh: " Elia Pinto
2014-04-16 17:29 ` [PATCH 011/14] git-revert.sh: " Elia Pinto
2014-04-16 17:29 ` [PATCH 012/14] git-tag.sh: " Elia Pinto
2014-04-16 17:29 ` [PATCH 013/14] t9360-mw-to-git-clone.sh: " Elia Pinto
2014-04-16 17:29 ` [PATCH 014/14] t9362-mw-to-git-utf8.sh: " Elia Pinto
2014-04-17  9:00 ` [PATCH 001/14] howto-index.sh: " Matthieu Moy
2014-04-17 18:25   ` Junio C Hamano

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=1397669398-25410-7-git-send-email-gitter.spiros@gmail.com \
    --to=gitter.spiros@gmail.com \
    --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).