git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH 00/10] use the $( ... ) construct for command substitution
@ 2015-12-22 14:10 Elia Pinto
  2015-12-22 14:10 ` [PATCH 01/10] contrib/examples/git-commit.sh: " Elia Pinto
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: Elia Pinto @ 2015-12-22 14:10 UTC (permalink / raw)
  To: git; +Cc: Elia Pinto

This patch series continues the changes introduced with the merge 
6753d8a85d543253d95184ec2faad6dc197f248:

    Merge branch 'ep/shell-command-substitution'

    Adjust shell scripts to use $(cmd) instead of `cmd`.


This is the first series, the other will be sent separately.


Elia Pinto (10):
  contrib/examples/git-commit.sh: use the $( ... ) construct for command
    substitution
  contrib/examples/git-fetch.sh: use the $( ... ) construct for command
    substitution
  contrib/examples/git-merge.sh: use the $( ... ) construct for command
    substitution
  contrib/examples/git-repack.sh: use the $( ... ) construct for command
    substitution
  contrib/examples/git-revert.sh: use the $( ... ) construct for command
    substitution
  contrib/thunderbird-patch-inline/appp.sh: use the $( ... ) construct
    for command substitution
  git-gui/po/glossary/txt-to-pot.sh: use the $( ... ) construct for
    command substitution
  t/lib-httpd.sh: use the $( ... ) construct for command substitution
  test-sha1.sh: use the $( ... ) construct for command substitution
  unimplemented.sh: use the $( ... ) construct for command substitution

 contrib/examples/git-commit.sh           | 8 ++++----
 contrib/examples/git-fetch.sh            | 4 ++--
 contrib/examples/git-merge.sh            | 4 ++--
 contrib/examples/git-repack.sh           | 4 ++--
 contrib/examples/git-revert.sh           | 8 ++++----
 contrib/thunderbird-patch-inline/appp.sh | 4 ++--
 git-gui/po/glossary/txt-to-pot.sh        | 4 ++--
 t/lib-httpd.sh                           | 4 ++--
 test-sha1.sh                             | 8 ++++----
 unimplemented.sh                         | 2 +-
 10 files changed, 25 insertions(+), 25 deletions(-)

-- 
2.3.3.GIT

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 01/10] contrib/examples/git-commit.sh: use the $( ... ) construct for command substitution
  2015-12-22 14:10 [PATCH 00/10] use the $( ... ) construct for command substitution Elia Pinto
@ 2015-12-22 14:10 ` Elia Pinto
  2015-12-22 14:10 ` [PATCH 02/10] contrib/examples/git-fetch.sh: " Elia Pinto
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Elia Pinto @ 2015-12-22 14:10 UTC (permalink / raw)
  To: git; +Cc: Elia Pinto

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
	perl -i -pe 'BEGIN{undef $/;} s/`(.+?)`/\$(\1)/smg'  "${_f}"
done

and then carefully proof-read.

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

diff --git a/contrib/examples/git-commit.sh b/contrib/examples/git-commit.sh
index 934505b..86c9cfa 100755
--- a/contrib/examples/git-commit.sh
+++ b/contrib/examples/git-commit.sh
@@ -574,10 +574,10 @@ then
 	if test "$templatefile" != ""
 	then
 		# Test whether this is just the unaltered template.
-		if cnt=`sed -e '/^#/d' < "$templatefile" |
+		if cnt=$(sed -e '/^#/d' < "$templatefile" |
 			git stripspace |
 			diff "$GIT_DIR"/COMMIT_BAREMSG - |
-			wc -l` &&
+			wc -l) &&
 		   test 0 -lt $cnt
 		then
 			have_commitmsg=t
@@ -630,8 +630,8 @@ then
 	fi
 	if test -z "$quiet"
 	then
-		commit=`git diff-tree --always --shortstat --pretty="format:%h: %s"\
-		       --abbrev --summary --root HEAD --`
+		commit=$(git diff-tree --always --shortstat --pretty="format:%h: %s"\
+		       --abbrev --summary --root HEAD --)
 		echo "Created${initial_commit:+ initial} commit $commit"
 	fi
 fi
-- 
2.3.3.GIT

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 02/10] contrib/examples/git-fetch.sh: use the $( ... ) construct for command substitution
  2015-12-22 14:10 [PATCH 00/10] use the $( ... ) construct for command substitution Elia Pinto
  2015-12-22 14:10 ` [PATCH 01/10] contrib/examples/git-commit.sh: " Elia Pinto
@ 2015-12-22 14:10 ` Elia Pinto
  2015-12-22 14:10 ` [PATCH 03/10] contrib/examples/git-merge.sh: " Elia Pinto
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Elia Pinto @ 2015-12-22 14:10 UTC (permalink / raw)
  To: git; +Cc: Elia Pinto

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
	perl -i -pe 'BEGIN{undef $/;} s/`(.+?)`/\$(\1)/smg'  "${_f}"
done

and then carefully proof-read.

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

diff --git a/contrib/examples/git-fetch.sh b/contrib/examples/git-fetch.sh
index 5540709..57d2e56 100755
--- a/contrib/examples/git-fetch.sh
+++ b/contrib/examples/git-fetch.sh
@@ -146,13 +146,13 @@ esac
 reflist=$(get_remote_refs_for_fetch "$@")
 if test "$tags"
 then
-	taglist=`IFS='	' &&
+	taglist=$(IFS='	' &&
 		  echo "$ls_remote_result" |
 		  git show-ref --exclude-existing=refs/tags/ |
 	          while read sha1 name
 		  do
 			echo ".${name}:${name}"
-		  done` || exit
+		  done) || exit
 	if test "$#" -gt 1
 	then
 		# remote URL plus explicit refspecs; we need to merge them.
-- 
2.3.3.GIT

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 03/10] contrib/examples/git-merge.sh: use the $( ... ) construct for command substitution
  2015-12-22 14:10 [PATCH 00/10] use the $( ... ) construct for command substitution Elia Pinto
  2015-12-22 14:10 ` [PATCH 01/10] contrib/examples/git-commit.sh: " Elia Pinto
  2015-12-22 14:10 ` [PATCH 02/10] contrib/examples/git-fetch.sh: " Elia Pinto
@ 2015-12-22 14:10 ` Elia Pinto
  2015-12-22 14:10 ` [PATCH 04/10] contrib/examples/git-repack.sh: " Elia Pinto
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Elia Pinto @ 2015-12-22 14:10 UTC (permalink / raw)
  To: git; +Cc: Elia Pinto

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
	perl -i -pe 'BEGIN{undef $/;} s/`(.+?)`/\$(\1)/smg'  "${_f}"
done

and then carefully proof-read.

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

diff --git a/contrib/examples/git-merge.sh b/contrib/examples/git-merge.sh
index 52f2aaf..ee99f1a 100755
--- a/contrib/examples/git-merge.sh
+++ b/contrib/examples/git-merge.sh
@@ -523,10 +523,10 @@ do
 
 	if test "$exit" -eq 1
 	then
-	    cnt=`{
+	    cnt=$({
 		git diff-files --name-only
 		git ls-files --unmerged
-	    } | wc -l`
+	    } | wc -l)
 	    if test $best_cnt -le 0 || test $cnt -le $best_cnt
 	    then
 		best_strategy=$strategy
-- 
2.3.3.GIT

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 04/10] contrib/examples/git-repack.sh: use the $( ... ) construct for command substitution
  2015-12-22 14:10 [PATCH 00/10] use the $( ... ) construct for command substitution Elia Pinto
                   ` (2 preceding siblings ...)
  2015-12-22 14:10 ` [PATCH 03/10] contrib/examples/git-merge.sh: " Elia Pinto
@ 2015-12-22 14:10 ` Elia Pinto
  2015-12-22 14:10 ` [PATCH 05/10] contrib/examples/git-revert.sh: " Elia Pinto
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Elia Pinto @ 2015-12-22 14:10 UTC (permalink / raw)
  To: git; +Cc: Elia Pinto

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
	perl -i -pe 'BEGIN{undef $/;} s/`(.+?)`/\$(\1)/smg'  "${_f}"
done

and then carefully proof-read.

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

diff --git a/contrib/examples/git-repack.sh b/contrib/examples/git-repack.sh
index 96e3fed..672af93 100755
--- a/contrib/examples/git-repack.sh
+++ b/contrib/examples/git-repack.sh
@@ -67,8 +67,8 @@ case ",$all_into_one," in
 ,t,)
 	args= existing=
 	if [ -d "$PACKDIR" ]; then
-		for e in `cd "$PACKDIR" && find . -type f -name '*.pack' \
-			| sed -e 's/^\.\///' -e 's/\.pack$//'`
+		for e in $(cd "$PACKDIR" && find . -type f -name '*.pack' \
+			| sed -e 's/^\.\///' -e 's/\.pack$//')
 		do
 			if [ -e "$PACKDIR/$e.keep" ]; then
 				: keep
-- 
2.3.3.GIT

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 05/10] contrib/examples/git-revert.sh: use the $( ... ) construct for command substitution
  2015-12-22 14:10 [PATCH 00/10] use the $( ... ) construct for command substitution Elia Pinto
                   ` (3 preceding siblings ...)
  2015-12-22 14:10 ` [PATCH 04/10] contrib/examples/git-repack.sh: " Elia Pinto
@ 2015-12-22 14:10 ` Elia Pinto
  2015-12-22 14:10 ` [PATCH 06/10] contrib/thunderbird-patch-inline/appp.sh: " Elia Pinto
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Elia Pinto @ 2015-12-22 14:10 UTC (permalink / raw)
  To: git; +Cc: Elia Pinto

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
	perl -i -pe 'BEGIN{undef $/;} s/`(.+?)`/\$(\1)/smg'  "${_f}"
done

and then carefully proof-read.

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

diff --git a/contrib/examples/git-revert.sh b/contrib/examples/git-revert.sh
index 7e2aad5..197838d 100755
--- a/contrib/examples/git-revert.sh
+++ b/contrib/examples/git-revert.sh
@@ -138,8 +138,8 @@ cherry-pick)
 	}'
 
 	logmsg=$(git show -s --pretty=raw --encoding="$encoding" "$commit")
-	set_author_env=`echo "$logmsg" |
-	LANG=C LC_ALL=C sed -ne "$pick_author_script"`
+	set_author_env=$(echo "$logmsg" |
+	LANG=C LC_ALL=C sed -ne "$pick_author_script")
 	eval "$set_author_env"
 	export GIT_AUTHOR_NAME
 	export GIT_AUTHOR_EMAIL
@@ -160,9 +160,9 @@ cherry-pick)
 esac >.msg
 
 eval GITHEAD_$head=HEAD
-eval GITHEAD_$next='`git show -s \
+eval GITHEAD_$next='$(git show -s \
 	--pretty=oneline --encoding="$encoding" "$commit" |
-	sed -e "s/^[^ ]* //"`'
+	sed -e "s/^[^ ]* //")'
 export GITHEAD_$head GITHEAD_$next
 
 # This three way merge is an interesting one.  We are at
-- 
2.3.3.GIT

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 06/10] contrib/thunderbird-patch-inline/appp.sh: use the $( ... ) construct for command substitution
  2015-12-22 14:10 [PATCH 00/10] use the $( ... ) construct for command substitution Elia Pinto
                   ` (4 preceding siblings ...)
  2015-12-22 14:10 ` [PATCH 05/10] contrib/examples/git-revert.sh: " Elia Pinto
@ 2015-12-22 14:10 ` Elia Pinto
  2015-12-22 14:10 ` [PATCH 07/10] git-gui/po/glossary/txt-to-pot.sh: " Elia Pinto
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Elia Pinto @ 2015-12-22 14:10 UTC (permalink / raw)
  To: git; +Cc: Elia Pinto

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
	perl -i -pe 'BEGIN{undef $/;} s/`(.+?)`/\$(\1)/smg'  "${_f}"
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <gitter.spiros@gmail.com>
---
 contrib/thunderbird-patch-inline/appp.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/contrib/thunderbird-patch-inline/appp.sh b/contrib/thunderbird-patch-inline/appp.sh
index 8dc73ec..1053872 100755
--- a/contrib/thunderbird-patch-inline/appp.sh
+++ b/contrib/thunderbird-patch-inline/appp.sh
@@ -31,8 +31,8 @@ BODY=$(sed -e "1,/${SEP}/d" $1)
 CMT_MSG=$(sed -e '1,/^$/d' -e '/^---$/,$d' "${PATCH}")
 DIFF=$(sed -e '1,/^---$/d' "${PATCH}")
 
-CCS=`echo -e "$CMT_MSG\n$HEADERS" | sed -n -e 's/^Cc: \(.*\)$/\1,/gp' \
-	-e 's/^Signed-off-by: \(.*\)/\1,/gp'`
+CCS=$(echo -e "$CMT_MSG\n$HEADERS" | sed -n -e 's/^Cc: \(.*\)$/\1,/gp' \
+	-e 's/^Signed-off-by: \(.*\)/\1,/gp')
 
 echo "$SUBJECT" > $1
 echo "Cc: $CCS" >> $1
-- 
2.3.3.GIT

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 07/10] git-gui/po/glossary/txt-to-pot.sh: use the $( ... ) construct for command substitution
  2015-12-22 14:10 [PATCH 00/10] use the $( ... ) construct for command substitution Elia Pinto
                   ` (5 preceding siblings ...)
  2015-12-22 14:10 ` [PATCH 06/10] contrib/thunderbird-patch-inline/appp.sh: " Elia Pinto
@ 2015-12-22 14:10 ` Elia Pinto
  2015-12-22 14:10 ` [PATCH 08/10] t/lib-httpd.sh: " Elia Pinto
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Elia Pinto @ 2015-12-22 14:10 UTC (permalink / raw)
  To: git; +Cc: Elia Pinto

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
	perl -i -pe 'BEGIN{undef $/;} s/`(.+?)`/\$(\1)/smg'  "${_f}"
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <gitter.spiros@gmail.com>
---
 git-gui/po/glossary/txt-to-pot.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/git-gui/po/glossary/txt-to-pot.sh b/git-gui/po/glossary/txt-to-pot.sh
index 49bf7c5..8249915 100755
--- a/git-gui/po/glossary/txt-to-pot.sh
+++ b/git-gui/po/glossary/txt-to-pot.sh
@@ -11,7 +11,7 @@
 if [ $# -eq 0 ]
 then
 	cat <<!
-Usage: `basename $0` git-gui-glossary.txt > git-gui-glossary.pot
+Usage: $(basename $0) git-gui-glossary.txt > git-gui-glossary.pot
 !
 	exit 1;
 fi
@@ -33,7 +33,7 @@ cat <<!
 msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
-"POT-Creation-Date: `date +'%Y-%m-%d %H:%M%z'`\n"
+"POT-Creation-Date: $(date +'%Y-%m-%d %H:%M%z')\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
-- 
2.3.3.GIT

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 08/10] t/lib-httpd.sh: use the $( ... ) construct for command substitution
  2015-12-22 14:10 [PATCH 00/10] use the $( ... ) construct for command substitution Elia Pinto
                   ` (6 preceding siblings ...)
  2015-12-22 14:10 ` [PATCH 07/10] git-gui/po/glossary/txt-to-pot.sh: " Elia Pinto
@ 2015-12-22 14:10 ` Elia Pinto
  2015-12-22 14:10 ` [PATCH 09/10] test-sha1.sh: " Elia Pinto
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Elia Pinto @ 2015-12-22 14:10 UTC (permalink / raw)
  To: git; +Cc: Elia Pinto

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
	perl -i -pe 'BEGIN{undef $/;} s/`(.+?)`/\$(\1)/smg'  "${_f}"
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <gitter.spiros@gmail.com>
---
 t/lib-httpd.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/t/lib-httpd.sh b/t/lib-httpd.sh
index e971446..f9f3e5f 100644
--- a/t/lib-httpd.sh
+++ b/t/lib-httpd.sh
@@ -98,8 +98,8 @@ then
 	test_skip_or_die $GIT_TEST_HTTPD "no web server found at '$LIB_HTTPD_PATH'"
 fi
 
-HTTPD_VERSION=`$LIB_HTTPD_PATH -v | \
-	sed -n 's/^Server version: Apache\/\([0-9]*\)\..*$/\1/p; q'`
+HTTPD_VERSION=$($LIB_HTTPD_PATH -v | \
+	sed -n 's/^Server version: Apache\/\([0-9]*\)\..*$/\1/p; q')
 
 if test -n "$HTTPD_VERSION"
 then
-- 
2.3.3.GIT

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 09/10] test-sha1.sh: use the $( ... ) construct for command substitution
  2015-12-22 14:10 [PATCH 00/10] use the $( ... ) construct for command substitution Elia Pinto
                   ` (7 preceding siblings ...)
  2015-12-22 14:10 ` [PATCH 08/10] t/lib-httpd.sh: " Elia Pinto
@ 2015-12-22 14:10 ` Elia Pinto
  2015-12-22 14:10 ` [PATCH 10/10] unimplemented.sh: " Elia Pinto
  2015-12-22 20:45 ` [PATCH 00/10] " Jonathan Nieder
  10 siblings, 0 replies; 12+ messages in thread
From: Elia Pinto @ 2015-12-22 14:10 UTC (permalink / raw)
  To: git; +Cc: Elia Pinto

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
	perl -i -pe 'BEGIN{undef $/;} s/`(.+?)`/\$(\1)/smg'  "${_f}"
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <gitter.spiros@gmail.com>
---
 test-sha1.sh | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/test-sha1.sh b/test-sha1.sh
index 0f0bc5d..cef4bcc 100755
--- a/test-sha1.sh
+++ b/test-sha1.sh
@@ -6,13 +6,13 @@ dd if=/dev/zero bs=1048576 count=100 2>/dev/null |
 while read expect cnt pfx
 do
 	case "$expect" in '#'*) continue ;; esac
-	actual=`
+	actual=$(
 		{
 			test -z "$pfx" || echo "$pfx"
 			dd if=/dev/zero bs=1048576 count=$cnt 2>/dev/null |
 			perl -pe 'y/\000/g/'
 		} | ./test-sha1 $cnt
-	`
+	)
 	if test "$expect" = "$actual"
 	then
 		echo "OK: $expect $cnt $pfx"
@@ -51,14 +51,14 @@ exit
 
 while read cnt pfx
 do
-	actual=`
+	actual=$(
 		{
 			test -z "$pfx" || echo "$pfx"
 			dd if=/dev/zero bs=1048576 count=$cnt 2>/dev/null |
 			perl -pe 'y/\000/g/'
 		} | sha1sum |
 		sed -e 's/ .*//'
-	`
+	)
 	echo "$actual $cnt $pfx"
 done <<EOF
 0
-- 
2.3.3.GIT

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 10/10] unimplemented.sh: use the $( ... ) construct for command substitution
  2015-12-22 14:10 [PATCH 00/10] use the $( ... ) construct for command substitution Elia Pinto
                   ` (8 preceding siblings ...)
  2015-12-22 14:10 ` [PATCH 09/10] test-sha1.sh: " Elia Pinto
@ 2015-12-22 14:10 ` Elia Pinto
  2015-12-22 20:45 ` [PATCH 00/10] " Jonathan Nieder
  10 siblings, 0 replies; 12+ messages in thread
From: Elia Pinto @ 2015-12-22 14:10 UTC (permalink / raw)
  To: git; +Cc: Elia Pinto

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
	perl -i -pe 'BEGIN{undef $/;} s/`(.+?)`/\$(\1)/smg'  "${_f}"
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <gitter.spiros@gmail.com>
---
 unimplemented.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/unimplemented.sh b/unimplemented.sh
index 5252de4..fee21d2 100644
--- a/unimplemented.sh
+++ b/unimplemented.sh
@@ -1,4 +1,4 @@
 #!/bin/sh
 
-echo >&2 "fatal: git was built without support for `basename $0` (@@REASON@@)."
+echo >&2 "fatal: git was built without support for $(basename $0) (@@REASON@@)."
 exit 128
-- 
2.3.3.GIT

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH 00/10] use the $( ... ) construct for command substitution
  2015-12-22 14:10 [PATCH 00/10] use the $( ... ) construct for command substitution Elia Pinto
                   ` (9 preceding siblings ...)
  2015-12-22 14:10 ` [PATCH 10/10] unimplemented.sh: " Elia Pinto
@ 2015-12-22 20:45 ` Jonathan Nieder
  10 siblings, 0 replies; 12+ messages in thread
From: Jonathan Nieder @ 2015-12-22 20:45 UTC (permalink / raw)
  To: Elia Pinto; +Cc: git

Elia Pinto wrote:

> This is the first series, the other will be sent separately.

FWIW,
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2015-12-22 20:46 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-22 14:10 [PATCH 00/10] use the $( ... ) construct for command substitution Elia Pinto
2015-12-22 14:10 ` [PATCH 01/10] contrib/examples/git-commit.sh: " Elia Pinto
2015-12-22 14:10 ` [PATCH 02/10] contrib/examples/git-fetch.sh: " Elia Pinto
2015-12-22 14:10 ` [PATCH 03/10] contrib/examples/git-merge.sh: " Elia Pinto
2015-12-22 14:10 ` [PATCH 04/10] contrib/examples/git-repack.sh: " Elia Pinto
2015-12-22 14:10 ` [PATCH 05/10] contrib/examples/git-revert.sh: " Elia Pinto
2015-12-22 14:10 ` [PATCH 06/10] contrib/thunderbird-patch-inline/appp.sh: " Elia Pinto
2015-12-22 14:10 ` [PATCH 07/10] git-gui/po/glossary/txt-to-pot.sh: " Elia Pinto
2015-12-22 14:10 ` [PATCH 08/10] t/lib-httpd.sh: " Elia Pinto
2015-12-22 14:10 ` [PATCH 09/10] test-sha1.sh: " Elia Pinto
2015-12-22 14:10 ` [PATCH 10/10] unimplemented.sh: " Elia Pinto
2015-12-22 20:45 ` [PATCH 00/10] " Jonathan Nieder

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).