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 15:05 Elia Pinto
  2015-12-22 15:05 ` [PATCH 01/10] t/t1100-commit-tree-options.sh: " Elia Pinto
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ 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] 12+ messages in thread

* [PATCH 01/10] t/t1100-commit-tree-options.sh: use the $( ... ) construct for command substitution
  2015-12-22 15:05 [PATCH 00/10] use the $( ... ) construct for command substitution Elia Pinto
@ 2015-12-22 15:05 ` Elia Pinto
  2015-12-22 15:05 ` [PATCH 02/10] t/t1401-symbolic-ref.sh: " Elia Pinto
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Elia Pinto @ 2015-12-22 15:05 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/t1100-commit-tree-options.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/t/t1100-commit-tree-options.sh b/t/t1100-commit-tree-options.sh
index f8457f9..b7e9b4fc 100755
--- a/t/t1100-commit-tree-options.sh
+++ b/t/t1100-commit-tree-options.sh
@@ -35,11 +35,11 @@ test_expect_success \
      GIT_COMMITTER_NAME="Committer Name" \
      GIT_COMMITTER_EMAIL="committer@email" \
      GIT_COMMITTER_DATE="2005-05-26 23:30" \
-     TZ=GMT git commit-tree `cat treeid` >commitid 2>/dev/null'
+     TZ=GMT git commit-tree $(cat treeid) >commitid 2>/dev/null'
 
 test_expect_success \
     'read commit' \
-    'git cat-file commit `cat commitid` >commit'
+    'git cat-file commit $(cat commitid) >commit'
 
 test_expect_success \
     'compare commit' \
-- 
2.3.3.GIT

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

* [PATCH 02/10] t/t1401-symbolic-ref.sh: use the $( ... ) construct for command substitution
  2015-12-22 15:05 [PATCH 00/10] use the $( ... ) construct for command substitution Elia Pinto
  2015-12-22 15:05 ` [PATCH 01/10] t/t1100-commit-tree-options.sh: " Elia Pinto
@ 2015-12-22 15:05 ` Elia Pinto
  2015-12-22 15:05 ` [PATCH 03/10] t/t1410-reflog.sh: " Elia Pinto
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Elia Pinto @ 2015-12-22 15:05 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/t1401-symbolic-ref.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/t/t1401-symbolic-ref.sh b/t/t1401-symbolic-ref.sh
index 20b022a..e6c5830 100755
--- a/t/t1401-symbolic-ref.sh
+++ b/t/t1401-symbolic-ref.sh
@@ -29,7 +29,7 @@ reset_to_sane
 
 test_expect_success 'symbolic-ref refuses bare sha1' '
 	echo content >file && git add file && git commit -m one &&
-	test_must_fail git symbolic-ref HEAD `git rev-parse HEAD`
+	test_must_fail git symbolic-ref HEAD $(git rev-parse HEAD)
 '
 reset_to_sane
 
-- 
2.3.3.GIT

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

* [PATCH 03/10] t/t1410-reflog.sh: use the $( ... ) construct for command substitution
  2015-12-22 15:05 [PATCH 00/10] use the $( ... ) construct for command substitution Elia Pinto
  2015-12-22 15:05 ` [PATCH 01/10] t/t1100-commit-tree-options.sh: " Elia Pinto
  2015-12-22 15:05 ` [PATCH 02/10] t/t1401-symbolic-ref.sh: " Elia Pinto
@ 2015-12-22 15:05 ` Elia Pinto
  2015-12-22 15:05 ` [PATCH 04/10] t/t1511-rev-parse-caret.sh: " Elia Pinto
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Elia Pinto @ 2015-12-22 15:05 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/t1410-reflog.sh | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/t/t1410-reflog.sh b/t/t1410-reflog.sh
index b79049f..fbed8d7 100755
--- a/t/t1410-reflog.sh
+++ b/t/t1410-reflog.sh
@@ -62,18 +62,18 @@ test_expect_success setup '
 	git add . &&
 
 	test_tick && git commit -m rabbit &&
-	H=`git rev-parse --verify HEAD` &&
-	A=`git rev-parse --verify HEAD:A` &&
-	B=`git rev-parse --verify HEAD:A/B` &&
-	C=`git rev-parse --verify HEAD:C` &&
-	D=`git rev-parse --verify HEAD:A/D` &&
-	E=`git rev-parse --verify HEAD:A/B/E` &&
+	H=$(git rev-parse --verify HEAD) &&
+	A=$(git rev-parse --verify HEAD:A) &&
+	B=$(git rev-parse --verify HEAD:A/B) &&
+	C=$(git rev-parse --verify HEAD:C) &&
+	D=$(git rev-parse --verify HEAD:A/D) &&
+	E=$(git rev-parse --verify HEAD:A/B/E) &&
 	check_fsck &&
 
 	test_chmod +x C &&
 	git add C &&
 	test_tick && git commit -m dragon &&
-	L=`git rev-parse --verify HEAD` &&
+	L=$(git rev-parse --verify HEAD) &&
 	check_fsck &&
 
 	rm -f C A/B/E &&
@@ -81,15 +81,15 @@ test_expect_success setup '
 	echo horse >A/G &&
 	git add F A/G &&
 	test_tick && git commit -a -m sheep &&
-	F=`git rev-parse --verify HEAD:F` &&
-	G=`git rev-parse --verify HEAD:A/G` &&
-	I=`git rev-parse --verify HEAD:A` &&
-	J=`git rev-parse --verify HEAD` &&
+	F=$(git rev-parse --verify HEAD:F) &&
+	G=$(git rev-parse --verify HEAD:A/G) &&
+	I=$(git rev-parse --verify HEAD:A) &&
+	J=$(git rev-parse --verify HEAD) &&
 	check_fsck &&
 
 	rm -f A/G &&
 	test_tick && git commit -a -m monkey &&
-	K=`git rev-parse --verify HEAD` &&
+	K=$(git rev-parse --verify HEAD) &&
 	check_fsck &&
 
 	check_have A B C D E F G H I J K L &&
-- 
2.3.3.GIT

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

* [PATCH 04/10] t/t1511-rev-parse-caret.sh: use the $( ... ) construct for command substitution
  2015-12-22 15:05 [PATCH 00/10] use the $( ... ) construct for command substitution Elia Pinto
                   ` (2 preceding siblings ...)
  2015-12-22 15:05 ` [PATCH 03/10] t/t1410-reflog.sh: " Elia Pinto
@ 2015-12-22 15:05 ` Elia Pinto
  2015-12-22 15:05 ` [PATCH 05/10] t/t1512-rev-parse-disambiguation.sh: " Elia Pinto
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Elia Pinto @ 2015-12-22 15:05 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/t1511-rev-parse-caret.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/t/t1511-rev-parse-caret.sh b/t/t1511-rev-parse-caret.sh
index 15973f2..7043ba7 100755
--- a/t/t1511-rev-parse-caret.sh
+++ b/t/t1511-rev-parse-caret.sh
@@ -6,11 +6,11 @@ test_description='tests for ref^{stuff}'
 
 test_expect_success 'setup' '
 	echo blob >a-blob &&
-	git tag -a -m blob blob-tag `git hash-object -w a-blob` &&
+	git tag -a -m blob blob-tag $(git hash-object -w a-blob) &&
 	mkdir a-tree &&
 	echo moreblobs >a-tree/another-blob &&
 	git add . &&
-	TREE_SHA1=`git write-tree` &&
+	TREE_SHA1=$(git write-tree) &&
 	git tag -a -m tree tree-tag "$TREE_SHA1" &&
 	git commit -m Initial &&
 	git tag -a -m commit commit-tag &&
-- 
2.3.3.GIT

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

* [PATCH 05/10] t/t1512-rev-parse-disambiguation.sh: use the $( ... ) construct for command substitution
  2015-12-22 15:05 [PATCH 00/10] use the $( ... ) construct for command substitution Elia Pinto
                   ` (3 preceding siblings ...)
  2015-12-22 15:05 ` [PATCH 04/10] t/t1511-rev-parse-caret.sh: " Elia Pinto
@ 2015-12-22 15:05 ` Elia Pinto
  2015-12-22 15:05 ` [PATCH 06/10] t/t1700-split-index.sh: " Elia Pinto
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Elia Pinto @ 2015-12-22 15:05 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/t1512-rev-parse-disambiguation.sh | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/t/t1512-rev-parse-disambiguation.sh b/t/t1512-rev-parse-disambiguation.sh
index 4a155c8..e221167 100755
--- a/t/t1512-rev-parse-disambiguation.sh
+++ b/t/t1512-rev-parse-disambiguation.sh
@@ -275,19 +275,19 @@ test_expect_success 'rev-parse --disambiguate' '
 
 test_expect_success 'ambiguous 40-hex ref' '
 	TREE=$(git mktree </dev/null) &&
-	REF=`git rev-parse HEAD` &&
+	REF=$(git rev-parse HEAD) &&
 	VAL=$(git commit-tree $TREE </dev/null) &&
 	git update-ref refs/heads/$REF $VAL &&
-	test `git rev-parse $REF 2>err` = $REF &&
+	test $(git rev-parse $REF 2>err) = $REF &&
 	grep "refname.*${REF}.*ambiguous" err
 '
 
 test_expect_success 'ambiguous short sha1 ref' '
 	TREE=$(git mktree </dev/null) &&
-	REF=`git rev-parse --short HEAD` &&
+	REF=$(git rev-parse --short HEAD) &&
 	VAL=$(git commit-tree $TREE </dev/null) &&
 	git update-ref refs/heads/$REF $VAL &&
-	test `git rev-parse $REF 2>err` = $VAL &&
+	test $(git rev-parse $REF 2>err) = $VAL &&
 	grep "refname.*${REF}.*ambiguous" err
 '
 
-- 
2.3.3.GIT

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

* [PATCH 06/10] t/t1700-split-index.sh: use the $( ... ) construct for command substitution
  2015-12-22 15:05 [PATCH 00/10] use the $( ... ) construct for command substitution Elia Pinto
                   ` (4 preceding siblings ...)
  2015-12-22 15:05 ` [PATCH 05/10] t/t1512-rev-parse-disambiguation.sh: " Elia Pinto
@ 2015-12-22 15:05 ` Elia Pinto
  2015-12-22 15:05 ` [PATCH 07/10] t/t2025-worktree-add.sh: " Elia Pinto
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Elia Pinto @ 2015-12-22 15:05 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/t1700-split-index.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/t/t1700-split-index.sh b/t/t1700-split-index.sh
index 193d55c..8aef49f 100755
--- a/t/t1700-split-index.sh
+++ b/t/t1700-split-index.sh
@@ -55,7 +55,7 @@ test_expect_success 'disable split index' '
 EOF
 	test_cmp ls-files.expect ls-files.actual &&
 
-	BASE=`test-dump-split-index .git/index | grep "^own" | sed "s/own/base/"` &&
+	BASE=$(test-dump-split-index .git/index | grep "^own" | sed "s/own/base/") &&
 	test-dump-split-index .git/index | sed "/^own/d" >actual &&
 	cat >expect <<EOF &&
 not a split index
-- 
2.3.3.GIT

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

* [PATCH 07/10] t/t2025-worktree-add.sh: use the $( ... ) construct for command substitution
  2015-12-22 15:05 [PATCH 00/10] use the $( ... ) construct for command substitution Elia Pinto
                   ` (5 preceding siblings ...)
  2015-12-22 15:05 ` [PATCH 06/10] t/t1700-split-index.sh: " Elia Pinto
@ 2015-12-22 15:05 ` Elia Pinto
  2015-12-22 15:05 ` [PATCH 08/10] t/t2102-update-index-symlinks.sh: " Elia Pinto
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Elia Pinto @ 2015-12-22 15:05 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/t2025-worktree-add.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/t/t2025-worktree-add.sh b/t/t2025-worktree-add.sh
index 3694174..0a804da 100755
--- a/t/t2025-worktree-add.sh
+++ b/t/t2025-worktree-add.sh
@@ -123,10 +123,10 @@ test_expect_success 'checkout from a bare repo without "add"' '
 test_expect_success 'checkout with grafts' '
 	test_when_finished rm .git/info/grafts &&
 	test_commit abc &&
-	SHA1=`git rev-parse HEAD` &&
+	SHA1=$(git rev-parse HEAD) &&
 	test_commit def &&
 	test_commit xyz &&
-	echo "`git rev-parse HEAD` $SHA1" >.git/info/grafts &&
+	echo "$(git rev-parse HEAD) $SHA1" >.git/info/grafts &&
 	cat >expected <<-\EOF &&
 	xyz
 	abc
-- 
2.3.3.GIT

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

* [PATCH 08/10] t/t2102-update-index-symlinks.sh: use the $( ... ) construct for command substitution
  2015-12-22 15:05 [PATCH 00/10] use the $( ... ) construct for command substitution Elia Pinto
                   ` (6 preceding siblings ...)
  2015-12-22 15:05 ` [PATCH 07/10] t/t2025-worktree-add.sh: " Elia Pinto
@ 2015-12-22 15:05 ` Elia Pinto
  2015-12-22 15:05 ` [PATCH 09/10] t/t3030-merge-recursive.sh: " Elia Pinto
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Elia Pinto @ 2015-12-22 15:05 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/t2102-update-index-symlinks.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/t/t2102-update-index-symlinks.sh b/t/t2102-update-index-symlinks.sh
index 4d0d0a3..22f2c73 100755
--- a/t/t2102-update-index-symlinks.sh
+++ b/t/t2102-update-index-symlinks.sh
@@ -23,7 +23,7 @@ git update-index symlink'
 
 test_expect_success \
 'the index entry must still be a symbolic link' '
-case "`git ls-files --stage --cached symlink`" in
+case "$(git ls-files --stage --cached symlink)" in
 120000" "*symlink) echo pass;;
 *) echo fail; git ls-files --stage --cached symlink; (exit 1);;
 esac'
-- 
2.3.3.GIT

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

* [PATCH 09/10] t/t3030-merge-recursive.sh: use the $( ... ) construct for command substitution
  2015-12-22 15:05 [PATCH 00/10] use the $( ... ) construct for command substitution Elia Pinto
                   ` (7 preceding siblings ...)
  2015-12-22 15:05 ` [PATCH 08/10] t/t2102-update-index-symlinks.sh: " Elia Pinto
@ 2015-12-22 15:05 ` Elia Pinto
  2015-12-22 15:05 ` [PATCH 10/10] t/t3100-ls-tree-restrict.sh: " Elia Pinto
  2015-12-22 21:33 ` [PATCH 00/10] " Jonathan Nieder
  10 siblings, 0 replies; 12+ messages in thread
From: Elia Pinto @ 2015-12-22 15:05 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/t3030-merge-recursive.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/t/t3030-merge-recursive.sh b/t/t3030-merge-recursive.sh
index 6224187..f7b0e59 100755
--- a/t/t3030-merge-recursive.sh
+++ b/t/t3030-merge-recursive.sh
@@ -263,7 +263,7 @@ test_expect_success 'setup 8' '
 	test_ln_s_add e a &&
 	test_tick &&
 	git commit -m "rename a->e, symlink a->e" &&
-	oln=`printf e | git hash-object --stdin`
+	oln=$(printf e | git hash-object --stdin)
 '
 
 test_expect_success 'setup 9' '
-- 
2.3.3.GIT

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

* [PATCH 10/10] t/t3100-ls-tree-restrict.sh: use the $( ... ) construct for command substitution
  2015-12-22 15:05 [PATCH 00/10] use the $( ... ) construct for command substitution Elia Pinto
                   ` (8 preceding siblings ...)
  2015-12-22 15:05 ` [PATCH 09/10] t/t3030-merge-recursive.sh: " Elia Pinto
@ 2015-12-22 15:05 ` Elia Pinto
  2015-12-22 21:33 ` [PATCH 00/10] " Jonathan Nieder
  10 siblings, 0 replies; 12+ messages in thread
From: Elia Pinto @ 2015-12-22 15:05 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/t3100-ls-tree-restrict.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/t/t3100-ls-tree-restrict.sh b/t/t3100-ls-tree-restrict.sh
index eb73c06..325114f 100755
--- a/t/t3100-ls-tree-restrict.sh
+++ b/t/t3100-ls-tree-restrict.sh
@@ -28,7 +28,7 @@ test_expect_success \
      echo Mi >path2/baz/b &&
      find path? \( -type f -o -type l \) -print |
      xargs git update-index --add &&
-     tree=`git write-tree` &&
+     tree=$(git write-tree) &&
      echo $tree'
 
 test_output () {
-- 
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 15:05 [PATCH 00/10] use the $( ... ) construct for command substitution Elia Pinto
                   ` (9 preceding siblings ...)
  2015-12-22 15:05 ` [PATCH 10/10] t/t3100-ls-tree-restrict.sh: " Elia Pinto
@ 2015-12-22 21:33 ` Jonathan Nieder
  10 siblings, 0 replies; 12+ 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] 12+ messages in thread

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

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-22 15:05 [PATCH 00/10] use the $( ... ) construct for command substitution Elia Pinto
2015-12-22 15:05 ` [PATCH 01/10] t/t1100-commit-tree-options.sh: " Elia Pinto
2015-12-22 15:05 ` [PATCH 02/10] t/t1401-symbolic-ref.sh: " Elia Pinto
2015-12-22 15:05 ` [PATCH 03/10] t/t1410-reflog.sh: " Elia Pinto
2015-12-22 15:05 ` [PATCH 04/10] t/t1511-rev-parse-caret.sh: " Elia Pinto
2015-12-22 15:05 ` [PATCH 05/10] t/t1512-rev-parse-disambiguation.sh: " Elia Pinto
2015-12-22 15:05 ` [PATCH 06/10] t/t1700-split-index.sh: " Elia Pinto
2015-12-22 15:05 ` [PATCH 07/10] t/t2025-worktree-add.sh: " Elia Pinto
2015-12-22 15:05 ` [PATCH 08/10] t/t2102-update-index-symlinks.sh: " Elia Pinto
2015-12-22 15:05 ` [PATCH 09/10] t/t3030-merge-recursive.sh: " Elia Pinto
2015-12-22 15:05 ` [PATCH 10/10] t/t3100-ls-tree-restrict.sh: " Elia Pinto
2015-12-22 21:33 ` [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).