git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 01/14] t0001-init.sh: use the $( ... ) construct for command substitution
@ 2014-04-28 12:57 Elia Pinto
  2014-04-28 12:57 ` [PATCH 02/14] t0010-racy-git.sh: " Elia Pinto
                   ` (13 more replies)
  0 siblings, 14 replies; 15+ messages in thread
From: Elia Pinto @ 2014-04-28 12:57 UTC (permalink / raw)
  To: git; +Cc: matthieu.moy, 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
   sed -i 's@`\(.*\)`@$(\1)@g' ${_f}
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <gitter.spiros@gmail.com>
---
 t/t0001-init.sh |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/t/t0001-init.sh b/t/t0001-init.sh
index bbc9cb6..2f30203 100755
--- a/t/t0001-init.sh
+++ b/t/t0001-init.sh
@@ -185,14 +185,14 @@ test_expect_success 'init --bare/--shared overrides system/global config' '
 	git init --bare --shared=0666 init-bare-shared-override &&
 	check_config init-bare-shared-override true unset &&
 	test x0666 = \
-	x`git config -f init-bare-shared-override/config core.sharedRepository`
+	x$(git config -f init-bare-shared-override/config core.sharedRepository)
 '
 
 test_expect_success 'init honors global core.sharedRepository' '
 	test_config_global core.sharedRepository 0666 &&
 	git init shared-honor-global &&
 	test x0666 = \
-	x`git config -f shared-honor-global/.git/config core.sharedRepository`
+	x$(git config -f shared-honor-global/.git/config core.sharedRepository)
 '
 
 test_expect_success 'init rejects insanely long --template' '
@@ -285,7 +285,7 @@ test_expect_success 'init prefers command line to GIT_DIR' '
 test_expect_success 'init with separate gitdir' '
 	rm -rf newdir &&
 	git init --separate-git-dir realgitdir newdir &&
-	echo "gitdir: `pwd`/realgitdir" >expected &&
+	echo "gitdir: $(pwd)/realgitdir" >expected &&
 	test_cmp expected newdir/.git &&
 	test_path_is_dir realgitdir/refs
 '
@@ -299,7 +299,7 @@ test_expect_success 're-init to update git link' '
 	cd newdir &&
 	git init --separate-git-dir ../surrealgitdir
 	) &&
-	echo "gitdir: `pwd`/surrealgitdir" >expected &&
+	echo "gitdir: $(pwd)/surrealgitdir" >expected &&
 	test_cmp expected newdir/.git &&
 	test_path_is_dir surrealgitdir/refs &&
 	test_path_is_missing realgitdir/refs
@@ -312,7 +312,7 @@ test_expect_success 're-init to move gitdir' '
 	cd newdir &&
 	git init --separate-git-dir ../realgitdir
 	) &&
-	echo "gitdir: `pwd`/realgitdir" >expected &&
+	echo "gitdir: $(pwd)/realgitdir" >expected &&
 	test_cmp expected newdir/.git &&
 	test_path_is_dir realgitdir/refs
 '
@@ -326,7 +326,7 @@ test_expect_success SYMLINKS 're-init to move gitdir symlink' '
 	ln -s here .git &&
 	git init --separate-git-dir ../realgitdir
 	) &&
-	echo "gitdir: `pwd`/realgitdir" >expected &&
+	echo "gitdir: $(pwd)/realgitdir" >expected &&
 	test_cmp expected newdir/.git &&
 	test_cmp expected newdir/here &&
 	test_path_is_dir realgitdir/refs
-- 
1.7.10.4

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

* [PATCH 02/14] t0010-racy-git.sh: use the $( ... ) construct for command substitution
  2014-04-28 12:57 [PATCH 01/14] t0001-init.sh: use the $( ... ) construct for command substitution Elia Pinto
@ 2014-04-28 12:57 ` Elia Pinto
  2014-04-28 12:57 ` [PATCH 03/14] t0020-crlf.sh: " Elia Pinto
                   ` (12 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: Elia Pinto @ 2014-04-28 12:57 UTC (permalink / raw)
  To: git; +Cc: matthieu.moy, 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
   sed -i 's@`\(.*\)`@$(\1)@g' ${_f}
done

and then carefully proof-read.

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

diff --git a/t/t0010-racy-git.sh b/t/t0010-racy-git.sh
index e45a9e4..5657c5a 100755
--- a/t/t0010-racy-git.sh
+++ b/t/t0010-racy-git.sh
@@ -14,7 +14,7 @@ do
 	git update-index --add infocom
 	echo xyzzy >infocom
 
-	files=`git diff-files -p`
+	files=$(git diff-files -p)
 	test_expect_success \
 	"Racy GIT trial #$trial part A" \
 	'test "" != "$files"'
@@ -23,7 +23,7 @@ do
 	echo xyzzy >cornerstone
 	git update-index --add cornerstone
 
-	files=`git diff-files -p`
+	files=$(git diff-files -p)
 	test_expect_success \
 	"Racy GIT trial #$trial part B" \
 	'test "" != "$files"'
-- 
1.7.10.4

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

* [PATCH 03/14] t0020-crlf.sh: use the $( ... ) construct for command substitution
  2014-04-28 12:57 [PATCH 01/14] t0001-init.sh: use the $( ... ) construct for command substitution Elia Pinto
  2014-04-28 12:57 ` [PATCH 02/14] t0010-racy-git.sh: " Elia Pinto
@ 2014-04-28 12:57 ` Elia Pinto
  2014-04-28 12:57 ` [PATCH 04/14] t0025-crlf-auto.sh: " Elia Pinto
                   ` (11 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: Elia Pinto @ 2014-04-28 12:57 UTC (permalink / raw)
  To: git; +Cc: matthieu.moy, 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
   sed -i 's@`\(.*\)`@$(\1)@g' ${_f}
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <gitter.spiros@gmail.com>
---
 t/t0020-crlf.sh |   42 +++++++++++++++++++++---------------------
 1 file changed, 21 insertions(+), 21 deletions(-)

diff --git a/t/t0020-crlf.sh b/t/t0020-crlf.sh
index e526184..d2e51a8 100755
--- a/t/t0020-crlf.sh
+++ b/t/t0020-crlf.sh
@@ -20,14 +20,14 @@ test_expect_success setup '
 
 	git commit -m initial &&
 
-	one=`git rev-parse HEAD:one` &&
-	dir=`git rev-parse HEAD:dir` &&
-	two=`git rev-parse HEAD:dir/two` &&
-	three=`git rev-parse HEAD:three` &&
+	one=$(git rev-parse HEAD:one) &&
+	dir=$(git rev-parse HEAD:dir) &&
+	two=$(git rev-parse HEAD:dir/two) &&
+	three=$(git rev-parse HEAD:three) &&
 
 	for w in Some extra lines here; do echo $w; done >>one &&
 	git diff >patch.file &&
-	patched=`git hash-object --stdin <one` &&
+	patched=$(git hash-object --stdin <one) &&
 	git read-tree --reset -u HEAD &&
 
 	echo happy.
@@ -111,7 +111,7 @@ test_expect_success 'update with autocrlf=input' '
 		}
 	done &&
 
-	differs=`git diff-index --cached HEAD` &&
+	differs=$(git diff-index --cached HEAD) &&
 	test -z "$differs" || {
 		echo Oops "$differs"
 		false
@@ -135,7 +135,7 @@ test_expect_success 'update with autocrlf=true' '
 		}
 	done &&
 
-	differs=`git diff-index --cached HEAD` &&
+	differs=$(git diff-index --cached HEAD) &&
 	test -z "$differs" || {
 		echo Oops "$differs"
 		false
@@ -158,9 +158,9 @@ test_expect_success 'checkout with autocrlf=true' '
 			break
 		}
 	done &&
-	test "$one" = `git hash-object --stdin <one` &&
-	test "$two" = `git hash-object --stdin <dir/two` &&
-	differs=`git diff-index --cached HEAD` &&
+	test "$one" = $(git hash-object --stdin <one) &&
+	test "$two" = $(git hash-object --stdin <dir/two) &&
+	differs=$(git diff-index --cached HEAD) &&
 	test -z "$differs" || {
 		echo Oops "$differs"
 		false
@@ -184,9 +184,9 @@ test_expect_success 'checkout with autocrlf=input' '
 			git update-index -- $f
 		fi
 	done &&
-	test "$one" = `git hash-object --stdin <one` &&
-	test "$two" = `git hash-object --stdin <dir/two` &&
-	differs=`git diff-index --cached HEAD` &&
+	test "$one" = $(git hash-object --stdin <one) &&
+	test "$two" = $(git hash-object --stdin <dir/two) &&
+	differs=$(git diff-index --cached HEAD) &&
 	test -z "$differs" || {
 		echo Oops "$differs"
 		false
@@ -200,7 +200,7 @@ test_expect_success 'apply patch (autocrlf=input)' '
 	git read-tree --reset -u HEAD &&
 
 	git apply patch.file &&
-	test "$patched" = "`git hash-object --stdin <one`" || {
+	test "$patched" = "$(git hash-object --stdin <one)" || {
 		echo "Eh?  apply without index"
 		false
 	}
@@ -213,7 +213,7 @@ test_expect_success 'apply patch --cached (autocrlf=input)' '
 	git read-tree --reset -u HEAD &&
 
 	git apply --cached patch.file &&
-	test "$patched" = `git rev-parse :one` || {
+	test "$patched" = $(git rev-parse :one) || {
 		echo "Eh?  apply with --cached"
 		false
 	}
@@ -226,8 +226,8 @@ test_expect_success 'apply patch --index (autocrlf=input)' '
 	git read-tree --reset -u HEAD &&
 
 	git apply --index patch.file &&
-	test "$patched" = `git rev-parse :one` &&
-	test "$patched" = `git hash-object --stdin <one` || {
+	test "$patched" = $(git rev-parse :one) &&
+	test "$patched" = $(git hash-object --stdin <one) || {
 		echo "Eh?  apply with --index"
 		false
 	}
@@ -240,7 +240,7 @@ test_expect_success 'apply patch (autocrlf=true)' '
 	git read-tree --reset -u HEAD &&
 
 	git apply patch.file &&
-	test "$patched" = "`remove_cr <one | git hash-object --stdin`" || {
+	test "$patched" = "$(remove_cr <one | git hash-object --stdin)" || {
 		echo "Eh?  apply without index"
 		false
 	}
@@ -253,7 +253,7 @@ test_expect_success 'apply patch --cached (autocrlf=true)' '
 	git read-tree --reset -u HEAD &&
 
 	git apply --cached patch.file &&
-	test "$patched" = `git rev-parse :one` || {
+	test "$patched" = $(git rev-parse :one) || {
 		echo "Eh?  apply without index"
 		false
 	}
@@ -266,8 +266,8 @@ test_expect_success 'apply patch --index (autocrlf=true)' '
 	git read-tree --reset -u HEAD &&
 
 	git apply --index patch.file &&
-	test "$patched" = `git rev-parse :one` &&
-	test "$patched" = "`remove_cr <one | git hash-object --stdin`" || {
+	test "$patched" = $(git rev-parse :one) &&
+	test "$patched" = "$(remove_cr <one | git hash-object --stdin)" || {
 		echo "Eh?  apply with --index"
 		false
 	}
-- 
1.7.10.4

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

* [PATCH 04/14] t0025-crlf-auto.sh: use the $( ... ) construct for command substitution
  2014-04-28 12:57 [PATCH 01/14] t0001-init.sh: use the $( ... ) construct for command substitution Elia Pinto
  2014-04-28 12:57 ` [PATCH 02/14] t0010-racy-git.sh: " Elia Pinto
  2014-04-28 12:57 ` [PATCH 03/14] t0020-crlf.sh: " Elia Pinto
@ 2014-04-28 12:57 ` Elia Pinto
  2014-04-28 12:57 ` [PATCH 05/14] t0026-eol-config.sh: " Elia Pinto
                   ` (10 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: Elia Pinto @ 2014-04-28 12:57 UTC (permalink / raw)
  To: git; +Cc: matthieu.moy, 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
   sed -i 's@`\(.*\)`@$(\1)@g' ${_f}
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <gitter.spiros@gmail.com>
---
 t/t0025-crlf-auto.sh |   38 +++++++++++++++++++-------------------
 1 file changed, 19 insertions(+), 19 deletions(-)

diff --git a/t/t0025-crlf-auto.sh b/t/t0025-crlf-auto.sh
index f5f67a6..b0e5694 100755
--- a/t/t0025-crlf-auto.sh
+++ b/t/t0025-crlf-auto.sh
@@ -19,9 +19,9 @@ test_expect_success setup '
 
 	git commit -m initial &&
 
-	one=`git rev-parse HEAD:one` &&
-	two=`git rev-parse HEAD:two` &&
-	three=`git rev-parse HEAD:three` &&
+	one=$(git rev-parse HEAD:one) &&
+	two=$(git rev-parse HEAD:two) &&
+	three=$(git rev-parse HEAD:three) &&
 
 	echo happy.
 '
@@ -33,9 +33,9 @@ test_expect_success 'default settings cause no changes' '
 
 	! has_cr one &&
 	has_cr two &&
-	onediff=`git diff one` &&
-	twodiff=`git diff two` &&
-	threediff=`git diff three` &&
+	onediff=$(git diff one) &&
+	twodiff=$(git diff two) &&
+	threediff=$(git diff three) &&
 	test -z "$onediff" -a -z "$twodiff" -a -z "$threediff"
 '
 
@@ -48,7 +48,7 @@ test_expect_success 'crlf=true causes a CRLF file to be normalized' '
 
 	# Note, "normalized" means that git will normalize it if added
 	has_cr two &&
-	twodiff=`git diff two` &&
+	twodiff=$(git diff two) &&
 	test -n "$twodiff"
 '
 
@@ -60,7 +60,7 @@ test_expect_success 'text=true causes a CRLF file to be normalized' '
 
 	# Note, "normalized" means that git will normalize it if added
 	has_cr two &&
-	twodiff=`git diff two` &&
+	twodiff=$(git diff two) &&
 	test -n "$twodiff"
 '
 
@@ -72,7 +72,7 @@ test_expect_success 'eol=crlf gives a normalized file CRLFs with autocrlf=false'
 	git read-tree --reset -u HEAD &&
 
 	has_cr one &&
-	onediff=`git diff one` &&
+	onediff=$(git diff one) &&
 	test -z "$onediff"
 '
 
@@ -84,7 +84,7 @@ test_expect_success 'eol=crlf gives a normalized file CRLFs with autocrlf=input'
 	git read-tree --reset -u HEAD &&
 
 	has_cr one &&
-	onediff=`git diff one` &&
+	onediff=$(git diff one) &&
 	test -z "$onediff"
 '
 
@@ -96,7 +96,7 @@ test_expect_success 'eol=lf gives a normalized file LFs with autocrlf=true' '
 	git read-tree --reset -u HEAD &&
 
 	! has_cr one &&
-	onediff=`git diff one` &&
+	onediff=$(git diff one) &&
 	test -z "$onediff"
 '
 
@@ -108,9 +108,9 @@ test_expect_success 'autocrlf=true does not normalize CRLF files' '
 
 	has_cr one &&
 	has_cr two &&
-	onediff=`git diff one` &&
-	twodiff=`git diff two` &&
-	threediff=`git diff three` &&
+	onediff=$(git diff one) &&
+	twodiff=$(git diff two) &&
+	threediff=$(git diff three) &&
 	test -z "$onediff" -a -z "$twodiff" -a -z "$threediff"
 '
 
@@ -123,9 +123,9 @@ test_expect_success 'text=auto, autocrlf=true _does_ normalize CRLF files' '
 
 	has_cr one &&
 	has_cr two &&
-	onediff=`git diff one` &&
-	twodiff=`git diff two` &&
-	threediff=`git diff three` &&
+	onediff=$(git diff one) &&
+	twodiff=$(git diff two) &&
+	threediff=$(git diff three) &&
 	test -z "$onediff" -a -n "$twodiff" -a -z "$threediff"
 '
 
@@ -137,7 +137,7 @@ test_expect_success 'text=auto, autocrlf=true does not normalize binary files' '
 	git read-tree --reset -u HEAD &&
 
 	! has_cr three &&
-	threediff=`git diff three` &&
+	threediff=$(git diff three) &&
 	test -z "$threediff"
 '
 
@@ -148,7 +148,7 @@ test_expect_success 'eol=crlf _does_ normalize binary files' '
 	git read-tree --reset -u HEAD &&
 
 	has_cr three &&
-	threediff=`git diff three` &&
+	threediff=$(git diff three) &&
 	test -z "$threediff"
 '
 
-- 
1.7.10.4

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

* [PATCH 05/14] t0026-eol-config.sh: use the $( ... ) construct for command substitution
  2014-04-28 12:57 [PATCH 01/14] t0001-init.sh: use the $( ... ) construct for command substitution Elia Pinto
                   ` (2 preceding siblings ...)
  2014-04-28 12:57 ` [PATCH 04/14] t0025-crlf-auto.sh: " Elia Pinto
@ 2014-04-28 12:57 ` Elia Pinto
  2014-04-28 12:57 ` [PATCH 06/14] t0030-stripspace.sh: " Elia Pinto
                   ` (9 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: Elia Pinto @ 2014-04-28 12:57 UTC (permalink / raw)
  To: git; +Cc: matthieu.moy, 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
   sed -i 's@`\(.*\)`@$(\1)@g' ${_f}
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <gitter.spiros@gmail.com>
---
 t/t0026-eol-config.sh |   20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/t/t0026-eol-config.sh b/t/t0026-eol-config.sh
index fe0164b..e1126aa 100755
--- a/t/t0026-eol-config.sh
+++ b/t/t0026-eol-config.sh
@@ -20,8 +20,8 @@ test_expect_success setup '
 
 	git commit -m initial &&
 
-	one=`git rev-parse HEAD:one` &&
-	two=`git rev-parse HEAD:two` &&
+	one=$(git rev-parse HEAD:one) &&
+	two=$(git rev-parse HEAD:two) &&
 
 	echo happy.
 '
@@ -34,8 +34,8 @@ test_expect_success 'eol=lf puts LFs in normalized file' '
 
 	! has_cr one &&
 	! has_cr two &&
-	onediff=`git diff one` &&
-	twodiff=`git diff two` &&
+	onediff=$(git diff one) &&
+	twodiff=$(git diff two) &&
 	test -z "$onediff" -a -z "$twodiff"
 '
 
@@ -47,8 +47,8 @@ test_expect_success 'eol=crlf puts CRLFs in normalized file' '
 
 	has_cr one &&
 	! has_cr two &&
-	onediff=`git diff one` &&
-	twodiff=`git diff two` &&
+	onediff=$(git diff one) &&
+	twodiff=$(git diff two) &&
 	test -z "$onediff" -a -z "$twodiff"
 '
 
@@ -61,8 +61,8 @@ test_expect_success 'autocrlf=true overrides eol=lf' '
 
 	has_cr one &&
 	has_cr two &&
-	onediff=`git diff one` &&
-	twodiff=`git diff two` &&
+	onediff=$(git diff one) &&
+	twodiff=$(git diff two) &&
 	test -z "$onediff" -a -z "$twodiff"
 '
 
@@ -75,8 +75,8 @@ test_expect_success 'autocrlf=true overrides unset eol' '
 
 	has_cr one &&
 	has_cr two &&
-	onediff=`git diff one` &&
-	twodiff=`git diff two` &&
+	onediff=$(git diff one) &&
+	twodiff=$(git diff two) &&
 	test -z "$onediff" -a -z "$twodiff"
 '
 
-- 
1.7.10.4

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

* [PATCH 06/14] t0030-stripspace.sh: use the $( ... ) construct for command substitution
  2014-04-28 12:57 [PATCH 01/14] t0001-init.sh: use the $( ... ) construct for command substitution Elia Pinto
                   ` (3 preceding siblings ...)
  2014-04-28 12:57 ` [PATCH 05/14] t0026-eol-config.sh: " Elia Pinto
@ 2014-04-28 12:57 ` Elia Pinto
  2014-04-28 12:57 ` [PATCH 07/14] t0300-credentials.sh: " Elia Pinto
                   ` (8 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: Elia Pinto @ 2014-04-28 12:57 UTC (permalink / raw)
  To: git; +Cc: matthieu.moy, 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
   sed -i 's@`\(.*\)`@$(\1)@g' ${_f}
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <gitter.spiros@gmail.com>
---
 t/t0030-stripspace.sh |   20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/t/t0030-stripspace.sh b/t/t0030-stripspace.sh
index a8e84d8..0333dd9 100755
--- a/t/t0030-stripspace.sh
+++ b/t/t0030-stripspace.sh
@@ -225,22 +225,22 @@ test_expect_success \
 
 test_expect_success \
     'text without newline at end should end with newline' '
-    test `printf "$ttt" | git stripspace | wc -l` -gt 0 &&
-    test `printf "$ttt$ttt" | git stripspace | wc -l` -gt 0 &&
-    test `printf "$ttt$ttt$ttt" | git stripspace | wc -l` -gt 0 &&
-    test `printf "$ttt$ttt$ttt$ttt" | git stripspace | wc -l` -gt 0
+    test $(printf "$ttt" | git stripspace | wc -l) -gt 0 &&
+    test $(printf "$ttt$ttt" | git stripspace | wc -l) -gt 0 &&
+    test $(printf "$ttt$ttt$ttt" | git stripspace | wc -l) -gt 0 &&
+    test $(printf "$ttt$ttt$ttt$ttt" | git stripspace | wc -l) -gt 0
 '
 
 # text plus spaces at the end:
 
 test_expect_success \
     'text plus spaces without newline at end should end with newline' '
-    test `printf "$ttt$sss" | git stripspace | wc -l` -gt 0 &&
-    test `printf "$ttt$ttt$sss" | git stripspace | wc -l` -gt 0 &&
-    test `printf "$ttt$ttt$ttt$sss" | git stripspace | wc -l` -gt 0 &&
-    test `printf "$ttt$sss$sss" | git stripspace | wc -l` -gt 0 &&
-    test `printf "$ttt$ttt$sss$sss" | git stripspace | wc -l` -gt 0 &&
-    test `printf "$ttt$sss$sss$sss" | git stripspace | wc -l` -gt 0
+    test $(printf "$ttt$sss" | git stripspace | wc -l) -gt 0 &&
+    test $(printf "$ttt$ttt$sss" | git stripspace | wc -l) -gt 0 &&
+    test $(printf "$ttt$ttt$ttt$sss" | git stripspace | wc -l) -gt 0 &&
+    test $(printf "$ttt$sss$sss" | git stripspace | wc -l) -gt 0 &&
+    test $(printf "$ttt$ttt$sss$sss" | git stripspace | wc -l) -gt 0 &&
+    test $(printf "$ttt$sss$sss$sss" | git stripspace | wc -l) -gt 0
 '
 
 test_expect_success \
-- 
1.7.10.4

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

* [PATCH 07/14] t0300-credentials.sh: use the $( ... ) construct for command substitution
  2014-04-28 12:57 [PATCH 01/14] t0001-init.sh: use the $( ... ) construct for command substitution Elia Pinto
                   ` (4 preceding siblings ...)
  2014-04-28 12:57 ` [PATCH 06/14] t0030-stripspace.sh: " Elia Pinto
@ 2014-04-28 12:57 ` Elia Pinto
  2014-04-28 12:57 ` [PATCH 08/14] t1000-read-tree-m-3way.sh: " Elia Pinto
                   ` (7 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: Elia Pinto @ 2014-04-28 12:57 UTC (permalink / raw)
  To: git; +Cc: matthieu.moy, 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
   sed -i 's@`\(.*\)`@$(\1)@g' ${_f}
done

and then carefully proof-read.

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

diff --git a/t/t0300-credentials.sh b/t/t0300-credentials.sh
index 538ea5f..57ea5a1 100755
--- a/t/t0300-credentials.sh
+++ b/t/t0300-credentials.sh
@@ -6,7 +6,7 @@ test_description='basic credential helper tests'
 
 test_expect_success 'setup helper scripts' '
 	cat >dump <<-\EOF &&
-	whoami=`echo $0 | sed s/.*git-credential-//`
+	whoami=$(echo $0 | sed s/.*git-credential-//)
 	echo >&2 "$whoami: $*"
 	OIFS=$IFS
 	IFS==
-- 
1.7.10.4

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

* [PATCH 08/14] t1000-read-tree-m-3way.sh: use the $( ... ) construct for command substitution
  2014-04-28 12:57 [PATCH 01/14] t0001-init.sh: use the $( ... ) construct for command substitution Elia Pinto
                   ` (5 preceding siblings ...)
  2014-04-28 12:57 ` [PATCH 07/14] t0300-credentials.sh: " Elia Pinto
@ 2014-04-28 12:57 ` Elia Pinto
  2014-04-28 12:57 ` [PATCH 09/14] t1001-read-tree-m-2way.sh: " Elia Pinto
                   ` (6 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: Elia Pinto @ 2014-04-28 12:57 UTC (permalink / raw)
  To: git; +Cc: matthieu.moy, 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
   sed -i 's@`\(.*\)`@$(\1)@g' ${_f}
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <gitter.spiros@gmail.com>
---
 t/t1000-read-tree-m-3way.sh |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/t/t1000-read-tree-m-3way.sh b/t/t1000-read-tree-m-3way.sh
index babcdd2..a0b79b4 100755
--- a/t/t1000-read-tree-m-3way.sh
+++ b/t/t1000-read-tree-m-3way.sh
@@ -519,10 +519,10 @@ test_expect_success \
     'rm -f .git/index F16 &&
     echo F16 >F16 &&
     git update-index --add F16 &&
-    tree0=`git write-tree` &&
+    tree0=$(git write-tree) &&
     echo E16 >F16 &&
     git update-index F16 &&
-    tree1=`git write-tree` &&
+    tree1=$(git write-tree) &&
     read_tree_must_succeed -m $tree0 $tree1 $tree1 $tree0 &&
     git ls-files --stage'
 
-- 
1.7.10.4

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

* [PATCH 09/14] t1001-read-tree-m-2way.sh: use the $( ... ) construct for command substitution
  2014-04-28 12:57 [PATCH 01/14] t0001-init.sh: use the $( ... ) construct for command substitution Elia Pinto
                   ` (6 preceding siblings ...)
  2014-04-28 12:57 ` [PATCH 08/14] t1000-read-tree-m-3way.sh: " Elia Pinto
@ 2014-04-28 12:57 ` Elia Pinto
  2014-04-28 12:57 ` [PATCH 10/14] t1002-read-tree-m-u-2way.sh: " Elia Pinto
                   ` (5 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: Elia Pinto @ 2014-04-28 12:57 UTC (permalink / raw)
  To: git; +Cc: matthieu.moy, 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
   sed -i 's@`\(.*\)`@$(\1)@g' ${_f}
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <gitter.spiros@gmail.com>
---
 t/t1001-read-tree-m-2way.sh |   18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/t/t1001-read-tree-m-2way.sh b/t/t1001-read-tree-m-2way.sh
index 3a24abf..db1b6f5 100755
--- a/t/t1001-read-tree-m-2way.sh
+++ b/t/t1001-read-tree-m-2way.sh
@@ -36,7 +36,7 @@ compare_change () {
 }
 
 check_cache_at () {
-	clean_if_empty=`git diff-files -- "$1"`
+	clean_if_empty=$(git diff-files -- "$1")
 	case "$clean_if_empty" in
 	'')  echo "$1: clean" ;;
 	?*)  echo "$1: dirty" ;;
@@ -68,14 +68,14 @@ test_expect_success \
      echo rezrov >rezrov &&
      echo yomin >yomin &&
      git update-index --add nitfol bozbar rezrov &&
-     treeH=`git write-tree` &&
+     treeH=$(git write-tree) &&
      echo treeH $treeH &&
      git ls-tree $treeH &&
 
      cat bozbar-new >bozbar &&
      git update-index --add frotz bozbar --force-remove rezrov &&
      git ls-files --stage >M.out &&
-     treeM=`git write-tree` &&
+     treeM=$(git write-tree) &&
      echo treeM $treeM &&
      git ls-tree $treeM &&
      git diff-tree $treeH $treeM'
@@ -315,7 +315,7 @@ test_expect_success \
     'rm -f .git/index &&
      echo DF >DF &&
      git update-index --add DF &&
-     treeDF=`git write-tree` &&
+     treeDF=$(git write-tree) &&
      echo treeDF $treeDF &&
      git ls-tree $treeDF &&
 
@@ -323,7 +323,7 @@ test_expect_success \
      mkdir DF &&
      echo DF/DF >DF/DF &&
      git update-index --add --remove DF DF/DF &&
-     treeDFDF=`git write-tree` &&
+     treeDFDF=$(git write-tree) &&
      echo treeDFDF $treeDFDF &&
      git ls-tree $treeDFDF &&
      git ls-files --stage >DFDF.out'
@@ -345,7 +345,7 @@ test_expect_success \
     'rm -f .git/index &&
      : >a &&
      git update-index --add a &&
-     treeM=`git write-tree` &&
+     treeM=$(git write-tree) &&
      echo treeM $treeM &&
      git ls-tree $treeM &&
      git ls-files --stage >treeM.out &&
@@ -354,7 +354,7 @@ test_expect_success \
      git update-index --remove a &&
      mkdir a &&
      : >a/b &&
-     treeH=`git write-tree` &&
+     treeH=$(git write-tree) &&
      echo treeH $treeH &&
      git ls-tree $treeH'
 
@@ -372,7 +372,7 @@ test_expect_success \
      mkdir c &&
      : >c/d &&
      git update-index --add a c/d &&
-     treeM=`git write-tree` &&
+     treeM=$(git write-tree) &&
      echo treeM $treeM &&
      git ls-tree $treeM &&
      git ls-files --stage >treeM.out &&
@@ -381,7 +381,7 @@ test_expect_success \
      mkdir a &&
      : >a/b &&
      git update-index --add --remove a a/b &&
-     treeH=`git write-tree` &&
+     treeH=$(git write-tree) &&
      echo treeH $treeH &&
      git ls-tree $treeH'
 
-- 
1.7.10.4

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

* [PATCH 10/14] t1002-read-tree-m-u-2way.sh: use the $( ... ) construct for command substitution
  2014-04-28 12:57 [PATCH 01/14] t0001-init.sh: use the $( ... ) construct for command substitution Elia Pinto
                   ` (7 preceding siblings ...)
  2014-04-28 12:57 ` [PATCH 09/14] t1001-read-tree-m-2way.sh: " Elia Pinto
@ 2014-04-28 12:57 ` Elia Pinto
  2014-04-28 12:57 ` [PATCH 11/14] t1003-read-tree-prefix.sh: " Elia Pinto
                   ` (4 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: Elia Pinto @ 2014-04-28 12:57 UTC (permalink / raw)
  To: git; +Cc: matthieu.moy, 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
   sed -i 's@`\(.*\)`@$(\1)@g' ${_f}
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <gitter.spiros@gmail.com>
---
 t/t1002-read-tree-m-u-2way.sh |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/t/t1002-read-tree-m-u-2way.sh b/t/t1002-read-tree-m-u-2way.sh
index a847709..fed877b 100755
--- a/t/t1002-read-tree-m-u-2way.sh
+++ b/t/t1002-read-tree-m-u-2way.sh
@@ -21,7 +21,7 @@ compare_change () {
 }
 
 check_cache_at () {
-	clean_if_empty=`git diff-files -- "$1"`
+	clean_if_empty=$(git diff-files -- "$1")
 	case "$clean_if_empty" in
 	'')  echo "$1: clean" ;;
 	?*)  echo "$1: dirty" ;;
@@ -41,14 +41,14 @@ test_expect_success \
      echo bozbar >bozbar &&
      echo rezrov >rezrov &&
      git update-index --add nitfol bozbar rezrov &&
-     treeH=`git write-tree` &&
+     treeH=$(git write-tree) &&
      echo treeH $treeH &&
      git ls-tree $treeH &&
 
      echo gnusto >bozbar &&
      git update-index --add frotz bozbar --force-remove rezrov &&
      git ls-files --stage >M.out &&
-     treeM=`git write-tree` &&
+     treeM=$(git write-tree) &&
      echo treeM $treeM &&
      git ls-tree $treeM &&
      sum bozbar frotz nitfol >M.sum &&
@@ -318,7 +318,7 @@ test_expect_success \
     'rm -f .git/index &&
      echo DF >DF &&
      git update-index --add DF &&
-     treeDF=`git write-tree` &&
+     treeDF=$(git write-tree) &&
      echo treeDF $treeDF &&
      git ls-tree $treeDF &&
 
@@ -326,7 +326,7 @@ test_expect_success \
      mkdir DF &&
      echo DF/DF >DF/DF &&
      git update-index --add --remove DF DF/DF &&
-     treeDFDF=`git write-tree` &&
+     treeDFDF=$(git write-tree) &&
      echo treeDFDF $treeDFDF &&
      git ls-tree $treeDFDF &&
      git ls-files --stage >DFDF.out'
-- 
1.7.10.4

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

* [PATCH 11/14] t1003-read-tree-prefix.sh: use the $( ... ) construct for command substitution
  2014-04-28 12:57 [PATCH 01/14] t0001-init.sh: use the $( ... ) construct for command substitution Elia Pinto
                   ` (8 preceding siblings ...)
  2014-04-28 12:57 ` [PATCH 10/14] t1002-read-tree-m-u-2way.sh: " Elia Pinto
@ 2014-04-28 12:57 ` Elia Pinto
  2014-04-28 12:57 ` [PATCH 12/14] t1004-read-tree-m-u-wf.sh: " Elia Pinto
                   ` (3 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: Elia Pinto @ 2014-04-28 12:57 UTC (permalink / raw)
  To: git; +Cc: matthieu.moy, 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
   sed -i 's@`\(.*\)`@$(\1)@g' ${_f}
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <gitter.spiros@gmail.com>
---
 t/t1003-read-tree-prefix.sh |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/t/t1003-read-tree-prefix.sh b/t/t1003-read-tree-prefix.sh
index 8c6d67e..b6111cd 100755
--- a/t/t1003-read-tree-prefix.sh
+++ b/t/t1003-read-tree-prefix.sh
@@ -11,7 +11,7 @@ test_description='git read-tree --prefix test.
 test_expect_success setup '
 	echo hello >one &&
 	git update-index --add one &&
-	tree=`git write-tree` &&
+	tree=$(git write-tree) &&
 	echo tree is $tree
 '
 
-- 
1.7.10.4

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

* [PATCH 12/14] t1004-read-tree-m-u-wf.sh: use the $( ... ) construct for command substitution
  2014-04-28 12:57 [PATCH 01/14] t0001-init.sh: use the $( ... ) construct for command substitution Elia Pinto
                   ` (9 preceding siblings ...)
  2014-04-28 12:57 ` [PATCH 11/14] t1003-read-tree-prefix.sh: " Elia Pinto
@ 2014-04-28 12:57 ` Elia Pinto
  2014-04-28 12:57 ` [PATCH 13/14] t1020-subdirectory.sh: " Elia Pinto
                   ` (2 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: Elia Pinto @ 2014-04-28 12:57 UTC (permalink / raw)
  To: git; +Cc: matthieu.moy, 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
   sed -i 's@`\(.*\)`@$(\1)@g' ${_f}
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <gitter.spiros@gmail.com>
---
 t/t1004-read-tree-m-u-wf.sh |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/t/t1004-read-tree-m-u-wf.sh b/t/t1004-read-tree-m-u-wf.sh
index 3e72aff..c70cf42 100755
--- a/t/t1004-read-tree-m-u-wf.sh
+++ b/t/t1004-read-tree-m-u-wf.sh
@@ -30,7 +30,7 @@ test_expect_success 'two-way not clobbering' '
 
 	echo >file2 master creates untracked file2 &&
 	echo >subdir/file2 master creates untracked subdir/file2 &&
-	if err=`read_tree_u_must_succeed -m -u master side 2>&1`
+	if err=$(read_tree_u_must_succeed -m -u master side 2>&1)
 	then
 		echo should have complained
 		false
@@ -43,7 +43,7 @@ echo file2 >.gitignore
 
 test_expect_success 'two-way with incorrect --exclude-per-directory (1)' '
 
-	if err=`read_tree_u_must_succeed -m --exclude-per-directory=.gitignore master side 2>&1`
+	if err=$(read_tree_u_must_succeed -m --exclude-per-directory=.gitignore master side 2>&1)
 	then
 		echo should have complained
 		false
@@ -54,7 +54,7 @@ test_expect_success 'two-way with incorrect --exclude-per-directory (1)' '
 
 test_expect_success 'two-way with incorrect --exclude-per-directory (2)' '
 
-	if err=`read_tree_u_must_succeed -m -u --exclude-per-directory=foo --exclude-per-directory=.gitignore master side 2>&1`
+	if err=$(read_tree_u_must_succeed -m -u --exclude-per-directory=foo --exclude-per-directory=.gitignore master side 2>&1)
 	then
 		echo should have complained
 		false
@@ -95,7 +95,7 @@ test_expect_success 'three-way not clobbering a working tree file' '
 	git checkout master &&
 	echo >file3 file three created in master, untracked &&
 	echo >subdir/file3 file three created in master, untracked &&
-	if err=`read_tree_u_must_succeed -m -u branch-point master side 2>&1`
+	if err=$(read_tree_u_must_succeed -m -u branch-point master side 2>&1)
 	then
 		echo should have complained
 		false
-- 
1.7.10.4

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

* [PATCH 13/14] t1020-subdirectory.sh: use the $( ... ) construct for command substitution
  2014-04-28 12:57 [PATCH 01/14] t0001-init.sh: use the $( ... ) construct for command substitution Elia Pinto
                   ` (10 preceding siblings ...)
  2014-04-28 12:57 ` [PATCH 12/14] t1004-read-tree-m-u-wf.sh: " Elia Pinto
@ 2014-04-28 12:57 ` Elia Pinto
  2014-04-28 12:57 ` [PATCH 14/14] t1050-large.sh: " Elia Pinto
  2014-04-28 13:56 ` [PATCH 01/14] t0001-init.sh: " Matthieu Moy
  13 siblings, 0 replies; 15+ messages in thread
From: Elia Pinto @ 2014-04-28 12:57 UTC (permalink / raw)
  To: git; +Cc: matthieu.moy, 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
   sed -i 's@`\(.*\)`@$(\1)@g' ${_f}
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <gitter.spiros@gmail.com>
---
 t/t1020-subdirectory.sh |   22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/t/t1020-subdirectory.sh b/t/t1020-subdirectory.sh
index 6902320..62c0d25 100755
--- a/t/t1020-subdirectory.sh
+++ b/t/t1020-subdirectory.sh
@@ -20,27 +20,27 @@ test_expect_success setup '
 
 test_expect_success 'update-index and ls-files' '
 	git update-index --add one &&
-	case "`git ls-files`" in
+	case "$(git ls-files)" in
 	one) echo pass one ;;
 	*) echo bad one; exit 1 ;;
 	esac &&
 	(
 		cd dir &&
 		git update-index --add two &&
-		case "`git ls-files`" in
+		case "$(git ls-files)" in
 		two) echo pass two ;;
 		*) echo bad two; exit 1 ;;
 		esac
 	) &&
-	case "`git ls-files`" in
+	case "$(git ls-files)" in
 	dir/two"$LF"one) echo pass both ;;
 	*) echo bad; exit 1 ;;
 	esac
 '
 
 test_expect_success 'cat-file' '
-	two=`git ls-files -s dir/two` &&
-	two=`expr "$two" : "[0-7]* \\([0-9a-f]*\\)"` &&
+	two=$(git ls-files -s dir/two) &&
+	two=$(expr "$two" : "[0-7]* \\([0-9a-f]*\\)") &&
 	echo "$two" &&
 	git cat-file -p "$two" >actual &&
 	cmp dir/two actual &&
@@ -55,18 +55,18 @@ rm -f actual dir/actual
 test_expect_success 'diff-files' '
 	echo a >>one &&
 	echo d >>dir/two &&
-	case "`git diff-files --name-only`" in
+	case "$(git diff-files --name-only)" in
 	dir/two"$LF"one) echo pass top ;;
 	*) echo bad top; exit 1 ;;
 	esac &&
 	# diff should not omit leading paths
 	(
 		cd dir &&
-		case "`git diff-files --name-only`" in
+		case "$(git diff-files --name-only)" in
 		dir/two"$LF"one) echo pass subdir ;;
 		*) echo bad subdir; exit 1 ;;
 		esac &&
-		case "`git diff-files --name-only .`" in
+		case "$(git diff-files --name-only .)" in
 		dir/two) echo pass subdir limited ;;
 		*) echo bad subdir limited; exit 1 ;;
 		esac
@@ -74,11 +74,11 @@ test_expect_success 'diff-files' '
 '
 
 test_expect_success 'write-tree' '
-	top=`git write-tree` &&
+	top=$(git write-tree) &&
 	echo $top &&
 	(
 		cd dir &&
-		sub=`git write-tree` &&
+		sub=$(git write-tree) &&
 		echo $sub &&
 		test "z$top" = "z$sub"
 	)
@@ -96,7 +96,7 @@ test_expect_success 'checkout-index' '
 
 test_expect_success 'read-tree' '
 	rm -f one dir/two &&
-	tree=`git write-tree` &&
+	tree=$(git write-tree) &&
 	read_tree_u_must_succeed --reset -u "$tree" &&
 	cmp one original.one &&
 	cmp dir/two original.two &&
-- 
1.7.10.4

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

* [PATCH 14/14] t1050-large.sh: use the $( ... ) construct for command substitution
  2014-04-28 12:57 [PATCH 01/14] t0001-init.sh: use the $( ... ) construct for command substitution Elia Pinto
                   ` (11 preceding siblings ...)
  2014-04-28 12:57 ` [PATCH 13/14] t1020-subdirectory.sh: " Elia Pinto
@ 2014-04-28 12:57 ` Elia Pinto
  2014-04-28 13:56 ` [PATCH 01/14] t0001-init.sh: " Matthieu Moy
  13 siblings, 0 replies; 15+ messages in thread
From: Elia Pinto @ 2014-04-28 12:57 UTC (permalink / raw)
  To: git; +Cc: matthieu.moy, 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
   sed -i 's@`\(.*\)`@$(\1)@g' ${_f}
done

and then carefully proof-read.

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

diff --git a/t/t1050-large.sh b/t/t1050-large.sh
index fd10528..aea4936 100755
--- a/t/t1050-large.sh
+++ b/t/t1050-large.sh
@@ -131,7 +131,7 @@ test_expect_success 'git-show a large file' '
 '
 
 test_expect_success 'index-pack' '
-	git clone file://"`pwd`"/.git foo &&
+	git clone file://"$(pwd)"/.git foo &&
 	GIT_DIR=non-existent git index-pack --strict --verify foo/.git/objects/pack/*.pack
 '
 
@@ -140,7 +140,7 @@ test_expect_success 'repack' '
 '
 
 test_expect_success 'pack-objects with large loose object' '
-	SHA1=`git hash-object huge` &&
+	SHA1=$(git hash-object huge) &&
 	test_create_repo loose &&
 	echo $SHA1 | git pack-objects --stdout |
 		GIT_ALLOC_LIMIT=0 GIT_DIR=loose/.git git unpack-objects &&
-- 
1.7.10.4

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

* Re: [PATCH 01/14] t0001-init.sh: use the $( ... ) construct for command substitution
  2014-04-28 12:57 [PATCH 01/14] t0001-init.sh: use the $( ... ) construct for command substitution Elia Pinto
                   ` (12 preceding siblings ...)
  2014-04-28 12:57 ` [PATCH 14/14] t1050-large.sh: " Elia Pinto
@ 2014-04-28 13:56 ` Matthieu Moy
  13 siblings, 0 replies; 15+ messages in thread
From: Matthieu Moy @ 2014-04-28 13:56 UTC (permalink / raw)
  To: Elia Pinto; +Cc: git

Patches 1 to 14/14 are

Reviewed-by: Matthieu Moy <Matthieu.Moy@imag.fr>

(in mailer and then log -p --color-words)

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/

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

end of thread, other threads:[~2014-04-28 13:57 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-28 12:57 [PATCH 01/14] t0001-init.sh: use the $( ... ) construct for command substitution Elia Pinto
2014-04-28 12:57 ` [PATCH 02/14] t0010-racy-git.sh: " Elia Pinto
2014-04-28 12:57 ` [PATCH 03/14] t0020-crlf.sh: " Elia Pinto
2014-04-28 12:57 ` [PATCH 04/14] t0025-crlf-auto.sh: " Elia Pinto
2014-04-28 12:57 ` [PATCH 05/14] t0026-eol-config.sh: " Elia Pinto
2014-04-28 12:57 ` [PATCH 06/14] t0030-stripspace.sh: " Elia Pinto
2014-04-28 12:57 ` [PATCH 07/14] t0300-credentials.sh: " Elia Pinto
2014-04-28 12:57 ` [PATCH 08/14] t1000-read-tree-m-3way.sh: " Elia Pinto
2014-04-28 12:57 ` [PATCH 09/14] t1001-read-tree-m-2way.sh: " Elia Pinto
2014-04-28 12:57 ` [PATCH 10/14] t1002-read-tree-m-u-2way.sh: " Elia Pinto
2014-04-28 12:57 ` [PATCH 11/14] t1003-read-tree-prefix.sh: " Elia Pinto
2014-04-28 12:57 ` [PATCH 12/14] t1004-read-tree-m-u-wf.sh: " Elia Pinto
2014-04-28 12:57 ` [PATCH 13/14] t1020-subdirectory.sh: " Elia Pinto
2014-04-28 12:57 ` [PATCH 14/14] t1050-large.sh: " Elia Pinto
2014-04-28 13:56 ` [PATCH 01/14] t0001-init.sh: " Matthieu Moy

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