git-rebase.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 sed -i 's@`\(.*\)`@$(\1)@g' ${_f} done and then carefully proof-read. Signed-off-by: Elia Pinto <gitter.spiros@gmail.com> Reviewed-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Elia Pinto committed Apr 23, 2014 at 06:44 UTC 728fc79c0016fd7133c32f1d193d0a243e552257
1 file changed +4 -4
git-rebase.sh
+4 -4
@@ -462,8 +462,8 @@ then
462 else
463 if test -z "$onto"
464 then
465 - empty_tree=`git hash-object -t tree /dev/null`
466 - onto=`git commit-tree $empty_tree </dev/null`
465 + empty_tree=$(git hash-object -t tree /dev/null)
466 + onto=$(git commit-tree $empty_tree </dev/null)
467 squash_onto="$onto"
468 fi
469 unset upstream_name
@@ -521,10 +521,10 @@ case "$#" in
521 ;;
522 0)
523 # Do not need to switch branches, we are already on it.
524 - if branch_name=`git symbolic-ref -q HEAD`
524 + if branch_name=$(git symbolic-ref -q HEAD)
525 then
526 head_name=$branch_name
527 - branch_name=`expr "z$branch_name" : 'zrefs/heads/\(.*\)'`
527 + branch_name=$(expr "z$branch_name" : 'zrefs/heads/\(.*\)')
528 else
529 head_name="detached HEAD"
530 branch_name=HEAD ;# detached