* [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; 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 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; 22+ 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] 22+ 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; 22+ 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] 22+ 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; 22+ 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] 22+ 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; 22+ 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] 22+ 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; 22+ 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] 22+ 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; 22+ 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] 22+ 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; 22+ 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] 22+ 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; 22+ 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] 22+ 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; 22+ 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] 22+ 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; 22+ 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] 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
@ 2016-01-04 9:10 Elia Pinto
2016-01-04 21:58 ` Junio C Hamano
0 siblings, 1 reply; 22+ messages in thread
From: Elia Pinto @ 2016-01-04 9:10 UTC (permalink / raw)
To: git; +Cc: Elia Pinto
This patch series continues the changes introduced with the merge
6753d8a85d543253d95184ec2faad6dc197f248:
Merge branch 'ep/shell-command-substitution'
Adjust shell scripts to use $(cmd) instead of `cmd`.
This is the fifth series, the other will be sent separately.
Elia Pinto (10):
t/t5522-pull-symlink.sh: use the $( ... ) construct for command
substitution
t/t5530-upload-pack-error.sh: use the $( ... ) construct for command
substitution
t/t5532-fetch-proxy.sh: use the $( ... ) construct for command
substitution
t/t5537-fetch-shallow.sh: use the $( ... ) construct for command
substitution
t/t5538-push-shallow.sh: use the $( ... ) construct for command
substitution
t/t5550-http-fetch-dumb.sh: use the $( ... ) construct for command
substitution
t/t5570-git-daemon.sh: use the $( ... ) construct for command
substitution
t/t5601-clone.sh: use the $( ... ) construct for command substitution
t/t5700-clone-reference.sh: use the $( ... ) construct for command
substitution
t/t5710-info-alternate.sh: use the $( ... ) construct for command
substitution
t/t5522-pull-symlink.sh | 2 +-
t/t5530-upload-pack-error.sh | 2 +-
t/t5532-fetch-proxy.sh | 4 ++--
t/t5537-fetch-shallow.sh | 4 ++--
t/t5538-push-shallow.sh | 4 ++--
t/t5550-http-fetch-dumb.sh | 8 ++++----
t/t5570-git-daemon.sh | 8 ++++----
t/t5601-clone.sh | 2 +-
t/t5700-clone-reference.sh | 2 +-
t/t5710-info-alternate.sh | 2 +-
10 files changed, 19 insertions(+), 19 deletions(-)
--
2.3.3.GIT
^ permalink raw reply [flat|nested] 22+ messages in thread
* [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 --
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
-- 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-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).