* [PATCH 00/10] use the $( ... ) construct for command substitution
@ 2016-01-04 9:10 Elia Pinto
2016-01-04 9:10 ` [PATCH 01/10] t/t5522-pull-symlink.sh: " Elia Pinto
` (10 more replies)
0 siblings, 11 replies; 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
* [PATCH 01/10] t/t5522-pull-symlink.sh: use the $( ... ) construct for command substitution
2016-01-04 9:10 [PATCH 00/10] use the $( ... ) construct for command substitution Elia Pinto
@ 2016-01-04 9:10 ` Elia Pinto
2016-01-04 9:10 ` [PATCH 02/10] t/t5530-upload-pack-error.sh: " Elia Pinto
` (9 subsequent siblings)
10 siblings, 0 replies; 22+ messages in thread
From: Elia Pinto @ 2016-01-04 9:10 UTC (permalink / raw)
To: git; +Cc: Elia Pinto
The Git CodingGuidelines prefer the $(...) construct for command
substitution instead of using the backquotes `...`.
The backquoted form is the traditional method for command
substitution, and is supported by POSIX. However, all but the
simplest uses become complicated quickly. In particular, embedded
command substitutions and/or the use of double quotes require
careful escaping with the backslash character.
The patch was generated by:
for _f in $(find . -name "*.sh")
do
perl -i -pe 'BEGIN{undef $/;} s/`(.+?)`/\$(\1)/smg' "${_f}"
done
and then carefully proof-read.
Signed-off-by: Elia Pinto <gitter.spiros@gmail.com>
---
t/t5522-pull-symlink.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/t/t5522-pull-symlink.sh b/t/t5522-pull-symlink.sh
index 8e9b204..bcff460 100755
--- a/t/t5522-pull-symlink.sh
+++ b/t/t5522-pull-symlink.sh
@@ -54,7 +54,7 @@ test_expect_success SYMLINKS 'pulling from real subdir' '
# git rev-parse --show-cdup printed a path relative to
# clone-repo/subdir/, not subdir-link/. Git rev-parse --show-cdup
# used the correct .git, but when the git pull shell script did
-# "cd `git rev-parse --show-cdup`", it ended up in the wrong
+# "cd $(git rev-parse --show-cdup)", it ended up in the wrong
# directory. A POSIX shell's "cd" works a little differently
# than chdir() in C; "cd -P" is much closer to chdir().
#
--
2.3.3.GIT
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 02/10] t/t5530-upload-pack-error.sh: use the $( ... ) construct for command substitution
2016-01-04 9:10 [PATCH 00/10] use the $( ... ) construct for command substitution Elia Pinto
2016-01-04 9:10 ` [PATCH 01/10] t/t5522-pull-symlink.sh: " Elia Pinto
@ 2016-01-04 9:10 ` Elia Pinto
2016-01-04 9:10 ` [PATCH 03/10] t/t5532-fetch-proxy.sh: " Elia Pinto
` (8 subsequent siblings)
10 siblings, 0 replies; 22+ messages in thread
From: Elia Pinto @ 2016-01-04 9:10 UTC (permalink / raw)
To: git; +Cc: Elia Pinto
The Git CodingGuidelines prefer the $(...) construct for command
substitution instead of using the backquotes `...`.
The backquoted form is the traditional method for command
substitution, and is supported by POSIX. However, all but the
simplest uses become complicated quickly. In particular, embedded
command substitutions and/or the use of double quotes require
careful escaping with the backslash character.
The patch was generated by:
for _f in $(find . -name "*.sh")
do
perl -i -pe 'BEGIN{undef $/;} s/`(.+?)`/\$(\1)/smg' "${_f}"
done
and then carefully proof-read.
Signed-off-by: Elia Pinto <gitter.spiros@gmail.com>
---
t/t5530-upload-pack-error.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/t/t5530-upload-pack-error.sh b/t/t5530-upload-pack-error.sh
index 3932e79..4f6e32b 100755
--- a/t/t5530-upload-pack-error.sh
+++ b/t/t5530-upload-pack-error.sh
@@ -4,7 +4,7 @@ test_description='errors in upload-pack'
. ./test-lib.sh
-D=`pwd`
+D=$(pwd)
corrupt_repo () {
object_sha1=$(git rev-parse "$1") &&
--
2.3.3.GIT
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 03/10] t/t5532-fetch-proxy.sh: use the $( ... ) construct for command substitution
2016-01-04 9:10 [PATCH 00/10] use the $( ... ) construct for command substitution Elia Pinto
2016-01-04 9:10 ` [PATCH 01/10] t/t5522-pull-symlink.sh: " Elia Pinto
2016-01-04 9:10 ` [PATCH 02/10] t/t5530-upload-pack-error.sh: " Elia Pinto
@ 2016-01-04 9:10 ` Elia Pinto
2016-01-04 9:10 ` [PATCH 04/10] t/t5537-fetch-shallow.sh: " Elia Pinto
` (7 subsequent siblings)
10 siblings, 0 replies; 22+ messages in thread
From: Elia Pinto @ 2016-01-04 9:10 UTC (permalink / raw)
To: git; +Cc: Elia Pinto
The Git CodingGuidelines prefer the $(...) construct for command
substitution instead of using the backquotes `...`.
The backquoted form is the traditional method for command
substitution, and is supported by POSIX. However, all but the
simplest uses become complicated quickly. In particular, embedded
command substitutions and/or the use of double quotes require
careful escaping with the backslash character.
The patch was generated by:
for _f in $(find . -name "*.sh")
do
perl -i -pe 'BEGIN{undef $/;} s/`(.+?)`/\$(\1)/smg' "${_f}"
done
and then carefully proof-read.
Signed-off-by: Elia Pinto <gitter.spiros@gmail.com>
---
t/t5532-fetch-proxy.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/t/t5532-fetch-proxy.sh b/t/t5532-fetch-proxy.sh
index 5531bd1..d75ef0e 100755
--- a/t/t5532-fetch-proxy.sh
+++ b/t/t5532-fetch-proxy.sh
@@ -15,7 +15,7 @@ test_expect_success 'setup remote repo' '
cat >proxy <<'EOF'
#!/bin/sh
echo >&2 "proxying for $*"
-cmd=`"$PERL_PATH" -e '
+cmd=$("$PERL_PATH" -e '
read(STDIN, $buf, 4);
my $n = hex($buf) - 4;
read(STDIN, $buf, $n);
@@ -23,7 +23,7 @@ cmd=`"$PERL_PATH" -e '
# drop absolute-path on repo name
$cmd =~ s{ /}{ };
print $cmd;
-'`
+')
echo >&2 "Running '$cmd'"
exec $cmd
EOF
--
2.3.3.GIT
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 04/10] t/t5537-fetch-shallow.sh: use the $( ... ) construct for command substitution
2016-01-04 9:10 [PATCH 00/10] use the $( ... ) construct for command substitution Elia Pinto
` (2 preceding siblings ...)
2016-01-04 9:10 ` [PATCH 03/10] t/t5532-fetch-proxy.sh: " Elia Pinto
@ 2016-01-04 9:10 ` Elia Pinto
2016-01-04 9:10 ` [PATCH 05/10] t/t5538-push-shallow.sh: " Elia Pinto
` (6 subsequent siblings)
10 siblings, 0 replies; 22+ messages in thread
From: Elia Pinto @ 2016-01-04 9:10 UTC (permalink / raw)
To: git; +Cc: Elia Pinto
The Git CodingGuidelines prefer the $(...) construct for command
substitution instead of using the backquotes `...`.
The backquoted form is the traditional method for command
substitution, and is supported by POSIX. However, all but the
simplest uses become complicated quickly. In particular, embedded
command substitutions and/or the use of double quotes require
careful escaping with the backslash character.
The patch was generated by:
for _f in $(find . -name "*.sh")
do
perl -i -pe 'BEGIN{undef $/;} s/`(.+?)`/\$(\1)/smg' "${_f}"
done
and then carefully proof-read.
Signed-off-by: Elia Pinto <gitter.spiros@gmail.com>
---
t/t5537-fetch-shallow.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/t/t5537-fetch-shallow.sh b/t/t5537-fetch-shallow.sh
index a980574..df8d2f0 100755
--- a/t/t5537-fetch-shallow.sh
+++ b/t/t5537-fetch-shallow.sh
@@ -98,7 +98,7 @@ EOF
test_expect_success 'fetch something upstream has but hidden by clients shallow boundaries' '
# the blob "1" is available in .git but hidden by the
# shallow2/.git/shallow and it should be resent
- ! git --git-dir=shallow2/.git cat-file blob `echo 1|git hash-object --stdin` >/dev/null &&
+ ! git --git-dir=shallow2/.git cat-file blob $(echo 1|git hash-object --stdin) >/dev/null &&
echo 1 >1.t &&
git add 1.t &&
git commit -m add-1-back &&
@@ -114,7 +114,7 @@ add-1-back
EOF
test_cmp expect actual
) &&
- git --git-dir=shallow2/.git cat-file blob `echo 1|git hash-object --stdin` >/dev/null
+ git --git-dir=shallow2/.git cat-file blob $(echo 1|git hash-object --stdin) >/dev/null
'
--
2.3.3.GIT
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 05/10] t/t5538-push-shallow.sh: use the $( ... ) construct for command substitution
2016-01-04 9:10 [PATCH 00/10] use the $( ... ) construct for command substitution Elia Pinto
` (3 preceding siblings ...)
2016-01-04 9:10 ` [PATCH 04/10] t/t5537-fetch-shallow.sh: " Elia Pinto
@ 2016-01-04 9:10 ` Elia Pinto
2016-01-04 9:10 ` [PATCH 06/10] t/t5550-http-fetch-dumb.sh: " Elia Pinto
` (5 subsequent siblings)
10 siblings, 0 replies; 22+ messages in thread
From: Elia Pinto @ 2016-01-04 9:10 UTC (permalink / raw)
To: git; +Cc: Elia Pinto
The Git CodingGuidelines prefer the $(...) construct for command
substitution instead of using the backquotes `...`.
The backquoted form is the traditional method for command
substitution, and is supported by POSIX. However, all but the
simplest uses become complicated quickly. In particular, embedded
command substitutions and/or the use of double quotes require
careful escaping with the backslash character.
The patch was generated by:
for _f in $(find . -name "*.sh")
do
perl -i -pe 'BEGIN{undef $/;} s/`(.+?)`/\$(\1)/smg' "${_f}"
done
and then carefully proof-read.
Signed-off-by: Elia Pinto <gitter.spiros@gmail.com>
---
t/t5538-push-shallow.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/t/t5538-push-shallow.sh b/t/t5538-push-shallow.sh
index ceee95b..ecbf84d 100755
--- a/t/t5538-push-shallow.sh
+++ b/t/t5538-push-shallow.sh
@@ -104,7 +104,7 @@ EOF
'
test_expect_success 'push from full to shallow' '
- ! git --git-dir=shallow2/.git cat-file blob `echo 1|git hash-object --stdin` &&
+ ! git --git-dir=shallow2/.git cat-file blob $(echo 1|git hash-object --stdin) &&
commit 1 &&
git push shallow2/.git +master:refs/remotes/top/master &&
(
@@ -117,7 +117,7 @@ test_expect_success 'push from full to shallow' '
3
EOF
test_cmp expect actual &&
- git cat-file blob `echo 1|git hash-object --stdin` >/dev/null
+ git cat-file blob $(echo 1|git hash-object --stdin) >/dev/null
)
'
test_done
--
2.3.3.GIT
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 06/10] t/t5550-http-fetch-dumb.sh: use the $( ... ) construct for command substitution
2016-01-04 9:10 [PATCH 00/10] use the $( ... ) construct for command substitution Elia Pinto
` (4 preceding siblings ...)
2016-01-04 9:10 ` [PATCH 05/10] t/t5538-push-shallow.sh: " Elia Pinto
@ 2016-01-04 9:10 ` Elia Pinto
2016-01-04 9:10 ` [PATCH 07/10] t/t5570-git-daemon.sh: " Elia Pinto
` (4 subsequent siblings)
10 siblings, 0 replies; 22+ messages in thread
From: Elia Pinto @ 2016-01-04 9:10 UTC (permalink / raw)
To: git; +Cc: Elia Pinto
The Git CodingGuidelines prefer the $(...) construct for command
substitution instead of using the backquotes `...`.
The backquoted form is the traditional method for command
substitution, and is supported by POSIX. However, all but the
simplest uses become complicated quickly. In particular, embedded
command substitutions and/or the use of double quotes require
careful escaping with the backslash character.
The patch was generated by:
for _f in $(find . -name "*.sh")
do
perl -i -pe 'BEGIN{undef $/;} s/`(.+?)`/\$(\1)/smg' "${_f}"
done
and then carefully proof-read.
Signed-off-by: Elia Pinto <gitter.spiros@gmail.com>
---
t/t5550-http-fetch-dumb.sh | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/t/t5550-http-fetch-dumb.sh b/t/t5550-http-fetch-dumb.sh
index 87a7aa0..6414635 100755
--- a/t/t5550-http-fetch-dumb.sh
+++ b/t/t5550-http-fetch-dumb.sh
@@ -132,7 +132,7 @@ test_expect_success 'fetch packed objects' '
test_expect_success 'fetch notices corrupt pack' '
cp -R "$HTTPD_DOCUMENT_ROOT_PATH"/repo_pack.git "$HTTPD_DOCUMENT_ROOT_PATH"/repo_bad1.git &&
(cd "$HTTPD_DOCUMENT_ROOT_PATH"/repo_bad1.git &&
- p=`ls objects/pack/pack-*.pack` &&
+ p=$(ls objects/pack/pack-*.pack) &&
chmod u+w $p &&
printf %0256d 0 | dd of=$p bs=256 count=1 seek=1 conv=notrunc
) &&
@@ -140,14 +140,14 @@ test_expect_success 'fetch notices corrupt pack' '
(cd repo_bad1.git &&
git --bare init &&
test_must_fail git --bare fetch $HTTPD_URL/dumb/repo_bad1.git &&
- test 0 = `ls objects/pack/pack-*.pack | wc -l`
+ test 0 = $(ls objects/pack/pack-*.pack | wc -l)
)
'
test_expect_success 'fetch notices corrupt idx' '
cp -R "$HTTPD_DOCUMENT_ROOT_PATH"/repo_pack.git "$HTTPD_DOCUMENT_ROOT_PATH"/repo_bad2.git &&
(cd "$HTTPD_DOCUMENT_ROOT_PATH"/repo_bad2.git &&
- p=`ls objects/pack/pack-*.idx` &&
+ p=$(ls objects/pack/pack-*.idx) &&
chmod u+w $p &&
printf %0256d 0 | dd of=$p bs=256 count=1 seek=1 conv=notrunc
) &&
@@ -155,7 +155,7 @@ test_expect_success 'fetch notices corrupt idx' '
(cd repo_bad2.git &&
git --bare init &&
test_must_fail git --bare fetch $HTTPD_URL/dumb/repo_bad2.git &&
- test 0 = `ls objects/pack | wc -l`
+ test 0 = $(ls objects/pack | wc -l)
)
'
--
2.3.3.GIT
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 07/10] t/t5570-git-daemon.sh: use the $( ... ) construct for command substitution
2016-01-04 9:10 [PATCH 00/10] use the $( ... ) construct for command substitution Elia Pinto
` (5 preceding siblings ...)
2016-01-04 9:10 ` [PATCH 06/10] t/t5550-http-fetch-dumb.sh: " Elia Pinto
@ 2016-01-04 9:10 ` Elia Pinto
2016-01-04 9:10 ` [PATCH 08/10] t/t5601-clone.sh: " Elia Pinto
` (3 subsequent siblings)
10 siblings, 0 replies; 22+ messages in thread
From: Elia Pinto @ 2016-01-04 9:10 UTC (permalink / raw)
To: git; +Cc: Elia Pinto
The Git CodingGuidelines prefer the $(...) construct for command
substitution instead of using the backquotes `...`.
The backquoted form is the traditional method for command
substitution, and is supported by POSIX. However, all but the
simplest uses become complicated quickly. In particular, embedded
command substitutions and/or the use of double quotes require
careful escaping with the backslash character.
The patch was generated by:
for _f in $(find . -name "*.sh")
do
perl -i -pe 'BEGIN{undef $/;} s/`(.+?)`/\$(\1)/smg' "${_f}"
done
and then carefully proof-read.
Signed-off-by: Elia Pinto <gitter.spiros@gmail.com>
---
t/t5570-git-daemon.sh | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/t/t5570-git-daemon.sh b/t/t5570-git-daemon.sh
index b7e2832..d76269a 100755
--- a/t/t5570-git-daemon.sh
+++ b/t/t5570-git-daemon.sh
@@ -57,7 +57,7 @@ test_expect_success 'prepare pack objects' '
test_expect_success 'fetch notices corrupt pack' '
cp -R "$GIT_DAEMON_DOCUMENT_ROOT_PATH"/repo_pack.git "$GIT_DAEMON_DOCUMENT_ROOT_PATH"/repo_bad1.git &&
(cd "$GIT_DAEMON_DOCUMENT_ROOT_PATH"/repo_bad1.git &&
- p=`ls objects/pack/pack-*.pack` &&
+ p=$(ls objects/pack/pack-*.pack) &&
chmod u+w $p &&
printf %0256d 0 | dd of=$p bs=256 count=1 seek=1 conv=notrunc
) &&
@@ -65,14 +65,14 @@ test_expect_success 'fetch notices corrupt pack' '
(cd repo_bad1.git &&
git --bare init &&
test_must_fail git --bare fetch "$GIT_DAEMON_URL/repo_bad1.git" &&
- test 0 = `ls objects/pack/pack-*.pack | wc -l`
+ test 0 = $(ls objects/pack/pack-*.pack | wc -l)
)
'
test_expect_success 'fetch notices corrupt idx' '
cp -R "$GIT_DAEMON_DOCUMENT_ROOT_PATH"/repo_pack.git "$GIT_DAEMON_DOCUMENT_ROOT_PATH"/repo_bad2.git &&
(cd "$GIT_DAEMON_DOCUMENT_ROOT_PATH"/repo_bad2.git &&
- p=`ls objects/pack/pack-*.idx` &&
+ p=$(ls objects/pack/pack-*.idx) &&
chmod u+w $p &&
printf %0256d 0 | dd of=$p bs=256 count=1 seek=1 conv=notrunc
) &&
@@ -80,7 +80,7 @@ test_expect_success 'fetch notices corrupt idx' '
(cd repo_bad2.git &&
git --bare init &&
test_must_fail git --bare fetch "$GIT_DAEMON_URL/repo_bad2.git" &&
- test 0 = `ls objects/pack | wc -l`
+ test 0 = $(ls objects/pack | wc -l)
)
'
--
2.3.3.GIT
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 08/10] t/t5601-clone.sh: use the $( ... ) construct for command substitution
2016-01-04 9:10 [PATCH 00/10] use the $( ... ) construct for command substitution Elia Pinto
` (6 preceding siblings ...)
2016-01-04 9:10 ` [PATCH 07/10] t/t5570-git-daemon.sh: " Elia Pinto
@ 2016-01-04 9:10 ` Elia Pinto
2016-01-04 9:10 ` [PATCH 09/10] t/t5700-clone-reference.sh: " Elia Pinto
` (2 subsequent siblings)
10 siblings, 0 replies; 22+ messages in thread
From: Elia Pinto @ 2016-01-04 9:10 UTC (permalink / raw)
To: git; +Cc: Elia Pinto
The Git CodingGuidelines prefer the $(...) construct for command
substitution instead of using the backquotes `...`.
The backquoted form is the traditional method for command
substitution, and is supported by POSIX. However, all but the
simplest uses become complicated quickly. In particular, embedded
command substitutions and/or the use of double quotes require
careful escaping with the backslash character.
The patch was generated by:
for _f in $(find . -name "*.sh")
do
perl -i -pe 'BEGIN{undef $/;} s/`(.+?)`/\$(\1)/smg' "${_f}"
done
and then carefully proof-read.
Signed-off-by: Elia Pinto <gitter.spiros@gmail.com>
---
t/t5601-clone.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/t/t5601-clone.sh b/t/t5601-clone.sh
index 9b34f3c..61dc4ce 100755
--- a/t/t5601-clone.sh
+++ b/t/t5601-clone.sh
@@ -221,7 +221,7 @@ test_expect_success 'clone separate gitdir' '
'
test_expect_success 'clone separate gitdir: output' '
- echo "gitdir: `pwd`/realgitdir" >expected &&
+ echo "gitdir: $(pwd)/realgitdir" >expected &&
test_cmp expected dst/.git
'
--
2.3.3.GIT
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 09/10] t/t5700-clone-reference.sh: use the $( ... ) construct for command substitution
2016-01-04 9:10 [PATCH 00/10] use the $( ... ) construct for command substitution Elia Pinto
` (7 preceding siblings ...)
2016-01-04 9:10 ` [PATCH 08/10] t/t5601-clone.sh: " Elia Pinto
@ 2016-01-04 9:10 ` Elia Pinto
2016-01-04 9:10 ` [PATCH 10/10] t/t5710-info-alternate.sh: " Elia Pinto
2016-01-04 21:58 ` [PATCH 00/10] " Junio C Hamano
10 siblings, 0 replies; 22+ messages in thread
From: Elia Pinto @ 2016-01-04 9:10 UTC (permalink / raw)
To: git; +Cc: Elia Pinto
The Git CodingGuidelines prefer the $(...) construct for command
substitution instead of using the backquotes `...`.
The backquoted form is the traditional method for command
substitution, and is supported by POSIX. However, all but the
simplest uses become complicated quickly. In particular, embedded
command substitutions and/or the use of double quotes require
careful escaping with the backslash character.
The patch was generated by:
for _f in $(find . -name "*.sh")
do
perl -i -pe 'BEGIN{undef $/;} s/`(.+?)`/\$(\1)/smg' "${_f}"
done
and then carefully proof-read.
Signed-off-by: Elia Pinto <gitter.spiros@gmail.com>
---
t/t5700-clone-reference.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/t/t5700-clone-reference.sh b/t/t5700-clone-reference.sh
index dfa1bf7..4320082 100755
--- a/t/t5700-clone-reference.sh
+++ b/t/t5700-clone-reference.sh
@@ -6,7 +6,7 @@
test_description='test clone --reference'
. ./test-lib.sh
-base_dir=`pwd`
+base_dir=$(pwd)
U=$base_dir/UPLOAD_LOG
--
2.3.3.GIT
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 10/10] t/t5710-info-alternate.sh: use the $( ... ) construct for command substitution
2016-01-04 9:10 [PATCH 00/10] use the $( ... ) construct for command substitution Elia Pinto
` (8 preceding siblings ...)
2016-01-04 9:10 ` [PATCH 09/10] t/t5700-clone-reference.sh: " Elia Pinto
@ 2016-01-04 9:10 ` Elia Pinto
2016-01-04 21:58 ` [PATCH 00/10] " Junio C Hamano
10 siblings, 0 replies; 22+ messages in thread
From: Elia Pinto @ 2016-01-04 9:10 UTC (permalink / raw)
To: git; +Cc: Elia Pinto
The Git CodingGuidelines prefer the $(...) construct for command
substitution instead of using the backquotes `...`.
The backquoted form is the traditional method for command
substitution, and is supported by POSIX. However, all but the
simplest uses become complicated quickly. In particular, embedded
command substitutions and/or the use of double quotes require
careful escaping with the backslash character.
The patch was generated by:
for _f in $(find . -name "*.sh")
do
perl -i -pe 'BEGIN{undef $/;} s/`(.+?)`/\$(\1)/smg' "${_f}"
done
and then carefully proof-read.
Signed-off-by: Elia Pinto <gitter.spiros@gmail.com>
---
t/t5710-info-alternate.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/t/t5710-info-alternate.sh b/t/t5710-info-alternate.sh
index 5a6e49d..9cd2626 100755
--- a/t/t5710-info-alternate.sh
+++ b/t/t5710-info-alternate.sh
@@ -21,7 +21,7 @@ test_valid_repo() {
test_line_count = 0 fsck.log
}
-base_dir=`pwd`
+base_dir=$(pwd)
test_expect_success 'preparing first repository' \
'test_create_repo A && cd A &&
--
2.3.3.GIT
^ permalink raw reply related [flat|nested] 22+ messages in thread
* Re: [PATCH 00/10] use the $( ... ) construct for command substitution
2016-01-04 9:10 [PATCH 00/10] use the $( ... ) construct for command substitution Elia Pinto
` (9 preceding siblings ...)
2016-01-04 9:10 ` [PATCH 10/10] t/t5710-info-alternate.sh: " Elia Pinto
@ 2016-01-04 21:58 ` Junio C Hamano
10 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-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
* [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-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
* [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
@ 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
* [PATCH 00/10] use the $( ... ) construct for command substitution
@ 2015-12-22 15:05 Elia Pinto
2015-12-22 21:33 ` Jonathan Nieder
0 siblings, 1 reply; 22+ messages in thread
From: Elia Pinto @ 2015-12-22 15:05 UTC (permalink / raw)
To: git; +Cc: Elia Pinto
This patch series continues the changes introduced with the merge
6753d8a85d543253d95184ec2faad6dc197f248:
Merge branch 'ep/shell-command-substitution'
Adjust shell scripts to use $(cmd) instead of `cmd`.
This is the second series, the other will be sent separately.
Elia Pinto (10):
t/t1100-commit-tree-options.sh: use the $( ... ) construct for command
substitution
t/t1401-symbolic-ref.sh: use the $( ... ) construct for command
substitution
t/t1410-reflog.sh: use the $( ... ) construct for command substitution
t/t1511-rev-parse-caret.sh: use the $( ... ) construct for command
substitution
t/t1512-rev-parse-disambiguation.sh: use the $( ... ) construct for
command substitution
t/t1700-split-index.sh: use the $( ... ) construct for command
substitution
t/t2025-worktree-add.sh: use the $( ... ) construct for command
substitution
t/t2102-update-index-symlinks.sh: use the $( ... ) construct for
command substitution
t/t3030-merge-recursive.sh: use the $( ... ) construct for command
substitution
t/t3100-ls-tree-restrict.sh: use the $( ... ) construct for command
substitution
t/t1100-commit-tree-options.sh | 4 ++--
t/t1401-symbolic-ref.sh | 2 +-
t/t1410-reflog.sh | 24 ++++++++++++------------
t/t1511-rev-parse-caret.sh | 4 ++--
t/t1512-rev-parse-disambiguation.sh | 8 ++++----
t/t1700-split-index.sh | 2 +-
t/t2025-worktree-add.sh | 4 ++--
t/t2102-update-index-symlinks.sh | 2 +-
t/t3030-merge-recursive.sh | 2 +-
t/t3100-ls-tree-restrict.sh | 2 +-
10 files changed, 27 insertions(+), 27 deletions(-)
--
2.3.3.GIT
^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH 00/10] use the $( ... ) construct for command substitution
@ 2015-12-22 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
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 --
2016-01-04 9:10 [PATCH 00/10] use the $( ... ) construct for command substitution Elia Pinto
2016-01-04 9:10 ` [PATCH 01/10] t/t5522-pull-symlink.sh: " Elia Pinto
2016-01-04 9:10 ` [PATCH 02/10] t/t5530-upload-pack-error.sh: " Elia Pinto
2016-01-04 9:10 ` [PATCH 03/10] t/t5532-fetch-proxy.sh: " Elia Pinto
2016-01-04 9:10 ` [PATCH 04/10] t/t5537-fetch-shallow.sh: " Elia Pinto
2016-01-04 9:10 ` [PATCH 05/10] t/t5538-push-shallow.sh: " Elia Pinto
2016-01-04 9:10 ` [PATCH 06/10] t/t5550-http-fetch-dumb.sh: " Elia Pinto
2016-01-04 9:10 ` [PATCH 07/10] t/t5570-git-daemon.sh: " Elia Pinto
2016-01-04 9:10 ` [PATCH 08/10] t/t5601-clone.sh: " Elia Pinto
2016-01-04 9:10 ` [PATCH 09/10] t/t5700-clone-reference.sh: " Elia Pinto
2016-01-04 9:10 ` [PATCH 10/10] t/t5710-info-alternate.sh: " Elia Pinto
2016-01-04 21:58 ` [PATCH 00/10] " Junio C Hamano
-- 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
2015-12-23 13:45 Elia Pinto
2015-12-22 15:27 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).