git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/10] use the $( ... ) construct for command substitution
@ 2015-12-22 14:10 Elia Pinto
  2015-12-22 20:45 ` Jonathan Nieder
  0 siblings, 1 reply; 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 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; 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 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; 22+ 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] 22+ 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; 22+ 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] 22+ 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; 22+ 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] 22+ 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; 22+ 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] 22+ 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; 22+ 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] 22+ 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; 22+ 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] 22+ 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; 22+ 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] 22+ 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; 22+ 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] 22+ 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; 22+ 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] 22+ 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; 22+ 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] 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 Elia Pinto
@ 2015-12-22 20:45 ` Jonathan Nieder
  0 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 [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; 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 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
  -- strict thread matches above, loose matches on Subject: below --
2016-01-12 10:45 Elia Pinto
2016-01-08 11:06 Elia Pinto
2016-01-07 13:51 Elia Pinto
2016-01-07 22:00 ` Junio C Hamano
2016-01-04  9:10 Elia Pinto
2016-01-04 21:58 ` Junio C Hamano
2015-12-23 13:45 Elia Pinto
2015-12-22 15:27 Elia Pinto
2015-12-22 14:10 Elia Pinto
2015-12-22 20:45 ` Jonathan Nieder

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