contrib/examples/git-revert.sh: use the $( ... ) construct for command substitution

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> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Elia Pinto committed Dec 22, 2015 at 15:10 UTC bc32bacc72078b92b9e9f02acec63ccc28564a01
1 file changed +4 -4
contrib/examples/git-revert.sh
+4 -4
@@ -138,8 +138,8 @@ cherry-pick)
138 }'
139
140 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")
143 eval "$set_author_env"
144 export GIT_AUTHOR_NAME
145 export GIT_AUTHOR_EMAIL
@@ -160,9 +160,9 @@ cherry-pick)
160 esac >.msg
161
162 eval GITHEAD_$head=HEAD
163 -eval GITHEAD_$next='`git show -s \
163 +eval GITHEAD_$next='$(git show -s \
164 --pretty=oneline --encoding="$encoding" "$commit" |
165 - sed -e "s/^[^ ]* //"`'
165 + sed -e "s/^[^ ]* //")'
166 export GITHEAD_$head GITHEAD_$next
167
168 # This three way merge is an interesting one. We are at