* [PATCH 00/10] use the $( ... ) construct for command substitution
@ 2015-12-23 13:45 Elia Pinto
2015-12-23 13:45 ` [PATCH 01/10] t/t5303-pack-corruption-resilience.sh: " Elia Pinto
` (9 more replies)
0 siblings, 10 replies; 11+ 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] 11+ messages in thread
* [PATCH 01/10] t/t5303-pack-corruption-resilience.sh: use the $( ... ) construct for command substitution
2015-12-23 13:45 [PATCH 00/10] use the $( ... ) construct for command substitution Elia Pinto
@ 2015-12-23 13:45 ` Elia Pinto
2015-12-23 13:45 ` [PATCH 02/10] t/t5304-prune.sh: " Elia Pinto
` (8 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: Elia Pinto @ 2015-12-23 13:45 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/t5303-pack-corruption-resilience.sh | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/t/t5303-pack-corruption-resilience.sh b/t/t5303-pack-corruption-resilience.sh
index 663b02b..5940ce2 100755
--- a/t/t5303-pack-corruption-resilience.sh
+++ b/t/t5303-pack-corruption-resilience.sh
@@ -32,23 +32,23 @@ create_test_files() {
create_new_pack() {
rm -rf .git &&
git init &&
- blob_1=`git hash-object -t blob -w file_1` &&
- blob_2=`git hash-object -t blob -w file_2` &&
- blob_3=`git hash-object -t blob -w file_3` &&
- pack=`printf "$blob_1\n$blob_2\n$blob_3\n" |
- git pack-objects $@ .git/objects/pack/pack` &&
+ blob_1=$(git hash-object -t blob -w file_1) &&
+ blob_2=$(git hash-object -t blob -w file_2) &&
+ blob_3=$(git hash-object -t blob -w file_3) &&
+ pack=$(printf "$blob_1\n$blob_2\n$blob_3\n" |
+ git pack-objects $@ .git/objects/pack/pack) &&
pack=".git/objects/pack/pack-${pack}" &&
git verify-pack -v ${pack}.pack
}
do_repack() {
- pack=`printf "$blob_1\n$blob_2\n$blob_3\n" |
- git pack-objects $@ .git/objects/pack/pack` &&
+ pack=$(printf "$blob_1\n$blob_2\n$blob_3\n" |
+ git pack-objects $@ .git/objects/pack/pack) &&
pack=".git/objects/pack/pack-${pack}"
}
do_corrupt_object() {
- ofs=`git show-index < ${pack}.idx | grep $1 | cut -f1 -d" "` &&
+ ofs=$(git show-index < ${pack}.idx | grep $1 | cut -f1 -d" ") &&
ofs=$(($ofs + $2)) &&
chmod +w ${pack}.pack &&
dd of=${pack}.pack bs=1 conv=notrunc seek=$ofs &&
--
2.3.3.GIT
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 02/10] t/t5304-prune.sh: use the $( ... ) construct for command substitution
2015-12-23 13:45 [PATCH 00/10] use the $( ... ) construct for command substitution Elia Pinto
2015-12-23 13:45 ` [PATCH 01/10] t/t5303-pack-corruption-resilience.sh: " Elia Pinto
@ 2015-12-23 13:45 ` Elia Pinto
2015-12-23 13:45 ` [PATCH 03/10] t/t5305-include-tag.sh: " Elia Pinto
` (7 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: Elia Pinto @ 2015-12-23 13:45 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/t5304-prune.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/t/t5304-prune.sh b/t/t5304-prune.sh
index def203c..133b584 100755
--- a/t/t5304-prune.sh
+++ b/t/t5304-prune.sh
@@ -266,7 +266,7 @@ EOF
'
test_expect_success 'prune .git/shallow' '
- SHA1=`echo hi|git commit-tree HEAD^{tree}` &&
+ SHA1=$(echo hi|git commit-tree HEAD^{tree}) &&
echo $SHA1 >.git/shallow &&
git prune --dry-run >out &&
grep $SHA1 .git/shallow &&
--
2.3.3.GIT
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 03/10] t/t5305-include-tag.sh: use the $( ... ) construct for command substitution
2015-12-23 13:45 [PATCH 00/10] use the $( ... ) construct for command substitution Elia Pinto
2015-12-23 13:45 ` [PATCH 01/10] t/t5303-pack-corruption-resilience.sh: " Elia Pinto
2015-12-23 13:45 ` [PATCH 02/10] t/t5304-prune.sh: " Elia Pinto
@ 2015-12-23 13:45 ` Elia Pinto
2015-12-23 13:45 ` [PATCH 04/10] t/t5500-fetch-pack.sh: " Elia Pinto
` (6 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: Elia Pinto @ 2015-12-23 13:45 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/t5305-include-tag.sh | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/t/t5305-include-tag.sh b/t/t5305-include-tag.sh
index 21517c7..f314ad5 100755
--- a/t/t5305-include-tag.sh
+++ b/t/t5305-include-tag.sh
@@ -3,20 +3,20 @@
test_description='git pack-object --include-tag'
. ./test-lib.sh
-TRASH=`pwd`
+TRASH=$(pwd)
test_expect_success setup '
echo c >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 "object $commit" >sig &&
echo "type commit" >>sig &&
echo "tag mytag" >>sig &&
echo "tagger $(git var GIT_COMMITTER_IDENT)" >>sig &&
echo >>sig &&
echo "our test tag" >>sig &&
- tag=`git mktag <sig` &&
+ tag=$(git mktag <sig) &&
rm d sig &&
git update-ref refs/tags/mytag $tag && {
echo $tree &&
--
2.3.3.GIT
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 04/10] t/t5500-fetch-pack.sh: use the $( ... ) construct for command substitution
2015-12-23 13:45 [PATCH 00/10] use the $( ... ) construct for command substitution Elia Pinto
` (2 preceding siblings ...)
2015-12-23 13:45 ` [PATCH 03/10] t/t5305-include-tag.sh: " Elia Pinto
@ 2015-12-23 13:45 ` Elia Pinto
2015-12-23 13:45 ` [PATCH 05/10] t/t5505-remote.sh: " Elia Pinto
` (5 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: Elia Pinto @ 2015-12-23 13:45 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/t5500-fetch-pack.sh | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/t/t5500-fetch-pack.sh b/t/t5500-fetch-pack.sh
index 3a9b775..e5f83bf 100755
--- a/t/t5500-fetch-pack.sh
+++ b/t/t5500-fetch-pack.sh
@@ -14,7 +14,7 @@ test_description='Testing multi_ack pack fetching'
add () {
name=$1 &&
text="$@" &&
- branch=`echo $name | sed -e 's/^\(.\).*$/\1/'` &&
+ branch=$(echo $name | sed -e 's/^\(.\).*$/\1/') &&
parents="" &&
shift &&
@@ -50,18 +50,18 @@ pull_to_client () {
case "$heads" in *B*)
echo $BTIP > .git/refs/heads/B;;
esac &&
- git symbolic-ref HEAD refs/heads/`echo $heads \
- | sed -e "s/^\(.\).*$/\1/"` &&
+ git symbolic-ref HEAD refs/heads/$(echo $heads \
+ | sed -e "s/^\(.\).*$/\1/") &&
git fsck --full &&
mv .git/objects/pack/pack-* . &&
- p=`ls -1 pack-*.pack` &&
+ p=$(ls -1 pack-*.pack) &&
git unpack-objects <$p &&
git fsck --full &&
- idx=`echo pack-*.idx` &&
- pack_count=`git show-index <$idx | wc -l` &&
+ idx=$(echo pack-*.idx) &&
+ pack_count=$(git show-index <$idx | wc -l) &&
test $pack_count = $count &&
rm -f pack-*
)
@@ -132,13 +132,13 @@ test_expect_success 'single given branch clone' '
test_expect_success 'clone shallow depth 1' '
git clone --no-single-branch --depth 1 "file://$(pwd)/." shallow0 &&
- test "`git --git-dir=shallow0/.git rev-list --count HEAD`" = 1
+ test "$(git --git-dir=shallow0/.git rev-list --count HEAD)" = 1
'
test_expect_success 'clone shallow depth 1 with fsck' '
git config --global fetch.fsckobjects true &&
git clone --no-single-branch --depth 1 "file://$(pwd)/." shallow0fsck &&
- test "`git --git-dir=shallow0fsck/.git rev-list --count HEAD`" = 1 &&
+ test "$(git --git-dir=shallow0fsck/.git rev-list --count HEAD)" = 1 &&
git config --global --unset fetch.fsckobjects
'
@@ -147,7 +147,7 @@ test_expect_success 'clone shallow' '
'
test_expect_success 'clone shallow depth count' '
- test "`git --git-dir=shallow/.git rev-list --count HEAD`" = 2
+ test "$(git --git-dir=shallow/.git rev-list --count HEAD)" = 2
'
test_expect_success 'clone shallow object count' '
@@ -273,7 +273,7 @@ test_expect_success 'additional simple shallow deepenings' '
'
test_expect_success 'clone shallow depth count' '
- test "`git --git-dir=shallow/.git rev-list --count HEAD`" = 11
+ test "$(git --git-dir=shallow/.git rev-list --count HEAD)" = 11
'
test_expect_success 'clone shallow object count' '
--
2.3.3.GIT
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 05/10] t/t5505-remote.sh: use the $( ... ) construct for command substitution
2015-12-23 13:45 [PATCH 00/10] use the $( ... ) construct for command substitution Elia Pinto
` (3 preceding siblings ...)
2015-12-23 13:45 ` [PATCH 04/10] t/t5500-fetch-pack.sh: " Elia Pinto
@ 2015-12-23 13:45 ` Elia Pinto
2015-12-23 13:45 ` [PATCH 06/10] t/t5506-remote-groups.sh: " Elia Pinto
` (4 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: Elia Pinto @ 2015-12-23 13:45 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/t5505-remote.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/t/t5505-remote.sh b/t/t5505-remote.sh
index dfaf9d9..1a8e3b8 100755
--- a/t/t5505-remote.sh
+++ b/t/t5505-remote.sh
@@ -85,7 +85,7 @@ test_expect_success C_LOCALE_OUTPUT 'check remote-tracking' '
test_expect_success 'remote forces tracking branches' '
(
cd test &&
- case `git config remote.second.fetch` in
+ case $(git config remote.second.fetch) in
+*) true ;;
*) false ;;
esac
--
2.3.3.GIT
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 06/10] t/t5506-remote-groups.sh: use the $( ... ) construct for command substitution
2015-12-23 13:45 [PATCH 00/10] use the $( ... ) construct for command substitution Elia Pinto
` (4 preceding siblings ...)
2015-12-23 13:45 ` [PATCH 05/10] t/t5505-remote.sh: " Elia Pinto
@ 2015-12-23 13:45 ` Elia Pinto
2015-12-23 13:45 ` [PATCH 07/10] t/t5510-fetch.sh: " Elia Pinto
` (3 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: Elia Pinto @ 2015-12-23 13:45 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/t5506-remote-groups.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/t/t5506-remote-groups.sh b/t/t5506-remote-groups.sh
index 530b016..83d5558 100755
--- a/t/t5506-remote-groups.sh
+++ b/t/t5506-remote-groups.sh
@@ -20,7 +20,7 @@ update_repos() {
}
repo_fetched() {
- if test "`git log -1 --pretty=format:%s $1 --`" = "`cat mark`"; then
+ if test "$(git log -1 --pretty=format:%s $1 --)" = "$(cat mark)"; then
echo >&2 "repo was fetched: $1"
return 0
fi
--
2.3.3.GIT
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 07/10] t/t5510-fetch.sh: use the $( ... ) construct for command substitution
2015-12-23 13:45 [PATCH 00/10] use the $( ... ) construct for command substitution Elia Pinto
` (5 preceding siblings ...)
2015-12-23 13:45 ` [PATCH 06/10] t/t5506-remote-groups.sh: " Elia Pinto
@ 2015-12-23 13:45 ` Elia Pinto
2015-12-23 13:45 ` [PATCH 08/10] t/t5515-fetch-merge-logic.sh: " Elia Pinto
` (2 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: Elia Pinto @ 2015-12-23 13:45 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/t5510-fetch.sh | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh
index 0ba9db0..47e68a5 100755
--- a/t/t5510-fetch.sh
+++ b/t/t5510-fetch.sh
@@ -7,7 +7,7 @@ test_description='Per branch config variables affects "git fetch".
. ./test-lib.sh
-D=`pwd`
+D=$(pwd)
test_bundle_object_count () {
git verify-pack -v "$1" >verify.out &&
@@ -64,8 +64,8 @@ test_expect_success "fetch test" '
cd two &&
git fetch &&
test -f .git/refs/heads/one &&
- mine=`git rev-parse refs/heads/one` &&
- his=`cd ../one && git rev-parse refs/heads/master` &&
+ mine=$(git rev-parse refs/heads/one) &&
+ his=$(cd ../one && git rev-parse refs/heads/master) &&
test "z$mine" = "z$his"
'
@@ -75,8 +75,8 @@ test_expect_success "fetch test for-merge" '
git fetch &&
test -f .git/refs/heads/two &&
test -f .git/refs/heads/one &&
- master_in_two=`cd ../two && git rev-parse master` &&
- one_in_two=`cd ../two && git rev-parse one` &&
+ master_in_two=$(cd ../two && git rev-parse master) &&
+ one_in_two=$(cd ../two && git rev-parse one) &&
{
echo "$one_in_two "
echo "$master_in_two not-for-merge"
--
2.3.3.GIT
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 08/10] t/t5515-fetch-merge-logic.sh: use the $( ... ) construct for command substitution
2015-12-23 13:45 [PATCH 00/10] use the $( ... ) construct for command substitution Elia Pinto
` (6 preceding siblings ...)
2015-12-23 13:45 ` [PATCH 07/10] t/t5510-fetch.sh: " Elia Pinto
@ 2015-12-23 13:45 ` Elia Pinto
2015-12-23 13:45 ` [PATCH 09/10] t/t5516-fetch-push.sh: " Elia Pinto
2015-12-23 13:45 ` [PATCH 10/10] t/t5517-push-mirror.sh: " Elia Pinto
9 siblings, 0 replies; 11+ messages in thread
From: Elia Pinto @ 2015-12-23 13:45 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/t5515-fetch-merge-logic.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/t/t5515-fetch-merge-logic.sh b/t/t5515-fetch-merge-logic.sh
index dbb927d..36b0dbc 100755
--- a/t/t5515-fetch-merge-logic.sh
+++ b/t/t5515-fetch-merge-logic.sh
@@ -128,8 +128,8 @@ do
case "$cmd" in
'' | '#'*) continue ;;
esac
- test=`echo "$cmd" | sed -e 's|[/ ][/ ]*|_|g'`
- pfx=`printf "%04d" $test_count`
+ test=$(echo "$cmd" | sed -e 's|[/ ][/ ]*|_|g')
+ pfx=$(printf "%04d" $test_count)
expect_f="$TEST_DIRECTORY/t5515/fetch.$test"
actual_f="$pfx-fetch.$test"
expect_r="$TEST_DIRECTORY/t5515/refs.$test"
--
2.3.3.GIT
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 09/10] t/t5516-fetch-push.sh: use the $( ... ) construct for command substitution
2015-12-23 13:45 [PATCH 00/10] use the $( ... ) construct for command substitution Elia Pinto
` (7 preceding siblings ...)
2015-12-23 13:45 ` [PATCH 08/10] t/t5515-fetch-merge-logic.sh: " Elia Pinto
@ 2015-12-23 13:45 ` Elia Pinto
2015-12-23 13:45 ` [PATCH 10/10] t/t5517-push-mirror.sh: " Elia Pinto
9 siblings, 0 replies; 11+ messages in thread
From: Elia Pinto @ 2015-12-23 13:45 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/t5516-fetch-push.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/t/t5516-fetch-push.sh b/t/t5516-fetch-push.sh
index 0a87e19..26b2caf 100755
--- a/t/t5516-fetch-push.sh
+++ b/t/t5516-fetch-push.sh
@@ -16,7 +16,7 @@ This test checks the following functionality:
. ./test-lib.sh
-D=`pwd`
+D=$(pwd)
mk_empty () {
repo_name="$1"
@@ -422,7 +422,7 @@ test_expect_success 'push tag with non-existent, incomplete dest' '
test_expect_success 'push sha1 with non-existent, incomplete dest' '
mk_test testrepo &&
- test_must_fail git push testrepo `git rev-parse master`:foo
+ test_must_fail git push testrepo $(git rev-parse master):foo
'
--
2.3.3.GIT
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 10/10] t/t5517-push-mirror.sh: use the $( ... ) construct for command substitution
2015-12-23 13:45 [PATCH 00/10] use the $( ... ) construct for command substitution Elia Pinto
` (8 preceding siblings ...)
2015-12-23 13:45 ` [PATCH 09/10] t/t5516-fetch-push.sh: " Elia Pinto
@ 2015-12-23 13:45 ` Elia Pinto
9 siblings, 0 replies; 11+ messages in thread
From: Elia Pinto @ 2015-12-23 13:45 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/t5517-push-mirror.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/t/t5517-push-mirror.sh b/t/t5517-push-mirror.sh
index 12a5dfb..02f160a 100755
--- a/t/t5517-push-mirror.sh
+++ b/t/t5517-push-mirror.sh
@@ -4,7 +4,7 @@ test_description='pushing to a mirror repository'
. ./test-lib.sh
-D=`pwd`
+D=$(pwd)
invert () {
if "$@"; then
--
2.3.3.GIT
^ permalink raw reply related [flat|nested] 11+ messages in thread
end of thread, other threads:[~2015-12-23 13:46 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-23 13:45 [PATCH 00/10] use the $( ... ) construct for command substitution Elia Pinto
2015-12-23 13:45 ` [PATCH 01/10] t/t5303-pack-corruption-resilience.sh: " Elia Pinto
2015-12-23 13:45 ` [PATCH 02/10] t/t5304-prune.sh: " Elia Pinto
2015-12-23 13:45 ` [PATCH 03/10] t/t5305-include-tag.sh: " Elia Pinto
2015-12-23 13:45 ` [PATCH 04/10] t/t5500-fetch-pack.sh: " Elia Pinto
2015-12-23 13:45 ` [PATCH 05/10] t/t5505-remote.sh: " Elia Pinto
2015-12-23 13:45 ` [PATCH 06/10] t/t5506-remote-groups.sh: " Elia Pinto
2015-12-23 13:45 ` [PATCH 07/10] t/t5510-fetch.sh: " Elia Pinto
2015-12-23 13:45 ` [PATCH 08/10] t/t5515-fetch-merge-logic.sh: " Elia Pinto
2015-12-23 13:45 ` [PATCH 09/10] t/t5516-fetch-push.sh: " Elia Pinto
2015-12-23 13:45 ` [PATCH 10/10] t/t5517-push-mirror.sh: " Elia Pinto
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).