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; 22+ 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] 22+ 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; 22+ 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] 22+ 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; 22+ 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] 22+ 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; 22+ 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] 22+ 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; 22+ 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] 22+ 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; 22+ 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] 22+ 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; 22+ 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] 22+ 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; 22+ 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] 22+ 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; 22+ 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] 22+ 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; 22+ 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] 22+ 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; 22+ 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] 22+ messages in thread

* [PATCH 00/10] use the $( ... ) construct for command substitution
@ 2015-12-22 15:05 Elia Pinto
  2015-12-22 21:33 ` Jonathan Nieder
  0 siblings, 1 reply; 22+ messages in thread
From: Elia Pinto @ 2015-12-22 15:05 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 second series, the other will be sent separately.


Elia Pinto (10):
  t/t1100-commit-tree-options.sh: use the $( ... ) construct for command
    substitution
  t/t1401-symbolic-ref.sh: use the $( ... ) construct for command
    substitution
  t/t1410-reflog.sh: use the $( ... ) construct for command substitution
  t/t1511-rev-parse-caret.sh: use the $( ... ) construct for command
    substitution
  t/t1512-rev-parse-disambiguation.sh: use the $( ... ) construct for
    command substitution
  t/t1700-split-index.sh: use the $( ... ) construct for command
    substitution
  t/t2025-worktree-add.sh: use the $( ... ) construct for command
    substitution
  t/t2102-update-index-symlinks.sh: use the $( ... ) construct for
    command substitution
  t/t3030-merge-recursive.sh: use the $( ... ) construct for command
    substitution
  t/t3100-ls-tree-restrict.sh: use the $( ... ) construct for command
    substitution

 t/t1100-commit-tree-options.sh      |  4 ++--
 t/t1401-symbolic-ref.sh             |  2 +-
 t/t1410-reflog.sh                   | 24 ++++++++++++------------
 t/t1511-rev-parse-caret.sh          |  4 ++--
 t/t1512-rev-parse-disambiguation.sh |  8 ++++----
 t/t1700-split-index.sh              |  2 +-
 t/t2025-worktree-add.sh             |  4 ++--
 t/t2102-update-index-symlinks.sh    |  2 +-
 t/t3030-merge-recursive.sh          |  2 +-
 t/t3100-ls-tree-restrict.sh         |  2 +-
 10 files changed, 27 insertions(+), 27 deletions(-)

-- 
2.3.3.GIT

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

* [PATCH 00/10] use the $( ... ) construct for command substitution
@ 2015-12-22 15:27 Elia Pinto
  0 siblings, 0 replies; 22+ messages in thread
From: Elia Pinto @ 2015-12-22 15:27 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 third serie, the other will be sent separately.


Elia Pinto (10):
  t3101-ls-tree-dirname.sh: use the $( ... ) construct for command
    substitution
  t3210-pack-refs.sh: use the $( ... ) construct for command
    substitution
  t3403-rebase-skip.sh: use the $( ... ) construct for command
    substitution
  t3511-cherry-pick-x.sh: use the $( ... ) construct for command
    substitution
  t3600-rm.sh: use the $( ... ) construct for command substitution
  t3700-add.sh: use the $( ... ) construct for command substitution
  t5100-mailinfo.sh: use the $( ... ) construct for command substitution
  t5300-pack-object.sh: use the $( ... ) construct for command
    substitution
  t5301-sliding-window.sh: use the $( ... ) construct for command
    substitution
  t5302-pack-index.sh: use the $( ... ) construct for command
    substitution

 t/t3101-ls-tree-dirname.sh |  2 +-
 t/t3210-pack-refs.sh       |  2 +-
 t/t3403-rebase-skip.sh     |  2 +-
 t/t3511-cherry-pick-x.sh   | 14 +++++++-------
 t/t3600-rm.sh              |  4 ++--
 t/t3700-add.sh             | 16 ++++++++--------
 t/t5100-mailinfo.sh        | 12 ++++++------
 t/t5300-pack-object.sh     | 18 +++++++++---------
 t/t5301-sliding-window.sh  | 14 +++++++-------
 t/t5302-pack-index.sh      | 34 +++++++++++++++++-----------------
 10 files changed, 59 insertions(+), 59 deletions(-)

-- 
2.3.3.GIT

^ permalink raw reply	[flat|nested] 22+ 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; 22+ 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] 22+ messages in thread

* Re: [PATCH 00/10] use the $( ... ) construct for command substitution
  2015-12-22 15:05 Elia Pinto
@ 2015-12-22 21:33 ` Jonathan Nieder
  0 siblings, 0 replies; 22+ messages in thread
From: Jonathan Nieder @ 2015-12-22 21:33 UTC (permalink / raw)
  To: Elia Pinto; +Cc: git

Elia Pinto wrote:

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

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

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

* [PATCH 00/10] use the $( ... ) construct for command substitution
@ 2015-12-23 13:45 Elia Pinto
  0 siblings, 0 replies; 22+ messages in thread
From: Elia Pinto @ 2015-12-23 13:45 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 fourth serie, the other will be sent separately.


Elia Pinto (10):
  t/t5303-pack-corruption-resilience.sh: use the $( ... ) construct for
    command substitution
  t/t5304-prune.sh: use the $( ... ) construct for command substitution
  t/t5305-include-tag.sh: use the $( ... ) construct for command
    substitution
  t/t5500-fetch-pack.sh: use the $( ... ) construct for command
    substitution
  t/t5505-remote.sh: use the $( ... ) construct for command substitution
  t/t5506-remote-groups.sh: use the $( ... ) construct for command
    substitution
  t/t5510-fetch.sh: use the $( ... ) construct for command substitution
  t/t5515-fetch-merge-logic.sh: use the $( ... ) construct for command
    substitution
  t/t5516-fetch-push.sh: use the $( ... ) construct for command
    substitution
  t/t5517-push-mirror.sh: use the $( ... ) construct for command
    substitution

 t/t5303-pack-corruption-resilience.sh | 16 ++++++++--------
 t/t5304-prune.sh                      |  2 +-
 t/t5305-include-tag.sh                |  8 ++++----
 t/t5500-fetch-pack.sh                 | 20 ++++++++++----------
 t/t5505-remote.sh                     |  2 +-
 t/t5506-remote-groups.sh              |  2 +-
 t/t5510-fetch.sh                      | 10 +++++-----
 t/t5515-fetch-merge-logic.sh          |  4 ++--
 t/t5516-fetch-push.sh                 |  4 ++--
 t/t5517-push-mirror.sh                |  2 +-
 10 files changed, 35 insertions(+), 35 deletions(-)

-- 
2.3.3.GIT

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

* [PATCH 00/10] use the $( ... ) construct for command substitution
@ 2016-01-04  9:10 Elia Pinto
  2016-01-04 21:58 ` Junio C Hamano
  0 siblings, 1 reply; 22+ messages in thread
From: Elia Pinto @ 2016-01-04  9: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 fifth series, the other will be sent separately.

Elia Pinto (10):
  t/t5522-pull-symlink.sh: use the $( ... ) construct for command
    substitution
  t/t5530-upload-pack-error.sh: use the $( ... ) construct for command
    substitution
  t/t5532-fetch-proxy.sh: use the $( ... ) construct for command
    substitution
  t/t5537-fetch-shallow.sh: use the $( ... ) construct for command
    substitution
  t/t5538-push-shallow.sh: use the $( ... ) construct for command
    substitution
  t/t5550-http-fetch-dumb.sh: use the $( ... ) construct for command
    substitution
  t/t5570-git-daemon.sh: use the $( ... ) construct for command
    substitution
  t/t5601-clone.sh: use the $( ... ) construct for command substitution
  t/t5700-clone-reference.sh: use the $( ... ) construct for command
    substitution
  t/t5710-info-alternate.sh: use the $( ... ) construct for command
    substitution

 t/t5522-pull-symlink.sh      | 2 +-
 t/t5530-upload-pack-error.sh | 2 +-
 t/t5532-fetch-proxy.sh       | 4 ++--
 t/t5537-fetch-shallow.sh     | 4 ++--
 t/t5538-push-shallow.sh      | 4 ++--
 t/t5550-http-fetch-dumb.sh   | 8 ++++----
 t/t5570-git-daemon.sh        | 8 ++++----
 t/t5601-clone.sh             | 2 +-
 t/t5700-clone-reference.sh   | 2 +-
 t/t5710-info-alternate.sh    | 2 +-
 10 files changed, 19 insertions(+), 19 deletions(-)

-- 
2.3.3.GIT

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

* Re: [PATCH 00/10] use the $( ... ) construct for command substitution
  2016-01-04  9:10 Elia Pinto
@ 2016-01-04 21:58 ` Junio C Hamano
  0 siblings, 0 replies; 22+ messages in thread
From: Junio C Hamano @ 2016-01-04 21:58 UTC (permalink / raw)
  To: Elia Pinto; +Cc: git

All looked sensible.  Thanks.

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

* [PATCH 00/10] use the $( ... ) construct for command substitution
@ 2016-01-07 13:51 Elia Pinto
  2016-01-07 22:00 ` Junio C Hamano
  0 siblings, 1 reply; 22+ messages in thread
From: Elia Pinto @ 2016-01-07 13:51 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  sixth  series, the other will be sent separately.

Elia Pinto (10):
  t/t5900-repo-selection.sh: use the $( ... ) construct for command
    substitution
  t/t6001-rev-list-graft.sh: use the $( ... ) construct for command
    substitution
  t/t6002-rev-list-bisect.sh: use the $( ... ) construct for command
    substitution
  t/t6015-rev-list-show-all-parents.sh: use the $( ... ) construct for
    command substitution
  t/t6032-merge-large-rename.sh: use the $( ... ) construct for command
    substitution
  t/t6132-pathspec-exclude.sh: use the $( ... ) construct for command
    substitution
  t/t7001-mv.sh: use the $( ... ) construct for command substitution
  t/t7003-filter-branch.sh: use the $( ... ) construct for command
    substitution
  t/t7004-tag.sh: use the $( ... ) construct for command substitution
  t/t7006-pager.sh: use the $( ... ) construct for command substitution

 t/t5900-repo-selection.sh            |  2 +-
 t/t6001-rev-list-graft.sh            | 12 ++++++------
 t/t6002-rev-list-bisect.sh           |  6 +++---
 t/t6015-rev-list-show-all-parents.sh |  6 +++---
 t/t6032-merge-large-rename.sh        |  2 +-
 t/t6132-pathspec-exclude.sh          |  2 +-
 t/t7001-mv.sh                        |  4 ++--
 t/t7003-filter-branch.sh             |  6 +++---
 t/t7004-tag.sh                       | 16 ++++++++--------
 t/t7006-pager.sh                     |  2 +-
 10 files changed, 29 insertions(+), 29 deletions(-)

-- 
2.3.3.GIT

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

* Re: [PATCH 00/10] use the $( ... ) construct for command substitution
  2016-01-07 13:51 Elia Pinto
@ 2016-01-07 22:00 ` Junio C Hamano
  0 siblings, 0 replies; 22+ messages in thread
From: Junio C Hamano @ 2016-01-07 22:00 UTC (permalink / raw)
  To: Elia Pinto; +Cc: Git Mailing List

All looked trivially correct. Thanks, will queue.

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

* [PATCH 00/10] use the $( ... ) construct for command substitution
@ 2016-01-08 11:06 Elia Pinto
  0 siblings, 0 replies; 22+ messages in thread
From: Elia Pinto @ 2016-01-08 11:06 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`.

The last patch eliminates entirely the backquotes without replacing them 
for optimization.


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

Elia Pinto (10):
  t/t7103-reset-bare.sh: use the $( ... ) construct for command
    substitution
  t/t7406-submodule-update.sh: use the $( ... ) construct for command
    substitution
  t/t7408-submodule-reference.sh: use the $( ... ) construct for command
    substitution
  t/t7504-commit-msg-hook.sh: use the $( ... ) construct for command
    substitution
  t/t7505-prepare-commit-msg-hook.sh: use the $( ... ) construct for
    command substitution
  t/t7602-merge-octopus-many.sh: use the $( ... ) construct for command
    substitution
  t/t7700-repack.sh: use the $( ... ) construct for command substitution
  t/t8003-blame-corner-cases.sh: use the $( ... ) construct for command
    substitution
  t/t9001-send-email.sh: use the $( ... ) construct for command
    substitution
  t/t9001-send-email.sh: get rid of unnecessary backquotes

 t/t7103-reset-bare.sh              |  2 +-
 t/t7406-submodule-update.sh        |  4 ++--
 t/t7408-submodule-reference.sh     |  2 +-
 t/t7504-commit-msg-hook.sh         |  2 +-
 t/t7505-prepare-commit-msg-hook.sh | 32 ++++++++++++++++----------------
 t/t7602-merge-octopus-many.sh      |  8 ++++----
 t/t7700-repack.sh                  |  4 ++--
 t/t8003-blame-corner-cases.sh      |  4 ++--
 t/t9001-send-email.sh              | 12 ++++++------
 9 files changed, 35 insertions(+), 35 deletions(-)

-- 
2.3.3.GIT

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

* [PATCH 00/10] use the $( ... ) construct for command substitution
@ 2016-01-12 10:45 Elia Pinto
  0 siblings, 0 replies; 22+ messages in thread
From: Elia Pinto @ 2016-01-12 10:45 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 eighth series, the other will be sent separately.

Elia Pinto (10):
  t9100-git-svn-basic.sh: use the $( ... ) construct for command
    substitution
  t9101-git-svn-props.sh: use the $( ... ) construct for command
    substitution
  t9104-git-svn-follow-parent.sh: use the $( ... ) construct for command
    substitution
  t9105-git-svn-commit-diff.sh: use the $( ... ) construct for command
    substitution
  t9107-git-svn-migrate.sh: use the $( ... ) construct for command
    substitution
  t9108-git-svn-glob.sh: use the $( ... ) construct for command
    substitution
  t9109-git-svn-multi-glob.sh: use the $( ... ) construct for command
    substitution
  t9110-git-svn-use-svm-props.sh: use the $( ... ) construct for command
    substitution
  t9114-git-svn-dcommit-merge.sh: use the $( ... ) construct for command
    substitution
  t9118-git-svn-funky-branch-names.sh: use the $( ... ) construct for
    command substitution

 t/t9100-git-svn-basic.sh              |  8 ++---
 t/t9101-git-svn-props.sh              | 30 ++++++++--------
 t/t9104-git-svn-follow-parent.sh      | 68 +++++++++++++++++------------------
 t/t9105-git-svn-commit-diff.sh        |  4 +--
 t/t9107-git-svn-migrate.sh            | 28 +++++++--------
 t/t9108-git-svn-glob.sh               | 20 +++++------
 t/t9109-git-svn-multi-glob.sh         | 32 ++++++++---------
 t/t9110-git-svn-use-svm-props.sh      |  2 +-
 t/t9114-git-svn-dcommit-merge.sh      | 12 +++----
 t/t9118-git-svn-funky-branch-names.sh |  2 +-
 10 files changed, 103 insertions(+), 103 deletions(-)

-- 
2.5.0

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

end of thread, other threads:[~2016-01-12 10:45 UTC | newest]

Thread overview: 22+ 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
  -- strict thread matches above, loose matches on Subject: below --
2015-12-22 15:05 Elia Pinto
2015-12-22 21:33 ` Jonathan Nieder
2015-12-22 15:27 Elia Pinto
2015-12-23 13:45 Elia Pinto
2016-01-04  9:10 Elia Pinto
2016-01-04 21:58 ` Junio C Hamano
2016-01-07 13:51 Elia Pinto
2016-01-07 22:00 ` Junio C Hamano
2016-01-08 11:06 Elia Pinto
2016-01-12 10:45 Elia Pinto

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).