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

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

* [PATCH 00/10] use the $( ... ) construct for command substitution
@ 2015-12-22 15:27 Elia Pinto
  2015-12-22 15:27 ` [PATCH 01/10] t3101-ls-tree-dirname.sh: " Elia Pinto
                   ` (9 more replies)
  0 siblings, 10 replies; 27+ 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] 27+ messages in thread

* [PATCH 01/10] t3101-ls-tree-dirname.sh: use the $( ... ) construct for command substitution
  2015-12-22 15:27 [PATCH 00/10] use the $( ... ) construct for command substitution Elia Pinto
@ 2015-12-22 15:27 ` Elia Pinto
  2015-12-22 15:27 ` [PATCH 02/10] t3210-pack-refs.sh: " Elia Pinto
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 27+ messages in thread
From: Elia Pinto @ 2015-12-22 15:27 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/t3101-ls-tree-dirname.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/t/t3101-ls-tree-dirname.sh b/t/t3101-ls-tree-dirname.sh
index 026f9f8..425d858 100755
--- a/t/t3101-ls-tree-dirname.sh
+++ b/t/t3101-ls-tree-dirname.sh
@@ -35,7 +35,7 @@ test_expect_success 'setup' '
 	echo 222 >path3/2.txt &&
 	find *.txt path* \( -type f -o -type l \) -print |
 	xargs git update-index --add &&
-	tree=`git write-tree` &&
+	tree=$(git write-tree) &&
 	echo $tree
 '
 
-- 
2.3.3.GIT

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

* [PATCH 02/10] t3210-pack-refs.sh: use the $( ... ) construct for command substitution
  2015-12-22 15:27 [PATCH 00/10] use the $( ... ) construct for command substitution Elia Pinto
  2015-12-22 15:27 ` [PATCH 01/10] t3101-ls-tree-dirname.sh: " Elia Pinto
@ 2015-12-22 15:27 ` Elia Pinto
  2015-12-22 15:27 ` [PATCH 03/10] t3403-rebase-skip.sh: " Elia Pinto
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 27+ messages in thread
From: Elia Pinto @ 2015-12-22 15:27 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/t3210-pack-refs.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/t/t3210-pack-refs.sh b/t/t3210-pack-refs.sh
index db244d2..9b182a0 100755
--- a/t/t3210-pack-refs.sh
+++ b/t/t3210-pack-refs.sh
@@ -27,7 +27,7 @@ SHA1=
 test_expect_success \
     'see if git show-ref works as expected' \
     'git branch a &&
-     SHA1=`cat .git/refs/heads/a` &&
+     SHA1=$(cat .git/refs/heads/a) &&
      echo "$SHA1 refs/heads/a" >expect &&
      git show-ref a >result &&
      test_cmp expect result'
-- 
2.3.3.GIT

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

* [PATCH 03/10] t3403-rebase-skip.sh: use the $( ... ) construct for command substitution
  2015-12-22 15:27 [PATCH 00/10] use the $( ... ) construct for command substitution Elia Pinto
  2015-12-22 15:27 ` [PATCH 01/10] t3101-ls-tree-dirname.sh: " Elia Pinto
  2015-12-22 15:27 ` [PATCH 02/10] t3210-pack-refs.sh: " Elia Pinto
@ 2015-12-22 15:27 ` Elia Pinto
  2015-12-22 15:27 ` [PATCH 04/10] t3511-cherry-pick-x.sh: " Elia Pinto
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 27+ messages in thread
From: Elia Pinto @ 2015-12-22 15:27 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/t3403-rebase-skip.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/t/t3403-rebase-skip.sh b/t/t3403-rebase-skip.sh
index 3968020..1f5122b 100755
--- a/t/t3403-rebase-skip.sh
+++ b/t/t3403-rebase-skip.sh
@@ -67,7 +67,7 @@ test_expect_success 'rebase --skip with --merge' '
 '
 
 test_expect_success 'merge and reference trees equal' '
-	test -z "`git diff-tree skip-merge skip-reference`"
+	test -z "$(git diff-tree skip-merge skip-reference)"
 '
 
 test_expect_success 'moved back to branch correctly' '
-- 
2.3.3.GIT

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

* [PATCH 04/10] t3511-cherry-pick-x.sh: use the $( ... ) construct for command substitution
  2015-12-22 15:27 [PATCH 00/10] use the $( ... ) construct for command substitution Elia Pinto
                   ` (2 preceding siblings ...)
  2015-12-22 15:27 ` [PATCH 03/10] t3403-rebase-skip.sh: " Elia Pinto
@ 2015-12-22 15:27 ` Elia Pinto
  2015-12-22 15:27 ` [PATCH 05/10] t3600-rm.sh: " Elia Pinto
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 27+ messages in thread
From: Elia Pinto @ 2015-12-22 15:27 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/t3511-cherry-pick-x.sh | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/t/t3511-cherry-pick-x.sh b/t/t3511-cherry-pick-x.sh
index b7dff09..9cce5ae 100755
--- a/t/t3511-cherry-pick-x.sh
+++ b/t/t3511-cherry-pick-x.sh
@@ -77,7 +77,7 @@ test_expect_success setup '
 
 test_expect_success 'cherry-pick -x inserts blank line after one line subject' '
 	pristine_detach initial &&
-	sha1=`git rev-parse mesg-one-line^0` &&
+	sha1=$(git rev-parse mesg-one-line^0) &&
 	git cherry-pick -x mesg-one-line &&
 	cat <<-EOF >expect &&
 		$mesg_one_line
@@ -114,7 +114,7 @@ test_expect_success 'cherry-pick -s inserts blank line after non-conforming foot
 
 test_expect_success 'cherry-pick -x inserts blank line when conforming footer not found' '
 	pristine_detach initial &&
-	sha1=`git rev-parse mesg-no-footer^0` &&
+	sha1=$(git rev-parse mesg-no-footer^0) &&
 	git cherry-pick -x mesg-no-footer &&
 	cat <<-EOF >expect &&
 		$mesg_no_footer
@@ -139,7 +139,7 @@ test_expect_success 'cherry-pick -s inserts blank line when conforming footer no
 
 test_expect_success 'cherry-pick -x -s inserts blank line when conforming footer not found' '
 	pristine_detach initial &&
-	sha1=`git rev-parse mesg-no-footer^0` &&
+	sha1=$(git rev-parse mesg-no-footer^0) &&
 	git cherry-pick -x -s mesg-no-footer &&
 	cat <<-EOF >expect &&
 		$mesg_no_footer
@@ -164,7 +164,7 @@ test_expect_success 'cherry-pick -s adds sob when last sob doesnt match committe
 
 test_expect_success 'cherry-pick -x -s adds sob when last sob doesnt match committer' '
 	pristine_detach initial &&
-	sha1=`git rev-parse mesg-with-footer^0` &&
+	sha1=$(git rev-parse mesg-with-footer^0) &&
 	git cherry-pick -x -s mesg-with-footer &&
 	cat <<-EOF >expect &&
 		$mesg_with_footer
@@ -187,7 +187,7 @@ test_expect_success 'cherry-pick -s refrains from adding duplicate trailing sob'
 
 test_expect_success 'cherry-pick -x -s adds sob even when trailing sob exists for committer' '
 	pristine_detach initial &&
-	sha1=`git rev-parse mesg-with-footer-sob^0` &&
+	sha1=$(git rev-parse mesg-with-footer-sob^0) &&
 	git cherry-pick -x -s mesg-with-footer-sob &&
 	cat <<-EOF >expect &&
 		$mesg_with_footer_sob
@@ -200,7 +200,7 @@ test_expect_success 'cherry-pick -x -s adds sob even when trailing sob exists fo
 
 test_expect_success 'cherry-pick -x treats "(cherry picked from..." line as part of footer' '
 	pristine_detach initial &&
-	sha1=`git rev-parse mesg-with-cherry-footer^0` &&
+	sha1=$(git rev-parse mesg-with-cherry-footer^0) &&
 	git cherry-pick -x mesg-with-cherry-footer &&
 	cat <<-EOF >expect &&
 		$mesg_with_cherry_footer
@@ -223,7 +223,7 @@ test_expect_success 'cherry-pick -s treats "(cherry picked from..." line as part
 
 test_expect_success 'cherry-pick -x -s treats "(cherry picked from..." line as part of footer' '
 	pristine_detach initial &&
-	sha1=`git rev-parse mesg-with-cherry-footer^0` &&
+	sha1=$(git rev-parse mesg-with-cherry-footer^0) &&
 	git cherry-pick -x -s mesg-with-cherry-footer &&
 	cat <<-EOF >expect &&
 		$mesg_with_cherry_footer
-- 
2.3.3.GIT

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

* [PATCH 05/10] t3600-rm.sh: use the $( ... ) construct for command substitution
  2015-12-22 15:27 [PATCH 00/10] use the $( ... ) construct for command substitution Elia Pinto
                   ` (3 preceding siblings ...)
  2015-12-22 15:27 ` [PATCH 04/10] t3511-cherry-pick-x.sh: " Elia Pinto
@ 2015-12-22 15:27 ` Elia Pinto
  2015-12-22 15:27 ` [PATCH 06/10] t3700-add.sh: " Elia Pinto
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 27+ messages in thread
From: Elia Pinto @ 2015-12-22 15:27 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/t3600-rm.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/t/t3600-rm.sh b/t/t3600-rm.sh
index 9d90d2c..2e47a2b 100755
--- a/t/t3600-rm.sh
+++ b/t/t3600-rm.sh
@@ -115,7 +115,7 @@ test_expect_success '"rm" command printed' '
 	git add test-file &&
 	git commit -m "add file for rm test" &&
 	git rm test-file > rm-output &&
-	test `grep "^rm " rm-output | wc -l` = 1 &&
+	test $(grep "^rm " rm-output | wc -l) = 1 &&
 	rm -f test-file rm-output &&
 	git commit -m "remove file from rm test"
 '
@@ -125,7 +125,7 @@ test_expect_success '"rm" command suppressed with --quiet' '
 	git add test-file &&
 	git commit -m "add file for rm --quiet test" &&
 	git rm --quiet test-file > rm-output &&
-	test `wc -l < rm-output` = 0 &&
+	test $(wc -l < rm-output) = 0 &&
 	rm -f test-file rm-output &&
 	git commit -m "remove file from rm --quiet test"
 '
-- 
2.3.3.GIT

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

* [PATCH 06/10] t3700-add.sh: use the $( ... ) construct for command substitution
  2015-12-22 15:27 [PATCH 00/10] use the $( ... ) construct for command substitution Elia Pinto
                   ` (4 preceding siblings ...)
  2015-12-22 15:27 ` [PATCH 05/10] t3600-rm.sh: " Elia Pinto
@ 2015-12-22 15:27 ` Elia Pinto
  2015-12-22 15:27 ` [PATCH 07/10] t5100-mailinfo.sh: " Elia Pinto
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 27+ messages in thread
From: Elia Pinto @ 2015-12-22 15:27 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/t3700-add.sh | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/t/t3700-add.sh b/t/t3700-add.sh
index f7ff1f5..f14a665 100755
--- a/t/t3700-add.sh
+++ b/t/t3700-add.sh
@@ -25,7 +25,7 @@ test_expect_success \
 	 echo foo >xfoo1 &&
 	 chmod 755 xfoo1 &&
 	 git add xfoo1 &&
-	 case "`git ls-files --stage xfoo1`" in
+	 case "$(git ls-files --stage xfoo1)" in
 	 100644" "*xfoo1) echo pass;;
 	 *) echo fail; git ls-files --stage xfoo1; (exit 1);;
 	 esac'
@@ -33,7 +33,7 @@ test_expect_success \
 test_expect_success 'git add: filemode=0 should not get confused by symlink' '
 	rm -f xfoo1 &&
 	test_ln_s_add foo xfoo1 &&
-	case "`git ls-files --stage xfoo1`" in
+	case "$(git ls-files --stage xfoo1)" in
 	120000" "*xfoo1) echo pass;;
 	*) echo fail; git ls-files --stage xfoo1; (exit 1);;
 	esac
@@ -45,7 +45,7 @@ test_expect_success \
 	 echo foo >xfoo2 &&
 	 chmod 755 xfoo2 &&
 	 git update-index --add xfoo2 &&
-	 case "`git ls-files --stage xfoo2`" in
+	 case "$(git ls-files --stage xfoo2)" in
 	 100644" "*xfoo2) echo pass;;
 	 *) echo fail; git ls-files --stage xfoo2; (exit 1);;
 	 esac'
@@ -53,7 +53,7 @@ test_expect_success \
 test_expect_success 'git add: filemode=0 should not get confused by symlink' '
 	rm -f xfoo2 &&
 	test_ln_s_add foo xfoo2 &&
-	case "`git ls-files --stage xfoo2`" in
+	case "$(git ls-files --stage xfoo2)" in
 	120000" "*xfoo2) echo pass;;
 	*) echo fail; git ls-files --stage xfoo2; (exit 1);;
 	esac
@@ -63,7 +63,7 @@ test_expect_success \
 	'git update-index --add: Test that executable bit is not used...' \
 	'git config core.filemode 0 &&
 	 test_ln_s_add xfoo2 xfoo3 &&	# runs git update-index --add
-	 case "`git ls-files --stage xfoo3`" in
+	 case "$(git ls-files --stage xfoo3)" in
 	 120000" "*xfoo3) echo pass;;
 	 *) echo fail; git ls-files --stage xfoo3; (exit 1);;
 	 esac'
@@ -173,14 +173,14 @@ test_expect_success 'git add with filemode=0, symlinks=0 prefers stage 2 over st
 
 test_expect_success 'git add --refresh' '
 	>foo && git add foo && git commit -a -m "commit all" &&
-	test -z "`git diff-index HEAD -- foo`" &&
+	test -z "$(git diff-index HEAD -- foo)" &&
 	git read-tree HEAD &&
-	case "`git diff-index HEAD -- foo`" in
+	case "$(git diff-index HEAD -- foo)" in
 	:100644" "*"M	foo") echo pass;;
 	*) echo fail; (exit 1);;
 	esac &&
 	git add --refresh -- foo &&
-	test -z "`git diff-index HEAD -- foo`"
+	test -z "$(git diff-index HEAD -- foo)"
 '
 
 test_expect_success 'git add --refresh with pathspec' '
-- 
2.3.3.GIT

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

* [PATCH 07/10] t5100-mailinfo.sh: use the $( ... ) construct for command substitution
  2015-12-22 15:27 [PATCH 00/10] use the $( ... ) construct for command substitution Elia Pinto
                   ` (5 preceding siblings ...)
  2015-12-22 15:27 ` [PATCH 06/10] t3700-add.sh: " Elia Pinto
@ 2015-12-22 15:27 ` Elia Pinto
  2015-12-22 18:35   ` Johannes Sixt
  2015-12-22 15:27 ` [PATCH 08/10] t5300-pack-object.sh: " Elia Pinto
                   ` (2 subsequent siblings)
  9 siblings, 1 reply; 27+ messages in thread
From: Elia Pinto @ 2015-12-22 15:27 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/t5100-mailinfo.sh | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/t/t5100-mailinfo.sh b/t/t5100-mailinfo.sh
index e97cfb2..4e52b3b 100755
--- a/t/t5100-mailinfo.sh
+++ b/t/t5100-mailinfo.sh
@@ -9,9 +9,9 @@ test_description='git mailinfo and git mailsplit test'
 
 test_expect_success 'split sample box' \
 	'git mailsplit -o. "$TEST_DIRECTORY"/t5100/sample.mbox >last &&
-	last=`cat last` &&
+	last=$(cat last) &&
 	echo total is $last &&
-	test `cat last` = 17'
+	test $(cat last) = 17'
 
 check_mailinfo () {
 	mail=$1 opt=$2
@@ -23,7 +23,7 @@ check_mailinfo () {
 }
 
 
-for mail in `echo 00*`
+for mail in $(echo 00*)
 do
 	test_expect_success "mailinfo $mail" '
 		check_mailinfo $mail "" &&
@@ -47,11 +47,11 @@ test_expect_success 'split box with rfc2047 samples' \
 	'mkdir rfc2047 &&
 	git mailsplit -orfc2047 "$TEST_DIRECTORY"/t5100/rfc2047-samples.mbox \
 	  >rfc2047/last &&
-	last=`cat rfc2047/last` &&
+	last=$(cat rfc2047/last) &&
 	echo total is $last &&
-	test `cat rfc2047/last` = 11'
+	test $(cat rfc2047/last) = 11'
 
-for mail in `echo rfc2047/00*`
+for mail in $(echo rfc2047/00*)
 do
 	test_expect_success "mailinfo $mail" '
 		git mailinfo -u $mail-msg $mail-patch <$mail >$mail-info &&
-- 
2.3.3.GIT

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

* [PATCH 08/10] t5300-pack-object.sh: use the $( ... ) construct for command substitution
  2015-12-22 15:27 [PATCH 00/10] use the $( ... ) construct for command substitution Elia Pinto
                   ` (6 preceding siblings ...)
  2015-12-22 15:27 ` [PATCH 07/10] t5100-mailinfo.sh: " Elia Pinto
@ 2015-12-22 15:27 ` Elia Pinto
  2015-12-22 15:27 ` [PATCH 09/10] t5301-sliding-window.sh: " Elia Pinto
  2015-12-22 15:27 ` [PATCH 10/10] t5302-pack-index.sh: " Elia Pinto
  9 siblings, 0 replies; 27+ messages in thread
From: Elia Pinto @ 2015-12-22 15:27 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/t5300-pack-object.sh | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/t/t5300-pack-object.sh b/t/t5300-pack-object.sh
index 20c1961..fc2be63 100755
--- a/t/t5300-pack-object.sh
+++ b/t/t5300-pack-object.sh
@@ -8,7 +8,7 @@ test_description='git pack-object
 '
 . ./test-lib.sh
 
-TRASH=`pwd`
+TRASH=$(pwd)
 
 test_expect_success \
     'setup' \
@@ -20,8 +20,8 @@ test_expect_success \
      test-genrandom "seed b" 2097152 > b_big &&
      git update-index --add a a_big b b_big c &&
      cat c >d && echo foo >>d && git update-index --add d &&
-     tree=`git write-tree` &&
-     commit=`git commit-tree $tree </dev/null` && {
+     tree=$(git write-tree) &&
+     commit=$(git commit-tree $tree </dev/null) && {
 	 echo $tree &&
 	 echo $commit &&
 	 git ls-tree $tree | sed -e "s/.* \\([0-9a-f]*\\)	.*/\\1/"
@@ -29,7 +29,7 @@ test_expect_success \
 	 git diff-tree --root -p $commit &&
 	 while read object
 	 do
-	    t=`git cat-file -t $object` &&
+	    t=$(git cat-file -t $object) &&
 	    git cat-file $t $object || return 1
 	 done <obj-list
      } >expect'
@@ -147,7 +147,7 @@ test_expect_success \
 	 git diff-tree --root -p $commit &&
 	 while read object
 	 do
-	    t=`git cat-file -t $object` &&
+	    t=$(git cat-file -t $object) &&
 	    git cat-file $t $object || return 1
 	 done <obj-list
     } >current &&
@@ -162,7 +162,7 @@ test_expect_success \
 	 git diff-tree --root -p $commit &&
 	 while read object
 	 do
-	    t=`git cat-file -t $object` &&
+	    t=$(git cat-file -t $object) &&
 	    git cat-file $t $object || return 1
 	 done <obj-list
     } >current &&
@@ -177,7 +177,7 @@ test_expect_success \
 	 git diff-tree --root -p $commit &&
 	 while read object
 	 do
-	    t=`git cat-file -t $object` &&
+	    t=$(git cat-file -t $object) &&
 	    git cat-file $t $object || return 1
 	 done <obj-list
     } >current &&
@@ -252,8 +252,8 @@ test_expect_success \
 
 test_expect_success \
     'verify-pack catches a corrupted sum of the index file itself' \
-    'l=`wc -c <test-3.idx` &&
-     l=`expr $l - 20` &&
+    'l=$(wc -c <test-3.idx) &&
+     l=$(expr $l - 20) &&
      cat test-1-${packname_1}.pack >test-3.pack &&
      printf "%20s" "" | dd of=test-3.idx count=20 bs=1 conv=notrunc seek=$l &&
      if git verify-pack test-3.pack
-- 
2.3.3.GIT

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

* [PATCH 09/10] t5301-sliding-window.sh: use the $( ... ) construct for command substitution
  2015-12-22 15:27 [PATCH 00/10] use the $( ... ) construct for command substitution Elia Pinto
                   ` (7 preceding siblings ...)
  2015-12-22 15:27 ` [PATCH 08/10] t5300-pack-object.sh: " Elia Pinto
@ 2015-12-22 15:27 ` Elia Pinto
  2015-12-22 15:27 ` [PATCH 10/10] t5302-pack-index.sh: " Elia Pinto
  9 siblings, 0 replies; 27+ messages in thread
From: Elia Pinto @ 2015-12-22 15:27 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/t5301-sliding-window.sh | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/t/t5301-sliding-window.sh b/t/t5301-sliding-window.sh
index 2fc5af6..cae8c2e 100755
--- a/t/t5301-sliding-window.sh
+++ b/t/t5301-sliding-window.sh
@@ -16,12 +16,12 @@ test_expect_success \
          git update-index --add $i || return 1
      done &&
      echo d >d && cat c >>d && git update-index --add d &&
-     tree=`git write-tree` &&
-     commit1=`git commit-tree $tree </dev/null` &&
+     tree=$(git write-tree) &&
+     commit1=$(git commit-tree $tree </dev/null) &&
      git update-ref HEAD $commit1 &&
      git repack -a -d &&
-     test "`git count-objects`" = "0 objects, 0 kilobytes" &&
-     pack1=`ls .git/objects/pack/*.pack` &&
+     test "$(git count-objects)" = "0 objects, 0 kilobytes" &&
+     pack1=$(ls .git/objects/pack/*.pack) &&
      test -f "$pack1"'
 
 test_expect_success \
@@ -43,11 +43,11 @@ test_expect_success \
     'repack -a -d, packedGit{WindowSize,Limit} == 1 page' \
     'git config core.packedGitWindowSize 512 &&
      git config core.packedGitLimit 512 &&
-     commit2=`git commit-tree $tree -p $commit1 </dev/null` &&
+     commit2=$(git commit-tree $tree -p $commit1 </dev/null) &&
      git update-ref HEAD $commit2 &&
      git repack -a -d &&
-     test "`git count-objects`" = "0 objects, 0 kilobytes" &&
-     pack2=`ls .git/objects/pack/*.pack` &&
+     test "$(git count-objects)" = "0 objects, 0 kilobytes" &&
+     pack2=$(ls .git/objects/pack/*.pack) &&
      test -f "$pack2" &&
      test "$pack1" \!= "$pack2"'
 
-- 
2.3.3.GIT

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

* [PATCH 10/10] t5302-pack-index.sh: use the $( ... ) construct for command substitution
  2015-12-22 15:27 [PATCH 00/10] use the $( ... ) construct for command substitution Elia Pinto
                   ` (8 preceding siblings ...)
  2015-12-22 15:27 ` [PATCH 09/10] t5301-sliding-window.sh: " Elia Pinto
@ 2015-12-22 15:27 ` Elia Pinto
  9 siblings, 0 replies; 27+ messages in thread
From: Elia Pinto @ 2015-12-22 15:27 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/t5302-pack-index.sh | 34 +++++++++++++++++-----------------
 1 file changed, 17 insertions(+), 17 deletions(-)

diff --git a/t/t5302-pack-index.sh b/t/t5302-pack-index.sh
index 3dc5ec4..c2fc584 100755
--- a/t/t5302-pack-index.sh
+++ b/t/t5302-pack-index.sh
@@ -14,21 +14,21 @@ test_expect_success \
      i=1 &&
      while test $i -le 100
      do
-         iii=`printf '%03i' $i`
+         iii=$(printf '%03i' $i)
          test-genrandom "bar" 200 > wide_delta_$iii &&
          test-genrandom "baz $iii" 50 >> wide_delta_$iii &&
          test-genrandom "foo"$i 100 > deep_delta_$iii &&
-         test-genrandom "foo"`expr $i + 1` 100 >> deep_delta_$iii &&
-         test-genrandom "foo"`expr $i + 2` 100 >> deep_delta_$iii &&
+         test-genrandom "foo"$(expr $i + 1) 100 >> deep_delta_$iii &&
+         test-genrandom "foo"$(expr $i + 2) 100 >> deep_delta_$iii &&
          echo $iii >file_$iii &&
          test-genrandom "$iii" 8192 >>file_$iii &&
          git update-index --add file_$iii deep_delta_$iii wide_delta_$iii &&
-         i=`expr $i + 1` || return 1
+         i=$(expr $i + 1) || return 1
      done &&
      { echo 101 && test-genrandom 100 8192; } >file_101 &&
      git update-index --add file_101 &&
-     tree=`git write-tree` &&
-     commit=`git commit-tree $tree </dev/null` && {
+     tree=$(git write-tree) &&
+     commit=$(git commit-tree $tree </dev/null) && {
 	 echo $tree &&
 	 git ls-tree $tree | sed -e "s/.* \\([0-9a-f]*\\)	.*/\\1/"
      } >obj-list &&
@@ -152,10 +152,10 @@ test_expect_success \
     '[index v1] 2) create a stealth corruption in a delta base reference' \
     '# This test assumes file_101 is a delta smaller than 16 bytes.
      # It should be against file_100 but we substitute its base for file_099
-     sha1_101=`git hash-object file_101` &&
-     sha1_099=`git hash-object file_099` &&
-     offs_101=`index_obj_offset 1.idx $sha1_101` &&
-     nr_099=`index_obj_nr 1.idx $sha1_099` &&
+     sha1_101=$(git hash-object file_101) &&
+     sha1_099=$(git hash-object file_099) &&
+     offs_101=$(index_obj_offset 1.idx $sha1_101) &&
+     nr_099=$(index_obj_nr 1.idx $sha1_099) &&
      chmod +w ".git/objects/pack/pack-${pack1}.pack" &&
      dd of=".git/objects/pack/pack-${pack1}.pack" seek=$(($offs_101 + 1)) \
         if=".git/objects/pack/pack-${pack1}.idx" \
@@ -193,10 +193,10 @@ test_expect_success \
     '[index v2] 2) create a stealth corruption in a delta base reference' \
     '# This test assumes file_101 is a delta smaller than 16 bytes.
      # It should be against file_100 but we substitute its base for file_099
-     sha1_101=`git hash-object file_101` &&
-     sha1_099=`git hash-object file_099` &&
-     offs_101=`index_obj_offset 1.idx $sha1_101` &&
-     nr_099=`index_obj_nr 1.idx $sha1_099` &&
+     sha1_101=$(git hash-object file_101) &&
+     sha1_099=$(git hash-object file_099) &&
+     offs_101=$(index_obj_offset 1.idx $sha1_101) &&
+     nr_099=$(index_obj_nr 1.idx $sha1_099) &&
      chmod +w ".git/objects/pack/pack-${pack1}.pack" &&
      dd of=".git/objects/pack/pack-${pack1}.pack" seek=$(($offs_101 + 1)) \
         if=".git/objects/pack/pack-${pack1}.idx" \
@@ -222,11 +222,11 @@ test_expect_success \
     'rm -f .git/objects/pack/* &&
      git index-pack --index-version=2 --stdin < "test-1-${pack1}.pack" &&
      git verify-pack ".git/objects/pack/pack-${pack1}.pack" &&
-     obj=`git hash-object file_001` &&
-     nr=`index_obj_nr ".git/objects/pack/pack-${pack1}.idx" $obj` &&
+     obj=$(git hash-object file_001) &&
+     nr=$(index_obj_nr ".git/objects/pack/pack-${pack1}.idx" $obj) &&
      chmod +w ".git/objects/pack/pack-${pack1}.idx" &&
      printf xxxx | dd of=".git/objects/pack/pack-${pack1}.idx" conv=notrunc \
-        bs=1 count=4 seek=$((8 + 256 * 4 + `wc -l <obj-list` * 20 + $nr * 4)) &&
+        bs=1 count=4 seek=$((8 + 256 * 4 + $(wc -l <obj-list) * 20 + $nr * 4)) &&
      ( while read obj
        do git cat-file -p $obj >/dev/null || exit 1
        done <obj-list ) &&
-- 
2.3.3.GIT

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

* Re: [PATCH 07/10] t5100-mailinfo.sh: use the $( ... ) construct for command substitution
  2015-12-22 15:27 ` [PATCH 07/10] t5100-mailinfo.sh: " Elia Pinto
@ 2015-12-22 18:35   ` Johannes Sixt
  2015-12-22 20:34     ` Johannes Sixt
  0 siblings, 1 reply; 27+ messages in thread
From: Johannes Sixt @ 2015-12-22 18:35 UTC (permalink / raw)
  To: Elia Pinto, git

Am 22.12.2015 um 16:27 schrieb Elia Pinto:
> -for mail in `echo 00*`
> +for mail in $(echo 00*)

> -for mail in `echo rfc2047/00*`
> +for mail in $(echo rfc2047/00*)

True, these are equvalence transformations. But a better way to get rid 
of the back-quotes is to write these lines as

for mail in echo 00*
for mail in echo rfc2047/00*

No?

-- Hannes

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

* Re: [PATCH 07/10] t5100-mailinfo.sh: use the $( ... ) construct for command substitution
  2015-12-22 18:35   ` Johannes Sixt
@ 2015-12-22 20:34     ` Johannes Sixt
  2015-12-27 23:46       ` Junio C Hamano
  0 siblings, 1 reply; 27+ messages in thread
From: Johannes Sixt @ 2015-12-22 20:34 UTC (permalink / raw)
  To: Elia Pinto, git

Am 22.12.2015 um 19:35 schrieb Johannes Sixt:
> Am 22.12.2015 um 16:27 schrieb Elia Pinto:
>> -for mail in `echo 00*`
>> +for mail in $(echo 00*)
>
>> -for mail in `echo rfc2047/00*`
>> +for mail in $(echo rfc2047/00*)
>
> True, these are equvalence transformations. But a better way to get rid
> of the back-quotes is to write these lines as
>
> for mail in echo 00*
> for mail in echo rfc2047/00*

Ahem... both of these lines without the 'echo', of course!

>
> No?
>
> -- Hannes
>

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

* Re: [PATCH 00/10] use the $( ... ) construct for command substitution
  2015-12-22 15:05 Elia Pinto
@ 2015-12-22 21:33 ` Jonathan Nieder
  0 siblings, 0 replies; 27+ 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] 27+ messages in thread

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

* Re: [PATCH 07/10] t5100-mailinfo.sh: use the $( ... ) construct for command substitution
  2015-12-22 20:34     ` Johannes Sixt
@ 2015-12-27 23:46       ` Junio C Hamano
  2015-12-28  1:59         ` Junio C Hamano
  0 siblings, 1 reply; 27+ messages in thread
From: Junio C Hamano @ 2015-12-27 23:46 UTC (permalink / raw)
  To: Johannes Sixt; +Cc: Elia Pinto, git

Johannes Sixt <j6t@kdbg.org> writes:

> Am 22.12.2015 um 19:35 schrieb Johannes Sixt:
>> Am 22.12.2015 um 16:27 schrieb Elia Pinto:
>>> -for mail in `echo 00*`
>>> +for mail in $(echo 00*)
>>
>>> -for mail in `echo rfc2047/00*`
>>> +for mail in $(echo rfc2047/00*)
>>
>> True, these are equvalence transformations. But a better way to get rid
>> of the back-quotes is to write these lines as
>>
>> for mail in echo 00*
>> for mail in echo rfc2047/00*
>
> Ahem... both of these lines without the 'echo', of course!

Very true.  Let's leave that kind of things as separate clean-ups
after these patches settle, as mixing manual and mechanical changes
in a single patch makes it harder to review.

Thanks.

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

* Re: [PATCH 07/10] t5100-mailinfo.sh: use the $( ... ) construct for command substitution
  2015-12-27 23:46       ` Junio C Hamano
@ 2015-12-28  1:59         ` Junio C Hamano
  2015-12-28  7:44           ` Johannes Sixt
  0 siblings, 1 reply; 27+ messages in thread
From: Junio C Hamano @ 2015-12-28  1:59 UTC (permalink / raw)
  To: Johannes Sixt; +Cc: Elia Pinto, git

Junio C Hamano <gitster@pobox.com> writes:

> Very true.  Let's leave that kind of things as separate clean-ups
> after these patches settle, as mixing manual and mechanical changes
> in a single patch makes it harder to review.
>
> Thanks.

So that I won't forget (I'll need to amend with your sign-off even
if this one is satisfactory to you).

-- >8 --
From: Johannes Sixt <j6t@kdbg.org>
Date: Tue, 22 Dec 2015 19:35:16 +0100
Subject: [PATCH] t5100: no need to use 'echo' command substitutions for globbing

Instead of making the shell expand 00* and invoke 'echo' with it,
and then capturing its output as command substitution, just use
the result of expanding 00* directly.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 t/t5100-mailinfo.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/t/t5100-mailinfo.sh b/t/t5100-mailinfo.sh
index 4e52b3b..85b3df5 100755
--- a/t/t5100-mailinfo.sh
+++ b/t/t5100-mailinfo.sh
@@ -23,7 +23,7 @@ check_mailinfo () {
 }
 
 
-for mail in $(echo 00*)
+for mail in 00*
 do
 	test_expect_success "mailinfo $mail" '
 		check_mailinfo $mail "" &&
@@ -51,7 +51,7 @@ test_expect_success 'split box with rfc2047 samples' \
 	echo total is $last &&
 	test $(cat rfc2047/last) = 11'
 
-for mail in $(echo rfc2047/00*)
+for mail in rfc2047/00*
 do
 	test_expect_success "mailinfo $mail" '
 		git mailinfo -u $mail-msg $mail-patch <$mail >$mail-info &&
-- 
2.7.0-rc2-145-g5695473

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

* Re: [PATCH 07/10] t5100-mailinfo.sh: use the $( ... ) construct for command substitution
  2015-12-28  1:59         ` Junio C Hamano
@ 2015-12-28  7:44           ` Johannes Sixt
  0 siblings, 0 replies; 27+ messages in thread
From: Johannes Sixt @ 2015-12-28  7:44 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Elia Pinto, git

Am 28.12.2015 um 02:59 schrieb Junio C Hamano:
> Junio C Hamano <gitster@pobox.com> writes:
>
>> Very true.  Let's leave that kind of things as separate clean-ups
>> after these patches settle, as mixing manual and mechanical changes
>> in a single patch makes it harder to review.
>>
>> Thanks.
>
> So that I won't forget (I'll need to amend with your sign-off even
> if this one is satisfactory to you).
>
> -- >8 --
> From: Johannes Sixt <j6t@kdbg.org>
> Date: Tue, 22 Dec 2015 19:35:16 +0100
> Subject: [PATCH] t5100: no need to use 'echo' command substitutions for globbing
>
> Instead of making the shell expand 00* and invoke 'echo' with it,
> and then capturing its output as command substitution, just use
> the result of expanding 00* directly.
>
> Signed-off-by: Junio C Hamano <gitster@pobox.com>
> ---
>   t/t5100-mailinfo.sh | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/t/t5100-mailinfo.sh b/t/t5100-mailinfo.sh
> index 4e52b3b..85b3df5 100755
> --- a/t/t5100-mailinfo.sh
> +++ b/t/t5100-mailinfo.sh
> @@ -23,7 +23,7 @@ check_mailinfo () {
>   }
>
>
> -for mail in $(echo 00*)
> +for mail in 00*
>   do
>   	test_expect_success "mailinfo $mail" '
>   		check_mailinfo $mail "" &&
> @@ -51,7 +51,7 @@ test_expect_success 'split box with rfc2047 samples' \
>   	echo total is $last &&
>   	test $(cat rfc2047/last) = 11'
>
> -for mail in $(echo rfc2047/00*)
> +for mail in rfc2047/00*
>   do
>   	test_expect_success "mailinfo $mail" '
>   		git mailinfo -u $mail-msg $mail-patch <$mail >$mail-info &&
>

Signed-off-by: Johannes Sixt <j6t@kdbg.org>

Thank you for making a proper patch!

-- Hannes

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

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

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

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

Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-22 15:27 [PATCH 00/10] use the $( ... ) construct for command substitution Elia Pinto
2015-12-22 15:27 ` [PATCH 01/10] t3101-ls-tree-dirname.sh: " Elia Pinto
2015-12-22 15:27 ` [PATCH 02/10] t3210-pack-refs.sh: " Elia Pinto
2015-12-22 15:27 ` [PATCH 03/10] t3403-rebase-skip.sh: " Elia Pinto
2015-12-22 15:27 ` [PATCH 04/10] t3511-cherry-pick-x.sh: " Elia Pinto
2015-12-22 15:27 ` [PATCH 05/10] t3600-rm.sh: " Elia Pinto
2015-12-22 15:27 ` [PATCH 06/10] t3700-add.sh: " Elia Pinto
2015-12-22 15:27 ` [PATCH 07/10] t5100-mailinfo.sh: " Elia Pinto
2015-12-22 18:35   ` Johannes Sixt
2015-12-22 20:34     ` Johannes Sixt
2015-12-27 23:46       ` Junio C Hamano
2015-12-28  1:59         ` Junio C Hamano
2015-12-28  7:44           ` Johannes Sixt
2015-12-22 15:27 ` [PATCH 08/10] t5300-pack-object.sh: " Elia Pinto
2015-12-22 15:27 ` [PATCH 09/10] t5301-sliding-window.sh: " Elia Pinto
2015-12-22 15:27 ` [PATCH 10/10] t5302-pack-index.sh: " Elia Pinto
  -- strict thread matches above, loose matches on Subject: below --
2016-01-12 10:45 [PATCH 00/10] " 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:05 Elia Pinto
2015-12-22 21:33 ` Jonathan Nieder
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).