* [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; 12+ 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] 12+ 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; 12+ 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] 12+ 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; 12+ 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] 12+ 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; 12+ 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] 12+ 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; 12+ 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] 12+ 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; 12+ 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] 12+ 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; 12+ 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] 12+ 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; 12+ 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] 12+ 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; 12+ 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] 12+ 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; 12+ 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] 12+ 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; 12+ 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] 12+ 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; 12+ 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] 12+ messages in thread
end of thread, other threads:[~2016-01-04 21:58 UTC | newest]
Thread overview: 12+ 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
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).