Skip to content

Commit e572fef

Browse files
committed
Merge branch 'ep/shell-command-substitution-style'
A shell script style update to change `command substitution` into $(command substitution). Coverts contrib/ and much of the t/ directory contents. * ep/shell-command-substitution-style: (92 commits) t9901-git-web--browse.sh: use the $( ... ) construct for command substitution t9501-gitweb-standalone-http-status.sh: use the $( ... ) construct for command substitution t9350-fast-export.sh: use the $( ... ) construct for command substitution t9300-fast-import.sh: use the $( ... ) construct for command substitution t9150-svk-mergetickets.sh: use the $( ... ) construct for command substitution t9145-git-svn-master-branch.sh: use the $( ... ) construct for command substitution t9138-git-svn-authors-prog.sh: use the $( ... ) construct for command substitution t9137-git-svn-dcommit-clobber-series.sh: use the $( ... ) construct for command substitution t9132-git-svn-broken-symlink.sh: use the $( ... ) construct for command substitution t9130-git-svn-authors-file.sh: use the $( ... ) construct for command substitution t9129-git-svn-i18n-commitencoding.sh: use the $( ... ) construct for command substitution t9119-git-svn-info.sh: use the $( ... ) construct for command substitution t9118-git-svn-funky-branch-names.sh: use the $( ... ) construct for command substitution t9114-git-svn-dcommit-merge.sh: use the $( ... ) construct for command substitution t9110-git-svn-use-svm-props.sh: use the $( ... ) construct for command substitution t9109-git-svn-multi-glob.sh: use the $( ... ) construct for command substitution t9108-git-svn-glob.sh: use the $( ... ) construct for command substitution t9107-git-svn-migrate.sh: use the $( ... ) construct for command substitution t9105-git-svn-commit-diff.sh: use the $( ... ) construct for command substitution t9104-git-svn-follow-parent.sh: use the $( ... ) construct for command substitution ...
2 parents a039a79 + ec1b763 commit e572fef

File tree

91 files changed

+400
-400
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+400
-400
lines changed

contrib/examples/git-commit.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -574,10 +574,10 @@ then
574574
if test "$templatefile" != ""
575575
then
576576
# Test whether this is just the unaltered template.
577-
if cnt=`sed -e '/^#/d' < "$templatefile" |
577+
if cnt=$(sed -e '/^#/d' < "$templatefile" |
578578
git stripspace |
579579
diff "$GIT_DIR"/COMMIT_BAREMSG - |
580-
wc -l` &&
580+
wc -l) &&
581581
test 0 -lt $cnt
582582
then
583583
have_commitmsg=t
@@ -630,8 +630,8 @@ then
630630
fi
631631
if test -z "$quiet"
632632
then
633-
commit=`git diff-tree --always --shortstat --pretty="format:%h: %s"\
634-
--abbrev --summary --root HEAD --`
633+
commit=$(git diff-tree --always --shortstat --pretty="format:%h: %s"\
634+
--abbrev --summary --root HEAD --)
635635
echo "Created${initial_commit:+ initial} commit $commit"
636636
fi
637637
fi

contrib/examples/git-fetch.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,13 +146,13 @@ esac
146146
reflist=$(get_remote_refs_for_fetch "$@")
147147
if test "$tags"
148148
then
149-
taglist=`IFS=' ' &&
149+
taglist=$(IFS=' ' &&
150150
echo "$ls_remote_result" |
151151
git show-ref --exclude-existing=refs/tags/ |
152152
while read sha1 name
153153
do
154154
echo ".${name}:${name}"
155-
done` || exit
155+
done) || exit
156156
if test "$#" -gt 1
157157
then
158158
# remote URL plus explicit refspecs; we need to merge them.

contrib/examples/git-merge.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -523,10 +523,10 @@ do
523523

524524
if test "$exit" -eq 1
525525
then
526-
cnt=`{
526+
cnt=$({
527527
git diff-files --name-only
528528
git ls-files --unmerged
529-
} | wc -l`
529+
} | wc -l)
530530
if test $best_cnt -le 0 || test $cnt -le $best_cnt
531531
then
532532
best_strategy=$strategy

contrib/examples/git-repack.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ case ",$all_into_one," in
6767
,t,)
6868
args= existing=
6969
if [ -d "$PACKDIR" ]; then
70-
for e in `cd "$PACKDIR" && find . -type f -name '*.pack' \
71-
| sed -e 's/^\.\///' -e 's/\.pack$//'`
70+
for e in $(cd "$PACKDIR" && find . -type f -name '*.pack' \
71+
| sed -e 's/^\.\///' -e 's/\.pack$//')
7272
do
7373
if [ -e "$PACKDIR/$e.keep" ]; then
7474
: keep

contrib/examples/git-revert.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,8 @@ cherry-pick)
138138
}'
139139

140140
logmsg=$(git show -s --pretty=raw --encoding="$encoding" "$commit")
141-
set_author_env=`echo "$logmsg" |
142-
LANG=C LC_ALL=C sed -ne "$pick_author_script"`
141+
set_author_env=$(echo "$logmsg" |
142+
LANG=C LC_ALL=C sed -ne "$pick_author_script")
143143
eval "$set_author_env"
144144
export GIT_AUTHOR_NAME
145145
export GIT_AUTHOR_EMAIL
@@ -160,9 +160,9 @@ cherry-pick)
160160
esac >.msg
161161

162162
eval GITHEAD_$head=HEAD
163-
eval GITHEAD_$next='`git show -s \
163+
eval GITHEAD_$next='$(git show -s \
164164
--pretty=oneline --encoding="$encoding" "$commit" |
165-
sed -e "s/^[^ ]* //"`'
165+
sed -e "s/^[^ ]* //")'
166166
export GITHEAD_$head GITHEAD_$next
167167

168168
# This three way merge is an interesting one. We are at

contrib/thunderbird-patch-inline/appp.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ BODY=$(sed -e "1,/${SEP}/d" $1)
3131
CMT_MSG=$(sed -e '1,/^$/d' -e '/^---$/,$d' "${PATCH}")
3232
DIFF=$(sed -e '1,/^---$/d' "${PATCH}")
3333

34-
CCS=`echo -e "$CMT_MSG\n$HEADERS" | sed -n -e 's/^Cc: \(.*\)$/\1,/gp' \
35-
-e 's/^Signed-off-by: \(.*\)/\1,/gp'`
34+
CCS=$(echo -e "$CMT_MSG\n$HEADERS" | sed -n -e 's/^Cc: \(.*\)$/\1,/gp' \
35+
-e 's/^Signed-off-by: \(.*\)/\1,/gp')
3636

3737
echo "$SUBJECT" > $1
3838
echo "Cc: $CCS" >> $1

git-gui/po/glossary/txt-to-pot.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
if [ $# -eq 0 ]
1212
then
1313
cat <<!
14-
Usage: `basename $0` git-gui-glossary.txt > git-gui-glossary.pot
14+
Usage: $(basename $0) git-gui-glossary.txt > git-gui-glossary.pot
1515
!
1616
exit 1;
1717
fi
@@ -33,7 +33,7 @@ cat <<!
3333
msgid ""
3434
msgstr ""
3535
"Project-Id-Version: PACKAGE VERSION\n"
36-
"POT-Creation-Date: `date +'%Y-%m-%d %H:%M%z'`\n"
36+
"POT-Creation-Date: $(date +'%Y-%m-%d %H:%M%z')\n"
3737
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
3838
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
3939
"Language-Team: LANGUAGE <[email protected]>\n"

t/lib-httpd.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ then
9898
test_skip_or_die $GIT_TEST_HTTPD "no web server found at '$LIB_HTTPD_PATH'"
9999
fi
100100

101-
HTTPD_VERSION=`$LIB_HTTPD_PATH -v | \
102-
sed -n 's/^Server version: Apache\/\([0-9]*\)\..*$/\1/p; q'`
101+
HTTPD_VERSION=$($LIB_HTTPD_PATH -v | \
102+
sed -n 's/^Server version: Apache\/\([0-9]*\)\..*$/\1/p; q')
103103

104104
if test -n "$HTTPD_VERSION"
105105
then

t/t1100-commit-tree-options.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ test_expect_success \
3535
GIT_COMMITTER_NAME="Committer Name" \
3636
GIT_COMMITTER_EMAIL="committer@email" \
3737
GIT_COMMITTER_DATE="2005-05-26 23:30" \
38-
TZ=GMT git commit-tree `cat treeid` >commitid 2>/dev/null'
38+
TZ=GMT git commit-tree $(cat treeid) >commitid 2>/dev/null'
3939

4040
test_expect_success \
4141
'read commit' \
42-
'git cat-file commit `cat commitid` >commit'
42+
'git cat-file commit $(cat commitid) >commit'
4343

4444
test_expect_success \
4545
'compare commit' \

t/t1401-symbolic-ref.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ reset_to_sane
2929

3030
test_expect_success 'symbolic-ref refuses bare sha1' '
3131
echo content >file && git add file && git commit -m one &&
32-
test_must_fail git symbolic-ref HEAD `git rev-parse HEAD`
32+
test_must_fail git symbolic-ref HEAD $(git rev-parse HEAD)
3333
'
3434
reset_to_sane
3535

0 commit comments

Comments
 (0)