Skip to content

Commit 0e6e1a5

Browse files
committed
Merge branch 'ep/shell-command-substitution'
* ep/shell-command-substitution: t9362-mw-to-git-utf8.sh: use the $( ... ) construct for command substitution t9360-mw-to-git-clone.sh: use the $( ... ) construct for command substitution git-tag.sh: use the $( ... ) construct for command substitution git-revert.sh: use the $( ... ) construct for command substitution git-resolve.sh: use the $( ... ) construct for command substitution git-repack.sh: use the $( ... ) construct for command substitution git-merge.sh: use the $( ... ) construct for command substitution git-ls-remote.sh: use the $( ... ) construct for command substitution git-fetch.sh: use the $( ... ) construct for command substitution git-commit.sh: use the $( ... ) construct for command substitution git-clone.sh: use the $( ... ) construct for command substitution git-checkout.sh: use the $( ... ) construct for command substitution install-webdoc.sh: use the $( ... ) construct for command substitution howto-index.sh: use the $( ... ) construct for command substitution
2 parents cc29195 + bd368a9 commit 0e6e1a5

14 files changed

+48
-48
lines changed

Documentation/howto-index.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ EOF
1111

1212
for txt
1313
do
14-
title=`expr "$txt" : '.*/\(.*\)\.txt$'`
15-
from=`sed -ne '
14+
title=$(expr "$txt" : '.*/\(.*\)\.txt$')
15+
from=$(sed -ne '
1616
/^$/q
1717
/^From:[ ]/{
1818
s///
@@ -21,9 +21,9 @@ do
2121
s/^/by /
2222
p
2323
}
24-
' "$txt"`
24+
' "$txt")
2525

26-
abstract=`sed -ne '
26+
abstract=$(sed -ne '
2727
/^Abstract:[ ]/{
2828
s/^[^ ]*//
2929
x
@@ -39,11 +39,11 @@ do
3939
x
4040
p
4141
q
42-
}' "$txt"`
42+
}' "$txt")
4343

4444
if grep 'Content-type: text/asciidoc' >/dev/null $txt
4545
then
46-
file=`expr "$txt" : '\(.*\)\.txt$'`.html
46+
file=$(expr "$txt" : '\(.*\)\.txt$').html
4747
else
4848
file="$txt"
4949
fi

Documentation/install-webdoc.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,17 @@ do
1818
else
1919
echo >&2 "# install $h $T/$h"
2020
rm -f "$T/$h"
21-
mkdir -p `dirname "$T/$h"`
21+
mkdir -p $(dirname "$T/$h")
2222
cp "$h" "$T/$h"
2323
fi
2424
done
25-
strip_leading=`echo "$T/" | sed -e 's|.|.|g'`
25+
strip_leading=$(echo "$T/" | sed -e 's|.|.|g')
2626
for th in \
2727
"$T"/*.html "$T"/*.txt \
2828
"$T"/howto/*.txt "$T"/howto/*.html \
2929
"$T"/technical/*.txt "$T"/technical/*.html
3030
do
31-
h=`expr "$th" : "$strip_leading"'\(.*\)'`
31+
h=$(expr "$th" : "$strip_leading"'\(.*\)')
3232
case "$h" in
3333
RelNotes-*.txt | index.html) continue ;;
3434
esac

contrib/examples/git-checkout.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ else
222222

223223
# Match the index to the working tree, and do a three-way.
224224
git diff-files --name-only | git update-index --remove --stdin &&
225-
work=`git write-tree` &&
225+
work=$(git write-tree) &&
226226
git read-tree $v --reset -u $new || exit
227227

228228
eval GITHEAD_$new='${new_name:-${branch:-$new}}' &&
@@ -233,7 +233,7 @@ else
233233
# Do not register the cleanly merged paths in the index yet.
234234
# this is not a real merge before committing, but just carrying
235235
# the working tree changes along.
236-
unmerged=`git ls-files -u`
236+
unmerged=$(git ls-files -u)
237237
git read-tree $v --reset $new
238238
case "$unmerged" in
239239
'') ;;
@@ -269,7 +269,7 @@ if [ "$?" -eq 0 ]; then
269269
fi
270270
if test -n "$branch"
271271
then
272-
old_branch_name=`expr "z$oldbranch" : 'zrefs/heads/\(.*\)'`
272+
old_branch_name=$(expr "z$oldbranch" : 'zrefs/heads/\(.*\)')
273273
GIT_DIR="$GIT_DIR" git symbolic-ref -m "checkout: moving from ${old_branch_name:-$old} to $branch" HEAD "refs/heads/$branch"
274274
if test -n "$quiet"
275275
then
@@ -282,7 +282,7 @@ if [ "$?" -eq 0 ]; then
282282
fi
283283
elif test -n "$detached"
284284
then
285-
old_branch_name=`expr "z$oldbranch" : 'zrefs/heads/\(.*\)'`
285+
old_branch_name=$(expr "z$oldbranch" : 'zrefs/heads/\(.*\)')
286286
git update-ref --no-deref -m "checkout: moving from ${old_branch_name:-$old} to $arg" HEAD "$detached" ||
287287
die "Cannot detach HEAD"
288288
if test -n "$detach_warn"

contrib/examples/git-clone.sh

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ eval "$(echo "$OPTIONS_SPEC" | git rev-parse --parseopt -- "$@" || echo exit $?)
4040

4141
get_repo_base() {
4242
(
43-
cd "`/bin/pwd`" &&
43+
cd "$(/bin/pwd)" &&
4444
cd "$1" || cd "$1.git" &&
4545
{
4646
cd .git
@@ -50,7 +50,7 @@ get_repo_base() {
5050
}
5151

5252
if [ -n "$GIT_SSL_NO_VERIFY" -o \
53-
"`git config --bool http.sslVerify`" = false ]; then
53+
"$(git config --bool http.sslVerify)" = false ]; then
5454
curl_extra_args="-k"
5555
fi
5656

@@ -70,7 +70,7 @@ clone_dumb_http () {
7070
clone_tmp="$GIT_DIR/clone-tmp" &&
7171
mkdir -p "$clone_tmp" || exit 1
7272
if [ -n "$GIT_CURL_FTP_NO_EPSV" -o \
73-
"`git config --bool http.noEPSV`" = true ]; then
73+
"$(git config --bool http.noEPSV)" = true ]; then
7474
curl_extra_args="${curl_extra_args} --disable-epsv"
7575
fi
7676
http_fetch "$1/info/refs" "$clone_tmp/refs" ||
@@ -79,7 +79,7 @@ Perhaps git-update-server-info needs to be run there?"
7979
test "z$quiet" = z && v=-v || v=
8080
while read sha1 refname
8181
do
82-
name=`expr "z$refname" : 'zrefs/\(.*\)'` &&
82+
name=$(expr "z$refname" : 'zrefs/\(.*\)') &&
8383
case "$name" in
8484
*^*) continue;;
8585
esac
@@ -88,7 +88,7 @@ Perhaps git-update-server-info needs to be run there?"
8888
*) continue ;;
8989
esac
9090
if test -n "$use_separate_remote" &&
91-
branch_name=`expr "z$name" : 'zheads/\(.*\)'`
91+
branch_name=$(expr "z$name" : 'zheads/\(.*\)')
9292
then
9393
tname="remotes/$origin/$branch_name"
9494
else
@@ -100,7 +100,7 @@ Perhaps git-update-server-info needs to be run there?"
100100
http_fetch "$1/HEAD" "$GIT_DIR/REMOTE_HEAD" ||
101101
rm -f "$GIT_DIR/REMOTE_HEAD"
102102
if test -f "$GIT_DIR/REMOTE_HEAD"; then
103-
head_sha1=`cat "$GIT_DIR/REMOTE_HEAD"`
103+
head_sha1=$(cat "$GIT_DIR/REMOTE_HEAD")
104104
case "$head_sha1" in
105105
'ref: refs/'*)
106106
;;
@@ -444,15 +444,15 @@ then
444444
# a non-bare repository is always in separate-remote layout
445445
remote_top="refs/remotes/$origin"
446446
head_sha1=
447-
test ! -r "$GIT_DIR/REMOTE_HEAD" || head_sha1=`cat "$GIT_DIR/REMOTE_HEAD"`
447+
test ! -r "$GIT_DIR/REMOTE_HEAD" || head_sha1=$(cat "$GIT_DIR/REMOTE_HEAD")
448448
case "$head_sha1" in
449449
'ref: refs/'*)
450450
# Uh-oh, the remote told us (http transport done against
451451
# new style repository with a symref HEAD).
452452
# Ideally we should skip the guesswork but for now
453453
# opt for minimum change.
454-
head_sha1=`expr "z$head_sha1" : 'zref: refs/heads/\(.*\)'`
455-
head_sha1=`cat "$GIT_DIR/$remote_top/$head_sha1"`
454+
head_sha1=$(expr "z$head_sha1" : 'zref: refs/heads/\(.*\)')
455+
head_sha1=$(cat "$GIT_DIR/$remote_top/$head_sha1")
456456
;;
457457
esac
458458

@@ -467,7 +467,7 @@ then
467467
while read name
468468
do
469469
test t = $done && continue
470-
branch_tip=`cat "$GIT_DIR/$remote_top/$name"`
470+
branch_tip=$(cat "$GIT_DIR/$remote_top/$name")
471471
if test "$head_sha1" = "$branch_tip"
472472
then
473473
echo "$name"

contrib/examples/git-commit.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ signoff=
9191
force_author=
9292
only_include_assumed=
9393
untracked_files=
94-
templatefile="`git config commit.template`"
94+
templatefile="$(git config commit.template)"
9595
while test $# != 0
9696
do
9797
case "$1" in
@@ -350,7 +350,7 @@ t,)
350350
TMP_INDEX="$GIT_DIR/tmp-index$$"
351351
W=
352352
test -z "$initial_commit" && W=--with-tree=HEAD
353-
commit_only=`git ls-files --error-unmatch $W -- "$@"` || exit
353+
commit_only=$(git ls-files --error-unmatch $W -- "$@") || exit
354354

355355
# Build a temporary index and update the real index
356356
# the same way.
@@ -475,8 +475,8 @@ then
475475
fi
476476
if test '' != "$force_author"
477477
then
478-
GIT_AUTHOR_NAME=`expr "z$force_author" : 'z\(.*[^ ]\) *<.*'` &&
479-
GIT_AUTHOR_EMAIL=`expr "z$force_author" : '.*\(<.*\)'` &&
478+
GIT_AUTHOR_NAME=$(expr "z$force_author" : 'z\(.*[^ ]\) *<.*') &&
479+
GIT_AUTHOR_EMAIL=$(expr "z$force_author" : '.*\(<.*\)') &&
480480
test '' != "$GIT_AUTHOR_NAME" &&
481481
test '' != "$GIT_AUTHOR_EMAIL" ||
482482
die "malformed --author parameter"
@@ -489,7 +489,7 @@ then
489489
rloga='commit'
490490
if [ -f "$GIT_DIR/MERGE_HEAD" ]; then
491491
rloga='commit (merge)'
492-
PARENTS="-p HEAD "`sed -e 's/^/-p /' "$GIT_DIR/MERGE_HEAD"`
492+
PARENTS="-p HEAD "$(sed -e 's/^/-p /' "$GIT_DIR/MERGE_HEAD")
493493
elif test -n "$amend"; then
494494
rloga='commit (amend)'
495495
PARENTS=$(git cat-file commit HEAD |

contrib/examples/git-fetch.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ do
6767
keep='-k -k'
6868
;;
6969
--depth=*)
70-
shallow_depth="--depth=`expr "z$1" : 'z-[^=]*=\(.*\)'`"
70+
shallow_depth="--depth=$(expr "z$1" : 'z-[^=]*=\(.*\)')"
7171
;;
7272
--depth)
7373
shift
@@ -262,12 +262,12 @@ fetch_per_ref () {
262262
http://* | https://* | ftp://*)
263263
test -n "$shallow_depth" &&
264264
die "shallow clone with http not supported"
265-
proto=`expr "$remote" : '\([^:]*\):'`
265+
proto=$(expr "$remote" : '\([^:]*\):')
266266
if [ -n "$GIT_SSL_NO_VERIFY" ]; then
267267
curl_extra_args="-k"
268268
fi
269269
if [ -n "$GIT_CURL_FTP_NO_EPSV" -o \
270-
"`git config --bool http.noEPSV`" = true ]; then
270+
"$(git config --bool http.noEPSV)" = true ]; then
271271
noepsv_opt="--disable-epsv"
272272
fi
273273

contrib/examples/git-ls-remote.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,11 @@ tmpdir=$tmp-d
5555
case "$peek_repo" in
5656
http://* | https://* | ftp://* )
5757
if [ -n "$GIT_SSL_NO_VERIFY" -o \
58-
"`git config --bool http.sslVerify`" = false ]; then
58+
"$(git config --bool http.sslVerify)" = false ]; then
5959
curl_extra_args="-k"
6060
fi
6161
if [ -n "$GIT_CURL_FTP_NO_EPSV" -o \
62-
"`git config --bool http.noEPSV`" = true ]; then
62+
"$(git config --bool http.noEPSV)" = true ]; then
6363
curl_extra_args="${curl_extra_args} --disable-epsv"
6464
fi
6565
curl -nsf $curl_extra_args --header "Pragma: no-cache" "$peek_repo/info/refs" ||

contrib/examples/git-merge.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,15 +341,15 @@ case "$use_strategies" in
341341
'')
342342
case "$#" in
343343
1)
344-
var="`git config --get pull.twohead`"
344+
var="$(git config --get pull.twohead)"
345345
if test -n "$var"
346346
then
347347
use_strategies="$var"
348348
else
349349
use_strategies="$default_twohead_strategies"
350350
fi ;;
351351
*)
352-
var="`git config --get pull.octopus`"
352+
var="$(git config --get pull.octopus)"
353353
if test -n "$var"
354354
then
355355
use_strategies="$var"

contrib/examples/git-repack.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ do
4949
shift
5050
done
5151

52-
case "`git config --bool repack.usedeltabaseoffset || echo true`" in
52+
case "$(git config --bool repack.usedeltabaseoffset || echo true)" in
5353
true)
5454
extra="$extra --delta-base-offset" ;;
5555
esac

contrib/examples/git-resolve.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ case "$common" in
7575
GIT_INDEX_FILE=$G git read-tree -m $c $head $merge \
7676
2>/dev/null || continue
7777
# Count the paths that are unmerged.
78-
cnt=`GIT_INDEX_FILE=$G git ls-files --unmerged | wc -l`
78+
cnt=$(GIT_INDEX_FILE=$G git ls-files --unmerged | wc -l)
7979
if test $best_cnt -le 0 -o $cnt -le $best_cnt
8080
then
8181
best=$c

contrib/examples/git-revert.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ cherry-pick)
137137
q
138138
}'
139139

140-
logmsg=`git show -s --pretty=raw --encoding="$encoding" "$commit"`
140+
logmsg=$(git show -s --pretty=raw --encoding="$encoding" "$commit")
141141
set_author_env=`echo "$logmsg" |
142142
LANG=C LC_ALL=C sed -ne "$pick_author_script"`
143143
eval "$set_author_env"

contrib/examples/git-tag.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ prev=0000000000000000000000000000000000000000
156156
if git show-ref --verify --quiet -- "refs/tags/$name"
157157
then
158158
test -n "$force" || die "tag '$name' already exists"
159-
prev=`git rev-parse "refs/tags/$name"`
159+
prev=$(git rev-parse "refs/tags/$name")
160160
fi
161161
shift
162162
git check-ref-format "tags/$name" ||

contrib/mw-to-git/t/t9360-mw-to-git-clone.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -191,10 +191,10 @@ test_expect_success 'Git clone works with the shallow option' '
191191
test_path_is_file mw_dir_11/Main_Page.mw &&
192192
(
193193
cd mw_dir_11 &&
194-
test `git log --oneline Nyan.mw | wc -l` -eq 1 &&
195-
test `git log --oneline Foo.mw | wc -l` -eq 1 &&
196-
test `git log --oneline Bar.mw | wc -l` -eq 1 &&
197-
test `git log --oneline Main_Page.mw | wc -l ` -eq 1
194+
test $(git log --oneline Nyan.mw | wc -l) -eq 1 &&
195+
test $(git log --oneline Foo.mw | wc -l) -eq 1 &&
196+
test $(git log --oneline Bar.mw | wc -l) -eq 1 &&
197+
test $(git log --oneline Main_Page.mw | wc -l ) -eq 1
198198
) &&
199199
wiki_check_content mw_dir_11/Nyan.mw Nyan &&
200200
wiki_check_content mw_dir_11/Foo.mw Foo &&
@@ -218,9 +218,9 @@ test_expect_success 'Git clone works with the shallow option with a delete page'
218218
test_path_is_file mw_dir_12/Main_Page.mw &&
219219
(
220220
cd mw_dir_12 &&
221-
test `git log --oneline Nyan.mw | wc -l` -eq 1 &&
222-
test `git log --oneline Bar.mw | wc -l` -eq 1 &&
223-
test `git log --oneline Main_Page.mw | wc -l ` -eq 1
221+
test $(git log --oneline Nyan.mw | wc -l) -eq 1 &&
222+
test $(git log --oneline Bar.mw | wc -l) -eq 1 &&
223+
test $(git log --oneline Main_Page.mw | wc -l ) -eq 1
224224
) &&
225225
wiki_check_content mw_dir_12/Nyan.mw Nyan &&
226226
wiki_check_content mw_dir_12/Bar.mw Bar &&

contrib/mw-to-git/t/t9362-mw-to-git-utf8.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ test_expect_success 'The shallow option works with accents' '
7070
test_path_is_file mw_dir_4/Main_Page.mw &&
7171
(
7272
cd mw_dir_4 &&
73-
test `git log --oneline Néoà.mw | wc -l` -eq 1 &&
74-
test `git log --oneline Main_Page.mw | wc -l ` -eq 1
73+
test $(git log --oneline Néoà.mw | wc -l) -eq 1 &&
74+
test $(git log --oneline Main_Page.mw | wc -l ) -eq 1
7575
) &&
7676
wiki_check_content mw_dir_4/Néoà.mw Néoà &&
7777
wiki_check_content mw_dir_4/Main_Page.mw Main_Page

0 commit comments

Comments
 (0)