From 9bfeaa0bcf2d7150836b583196e18f973c3be17f Mon Sep 17 00:00:00 2001 From: Elia Pinto Date: Wed, 23 Apr 2014 06:43:53 -0700 Subject: [PATCH 01/41] t9365-continuing-queries.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 Reviewed-by: Matthieu Moy Signed-off-by: Junio C Hamano --- contrib/mw-to-git/t/t9365-continuing-queries.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/mw-to-git/t/t9365-continuing-queries.sh b/contrib/mw-to-git/t/t9365-continuing-queries.sh index 27e267f532..016454749f 100755 --- a/contrib/mw-to-git/t/t9365-continuing-queries.sh +++ b/contrib/mw-to-git/t/t9365-continuing-queries.sh @@ -9,7 +9,7 @@ test_check_precond test_expect_success 'creating page w/ >500 revisions' ' wiki_reset && - for i in `test_seq 501` + for i in $(test_seq 501) do echo "creating revision $i" && wiki_editpage foo "revision $i
" true From 0eca37c63a1e03e4f33366157eb406c8182bf0e9 Mon Sep 17 00:00:00 2001 From: Elia Pinto Date: Wed, 23 Apr 2014 06:43:54 -0700 Subject: [PATCH 02/41] test-gitmw-lib.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 Reviewed-by: Matthieu Moy Signed-off-by: Junio C Hamano --- contrib/mw-to-git/t/test-gitmw-lib.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/contrib/mw-to-git/t/test-gitmw-lib.sh b/contrib/mw-to-git/t/test-gitmw-lib.sh index 3372b2af34..c783752e02 100755 --- a/contrib/mw-to-git/t/test-gitmw-lib.sh +++ b/contrib/mw-to-git/t/test-gitmw-lib.sh @@ -90,7 +90,7 @@ test_diff_directories () { # # Check that contains exactly files test_contains_N_files () { - if test `ls -- "$1" | wc -l` -ne "$2"; then + if test $(ls -- "$1" | wc -l) -ne "$2"; then echo "directory $1 should contain $2 files" echo "it contains these files:" ls "$1" @@ -341,10 +341,10 @@ wiki_install () { "http://download.wikimedia.org/mediawiki/$MW_VERSION_MAJOR/"\ "$MW_FILENAME. "\ "Please fix your connection and launch the script again." - echo "$MW_FILENAME downloaded in `pwd`. "\ + echo "$MW_FILENAME downloaded in $(pwd). "\ "You can delete it later if you want." else - echo "Reusing existing $MW_FILENAME downloaded in `pwd`." + echo "Reusing existing $MW_FILENAME downloaded in $(pwd)." fi archive_abs_path=$(pwd)/$MW_FILENAME cd "$WIKI_DIR_INST/$WIKI_DIR_NAME/" || From 5c00acdd25b0b214e511fa35faaff8595467c480 Mon Sep 17 00:00:00 2001 From: Elia Pinto Date: Wed, 23 Apr 2014 06:43:55 -0700 Subject: [PATCH 03/41] t7900-subtree.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 Reviewed-by: Matthieu Moy Signed-off-by: Junio C Hamano --- contrib/subtree/t/t7900-subtree.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/subtree/t/t7900-subtree.sh b/contrib/subtree/t/t7900-subtree.sh index 66ce4b07c2..b22b710c26 100755 --- a/contrib/subtree/t/t7900-subtree.sh +++ b/contrib/subtree/t/t7900-subtree.sh @@ -76,7 +76,7 @@ test_expect_success 'add sub1' ' # Save this hash for testing later. -subdir_hash=`git rev-parse HEAD` +subdir_hash=$(git rev-parse HEAD) test_expect_success 'add sub2' ' create sub2 && From faf58f4ee6a5599c3b8790b770d6e1736174b7a3 Mon Sep 17 00:00:00 2001 From: Elia Pinto Date: Wed, 23 Apr 2014 06:43:56 -0700 Subject: [PATCH 04/41] appp.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 Reviewed-by: Matthieu Moy Signed-off-by: Junio C Hamano --- contrib/thunderbird-patch-inline/appp.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/contrib/thunderbird-patch-inline/appp.sh b/contrib/thunderbird-patch-inline/appp.sh index 5eb4a51643..8dc73ece15 100755 --- a/contrib/thunderbird-patch-inline/appp.sh +++ b/contrib/thunderbird-patch-inline/appp.sh @@ -10,7 +10,7 @@ CONFFILE=~/.appprc SEP="-=-=-=-=-=-=-=-=-=# Don't remove this line #=-=-=-=-=-=-=-=-=-" if [ -e "$CONFFILE" ] ; then - LAST_DIR=`grep -m 1 "^LAST_DIR=" "${CONFFILE}"|sed -e 's/^LAST_DIR=//'` + LAST_DIR=$(grep -m 1 "^LAST_DIR=" "${CONFFILE}"|sed -e 's/^LAST_DIR=//') cd "${LAST_DIR}" else cd > /dev/null @@ -25,11 +25,11 @@ fi cd - > /dev/null -SUBJECT=`sed -n -e '/^Subject: /p' "${PATCH}"` -HEADERS=`sed -e '/^'"${SEP}"'$/,$d' $1` -BODY=`sed -e "1,/${SEP}/d" $1` -CMT_MSG=`sed -e '1,/^$/d' -e '/^---$/,$d' "${PATCH}"` -DIFF=`sed -e '1,/^---$/d' "${PATCH}"` +SUBJECT=$(sed -n -e '/^Subject: /p' "${PATCH}") +HEADERS=$(sed -e '/^'"${SEP}"'$/,$d' $1) +BODY=$(sed -e "1,/${SEP}/d" $1) +CMT_MSG=$(sed -e '1,/^$/d' -e '/^---$/,$d' "${PATCH}") +DIFF=$(sed -e '1,/^---$/d' "${PATCH}") CCS=`echo -e "$CMT_MSG\n$HEADERS" | sed -n -e 's/^Cc: \(.*\)$/\1,/gp' \ -e 's/^Signed-off-by: \(.*\)/\1,/gp'` @@ -48,7 +48,7 @@ if [ "x${BODY}x" != "xx" ] ; then fi echo "$DIFF" >> $1 -LAST_DIR=`dirname "${PATCH}"` +LAST_DIR=$(dirname "${PATCH}") grep -v "^LAST_DIR=" "${CONFFILE}" > "${CONFFILE}_" echo "LAST_DIR=${LAST_DIR}" >> "${CONFFILE}_" From eadf619cd434135bdfa598566376b3e3dbf9f2b5 Mon Sep 17 00:00:00 2001 From: Elia Pinto Date: Wed, 23 Apr 2014 06:43:58 -0700 Subject: [PATCH 05/41] git-pull.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 Reviewed-by: Matthieu Moy Signed-off-by: Junio C Hamano --- git-pull.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-pull.sh b/git-pull.sh index 6cd8ebc534..cfc589dc15 100755 --- a/git-pull.sh +++ b/git-pull.sh @@ -108,7 +108,7 @@ do -s|--s|--st|--str|--stra|--strat|--strate|--strateg|--strategy) case "$#,$1" in *,*=*) - strategy=`expr "z$1" : 'z-[^=]*=\(.*\)'` ;; + strategy=$(expr "z$1" : 'z-[^=]*=\(.*\)') ;; 1,*) usage ;; *) From f257482c9ccbb27e70f190da6a8152469b0fed1b Mon Sep 17 00:00:00 2001 From: Elia Pinto Date: Wed, 23 Apr 2014 06:43:59 -0700 Subject: [PATCH 06/41] git-rebase--merge.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 Reviewed-by: Matthieu Moy Signed-off-by: Junio C Hamano --- git-rebase--merge.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/git-rebase--merge.sh b/git-rebase--merge.sh index 5381857c59..dc064f82b6 100644 --- a/git-rebase--merge.sh +++ b/git-rebase--merge.sh @@ -24,7 +24,7 @@ continue_merge () { die "$resolvemsg" fi - cmt=`cat "$state_dir/current"` + cmt=$(cat "$state_dir/current") if ! git diff-index --quiet --ignore-submodules HEAD -- then if ! git commit ${gpg_sign_opt:+"$gpg_sign_opt"} --no-verify -C "$cmt" @@ -132,7 +132,7 @@ echo "$onto_name" > "$state_dir/onto_name" write_basic_state msgnum=0 -for cmt in `git rev-list --reverse --no-merges "$revisions"` +for cmt in $(git rev-list --reverse --no-merges "$revisions") do msgnum=$(($msgnum + 1)) echo "$cmt" > "$state_dir/cmt.$msgnum" From 728fc79c0016fd7133c32f1d193d0a243e552257 Mon Sep 17 00:00:00 2001 From: Elia Pinto Date: Wed, 23 Apr 2014 06:44:00 -0700 Subject: [PATCH 07/41] 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 Reviewed-by: Matthieu Moy Signed-off-by: Junio C Hamano --- git-rebase.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/git-rebase.sh b/git-rebase.sh index 5f6732bf3d..a209ab9ce4 100755 --- a/git-rebase.sh +++ b/git-rebase.sh @@ -462,8 +462,8 @@ then else if test -z "$onto" then - empty_tree=`git hash-object -t tree /dev/null` - onto=`git commit-tree $empty_tree Date: Wed, 23 Apr 2014 06:44:01 -0700 Subject: [PATCH 08/41] git-stash.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 Reviewed-by: Matthieu Moy Signed-off-by: Junio C Hamano --- git-stash.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-stash.sh b/git-stash.sh index 4798bcf0e5..af549c7317 100755 --- a/git-stash.sh +++ b/git-stash.sh @@ -13,7 +13,7 @@ USAGE="list [] SUBDIRECTORY_OK=Yes OPTIONS_SPEC= -START_DIR=`pwd` +START_DIR=$(pwd) . git-sh-setup . git-sh-i18n require_work_tree From 9e5878fbede57c0499133adf73844261849cd7b2 Mon Sep 17 00:00:00 2001 From: Elia Pinto Date: Wed, 23 Apr 2014 06:44:02 -0700 Subject: [PATCH 09/41] git-web--browse.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 Reviewed-by: Matthieu Moy Signed-off-by: Junio C Hamano --- git-web--browse.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/git-web--browse.sh b/git-web--browse.sh index ebdfba6c94..ae152534f5 100755 --- a/git-web--browse.sh +++ b/git-web--browse.sh @@ -59,7 +59,7 @@ do -b|--browser*|-t|--tool*) case "$#,$1" in *,*=*) - browser=`expr "z$1" : 'z-[^=]*=\(.*\)'` + browser=$(expr "z$1" : 'z-[^=]*=\(.*\)') ;; 1,*) usage ;; @@ -71,7 +71,7 @@ do -c|--config*) case "$#,$1" in *,*=*) - conf=`expr "z$1" : 'z-[^=]*=\(.*\)'` + conf=$(expr "z$1" : 'z-[^=]*=\(.*\)') ;; 1,*) usage ;; @@ -100,7 +100,7 @@ then for opt in "$conf" "web.browser" do test -z "$opt" && continue - browser="`git config $opt`" + browser="$(git config $opt)" test -z "$browser" || break done if test -n "$browser" && ! valid_tool "$browser"; then From 5a4352024ae71613186730e3a3ab670f43904ad6 Mon Sep 17 00:00:00 2001 From: Elia Pinto Date: Wed, 23 Apr 2014 06:44:03 -0700 Subject: [PATCH 10/41] lib-credential.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 Reviewed-by: Matthieu Moy Signed-off-by: Junio C Hamano --- t/lib-credential.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/lib-credential.sh b/t/lib-credential.sh index 957ae936e8..9e7d7962b0 100755 --- a/t/lib-credential.sh +++ b/t/lib-credential.sh @@ -281,7 +281,7 @@ helper_test_timeout() { cat >askpass <<\EOF #!/bin/sh echo >&2 askpass: $* -what=`echo $1 | cut -d" " -f1 | tr A-Z a-z | tr -cd a-z` +what=$(echo $1 | cut -d" " -f1 | tr A-Z a-z | tr -cd a-z) echo "askpass-$what" EOF chmod +x askpass From 03db917867bfd27c7a1f8e5b713d7bd7d3f6370e Mon Sep 17 00:00:00 2001 From: Elia Pinto Date: Wed, 23 Apr 2014 06:44:04 -0700 Subject: [PATCH 11/41] lib-cvs.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 Reviewed-by: Matthieu Moy Signed-off-by: Junio C Hamano --- t/lib-cvs.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/lib-cvs.sh b/t/lib-cvs.sh index 5076718916..9b2bcfb1b0 100644 --- a/t/lib-cvs.sh +++ b/t/lib-cvs.sh @@ -13,7 +13,7 @@ fi CVS="cvs -f" export CVS -cvsps_version=`cvsps -h 2>&1 | sed -ne 's/cvsps version //p'` +cvsps_version=$(cvsps -h 2>&1 | sed -ne 's/cvsps version //p') case "$cvsps_version" in 2.1 | 2.2*) ;; From be194d53c0ce38ab3e040c6be249550fab4e8e1c Mon Sep 17 00:00:00 2001 From: Elia Pinto Date: Wed, 23 Apr 2014 06:44:05 -0700 Subject: [PATCH 12/41] lib-gpg.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 Reviewed-by: Matthieu Moy Signed-off-by: Junio C Hamano --- t/lib-gpg.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/lib-gpg.sh b/t/lib-gpg.sh index 05824fa8e4..fd499e7c49 100755 --- a/t/lib-gpg.sh +++ b/t/lib-gpg.sh @@ -1,6 +1,6 @@ #!/bin/sh -gpg_version=`gpg --version 2>&1` +gpg_version=$(gpg --version 2>&1) if test $? = 127; then say "You do not seem to have gpg installed" else From 4717659144984c7fbfd2c01a2c22f342756e2abd Mon Sep 17 00:00:00 2001 From: Elia Pinto Date: Wed, 23 Apr 2014 06:44:06 -0700 Subject: [PATCH 13/41] p5302-pack-index.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 Reviewed-by: Matthieu Moy Signed-off-by: Junio C Hamano --- t/perf/p5302-pack-index.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/perf/p5302-pack-index.sh b/t/perf/p5302-pack-index.sh index 6cb5b0d55b..5ee9211f98 100755 --- a/t/perf/p5302-pack-index.sh +++ b/t/perf/p5302-pack-index.sh @@ -8,7 +8,7 @@ test_perf_large_repo test_expect_success 'repack' ' git repack -ad && - PACK=`ls .git/objects/pack/*.pack | head -n1` && + PACK=$(ls .git/objects/pack/*.pack | head -n1) && test -f "$PACK" && export PACK ' From 88619b3ee4bd21254d3306b12f47be3f0d9ad04b Mon Sep 17 00:00:00 2001 From: Elia Pinto Date: Mon, 28 Apr 2014 05:57:24 -0700 Subject: [PATCH 14/41] t0001-init.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 Reviewed-by: Matthieu Moy Signed-off-by: Junio C Hamano --- t/t0001-init.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/t/t0001-init.sh b/t/t0001-init.sh index 9fb582b192..32821fe450 100755 --- a/t/t0001-init.sh +++ b/t/t0001-init.sh @@ -250,7 +250,7 @@ test_expect_success 'init --bare/--shared overrides system/global config' ' ) && check_config init-bare-shared-override true unset && test x0666 = \ - x`git config -f init-bare-shared-override/config core.sharedRepository` + x$(git config -f init-bare-shared-override/config core.sharedRepository) ' test_expect_success 'init honors global core.sharedRepository' ' @@ -262,7 +262,7 @@ test_expect_success 'init honors global core.sharedRepository' ' git init ) && test x0666 = \ - x`git config -f shared-honor-global/.git/config core.sharedRepository` + x$(git config -f shared-honor-global/.git/config core.sharedRepository) ' test_expect_success 'init rejects insanely long --template' ' @@ -374,7 +374,7 @@ test_expect_success 'init prefers command line to GIT_DIR' ' test_expect_success 'init with separate gitdir' ' rm -rf newdir && git init --separate-git-dir realgitdir newdir && - echo "gitdir: `pwd`/realgitdir" >expected && + echo "gitdir: $(pwd)/realgitdir" >expected && test_cmp expected newdir/.git && test -d realgitdir/refs ' @@ -388,7 +388,7 @@ test_expect_success 're-init to update git link' ' cd newdir && git init --separate-git-dir ../surrealgitdir ) && - echo "gitdir: `pwd`/surrealgitdir" >expected && + echo "gitdir: $(pwd)/surrealgitdir" >expected && test_cmp expected newdir/.git && test -d surrealgitdir/refs && ! test -d realgitdir/refs @@ -401,7 +401,7 @@ test_expect_success 're-init to move gitdir' ' cd newdir && git init --separate-git-dir ../realgitdir ) && - echo "gitdir: `pwd`/realgitdir" >expected && + echo "gitdir: $(pwd)/realgitdir" >expected && test_cmp expected newdir/.git && test -d realgitdir/refs ' @@ -415,7 +415,7 @@ test_expect_success SYMLINKS 're-init to move gitdir symlink' ' ln -s here .git && git init --separate-git-dir ../realgitdir ) && - echo "gitdir: `pwd`/realgitdir" >expected && + echo "gitdir: $(pwd)/realgitdir" >expected && test_cmp expected newdir/.git && test -d realgitdir/refs && ! test -d newdir/here From 8fc5593c53218d19c7a0bac34debeaf6328e4f62 Mon Sep 17 00:00:00 2001 From: Elia Pinto Date: Mon, 28 Apr 2014 05:57:25 -0700 Subject: [PATCH 15/41] t0010-racy-git.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 Reviewed-by: Matthieu Moy Signed-off-by: Junio C Hamano --- t/t0010-racy-git.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/t/t0010-racy-git.sh b/t/t0010-racy-git.sh index e45a9e40e4..5657c5a87b 100755 --- a/t/t0010-racy-git.sh +++ b/t/t0010-racy-git.sh @@ -14,7 +14,7 @@ do git update-index --add infocom echo xyzzy >infocom - files=`git diff-files -p` + files=$(git diff-files -p) test_expect_success \ "Racy GIT trial #$trial part A" \ 'test "" != "$files"' @@ -23,7 +23,7 @@ do echo xyzzy >cornerstone git update-index --add cornerstone - files=`git diff-files -p` + files=$(git diff-files -p) test_expect_success \ "Racy GIT trial #$trial part B" \ 'test "" != "$files"' From def226bdbb53d32f6c3f6bb66cfe1810089033df Mon Sep 17 00:00:00 2001 From: Elia Pinto Date: Mon, 28 Apr 2014 05:57:26 -0700 Subject: [PATCH 16/41] t0020-crlf.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 Reviewed-by: Matthieu Moy Signed-off-by: Junio C Hamano --- t/t0020-crlf.sh | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/t/t0020-crlf.sh b/t/t0020-crlf.sh index e526184a0b..d2e51a81bc 100755 --- a/t/t0020-crlf.sh +++ b/t/t0020-crlf.sh @@ -20,14 +20,14 @@ test_expect_success setup ' git commit -m initial && - one=`git rev-parse HEAD:one` && - dir=`git rev-parse HEAD:dir` && - two=`git rev-parse HEAD:dir/two` && - three=`git rev-parse HEAD:three` && + one=$(git rev-parse HEAD:one) && + dir=$(git rev-parse HEAD:dir) && + two=$(git rev-parse HEAD:dir/two) && + three=$(git rev-parse HEAD:three) && for w in Some extra lines here; do echo $w; done >>one && git diff >patch.file && - patched=`git hash-object --stdin Date: Mon, 28 Apr 2014 05:57:27 -0700 Subject: [PATCH 17/41] t0025-crlf-auto.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 Reviewed-by: Matthieu Moy Signed-off-by: Junio C Hamano --- t/t0025-crlf-auto.sh | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/t/t0025-crlf-auto.sh b/t/t0025-crlf-auto.sh index f5f67a6337..b0e5694ebd 100755 --- a/t/t0025-crlf-auto.sh +++ b/t/t0025-crlf-auto.sh @@ -19,9 +19,9 @@ test_expect_success setup ' git commit -m initial && - one=`git rev-parse HEAD:one` && - two=`git rev-parse HEAD:two` && - three=`git rev-parse HEAD:three` && + one=$(git rev-parse HEAD:one) && + two=$(git rev-parse HEAD:two) && + three=$(git rev-parse HEAD:three) && echo happy. ' @@ -33,9 +33,9 @@ test_expect_success 'default settings cause no changes' ' ! has_cr one && has_cr two && - onediff=`git diff one` && - twodiff=`git diff two` && - threediff=`git diff three` && + onediff=$(git diff one) && + twodiff=$(git diff two) && + threediff=$(git diff three) && test -z "$onediff" -a -z "$twodiff" -a -z "$threediff" ' @@ -48,7 +48,7 @@ test_expect_success 'crlf=true causes a CRLF file to be normalized' ' # Note, "normalized" means that git will normalize it if added has_cr two && - twodiff=`git diff two` && + twodiff=$(git diff two) && test -n "$twodiff" ' @@ -60,7 +60,7 @@ test_expect_success 'text=true causes a CRLF file to be normalized' ' # Note, "normalized" means that git will normalize it if added has_cr two && - twodiff=`git diff two` && + twodiff=$(git diff two) && test -n "$twodiff" ' @@ -72,7 +72,7 @@ test_expect_success 'eol=crlf gives a normalized file CRLFs with autocrlf=false' git read-tree --reset -u HEAD && has_cr one && - onediff=`git diff one` && + onediff=$(git diff one) && test -z "$onediff" ' @@ -84,7 +84,7 @@ test_expect_success 'eol=crlf gives a normalized file CRLFs with autocrlf=input' git read-tree --reset -u HEAD && has_cr one && - onediff=`git diff one` && + onediff=$(git diff one) && test -z "$onediff" ' @@ -96,7 +96,7 @@ test_expect_success 'eol=lf gives a normalized file LFs with autocrlf=true' ' git read-tree --reset -u HEAD && ! has_cr one && - onediff=`git diff one` && + onediff=$(git diff one) && test -z "$onediff" ' @@ -108,9 +108,9 @@ test_expect_success 'autocrlf=true does not normalize CRLF files' ' has_cr one && has_cr two && - onediff=`git diff one` && - twodiff=`git diff two` && - threediff=`git diff three` && + onediff=$(git diff one) && + twodiff=$(git diff two) && + threediff=$(git diff three) && test -z "$onediff" -a -z "$twodiff" -a -z "$threediff" ' @@ -123,9 +123,9 @@ test_expect_success 'text=auto, autocrlf=true _does_ normalize CRLF files' ' has_cr one && has_cr two && - onediff=`git diff one` && - twodiff=`git diff two` && - threediff=`git diff three` && + onediff=$(git diff one) && + twodiff=$(git diff two) && + threediff=$(git diff three) && test -z "$onediff" -a -n "$twodiff" -a -z "$threediff" ' @@ -137,7 +137,7 @@ test_expect_success 'text=auto, autocrlf=true does not normalize binary files' ' git read-tree --reset -u HEAD && ! has_cr three && - threediff=`git diff three` && + threediff=$(git diff three) && test -z "$threediff" ' @@ -148,7 +148,7 @@ test_expect_success 'eol=crlf _does_ normalize binary files' ' git read-tree --reset -u HEAD && has_cr three && - threediff=`git diff three` && + threediff=$(git diff three) && test -z "$threediff" ' From 8deeab4a2413868b44fda4a0d0c56d2a7c45c6be Mon Sep 17 00:00:00 2001 From: Elia Pinto Date: Mon, 28 Apr 2014 05:57:28 -0700 Subject: [PATCH 18/41] t0026-eol-config.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 Reviewed-by: Matthieu Moy Signed-off-by: Junio C Hamano --- t/t0026-eol-config.sh | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/t/t0026-eol-config.sh b/t/t0026-eol-config.sh index fe0164be62..e1126aa7cc 100755 --- a/t/t0026-eol-config.sh +++ b/t/t0026-eol-config.sh @@ -20,8 +20,8 @@ test_expect_success setup ' git commit -m initial && - one=`git rev-parse HEAD:one` && - two=`git rev-parse HEAD:two` && + one=$(git rev-parse HEAD:one) && + two=$(git rev-parse HEAD:two) && echo happy. ' @@ -34,8 +34,8 @@ test_expect_success 'eol=lf puts LFs in normalized file' ' ! has_cr one && ! has_cr two && - onediff=`git diff one` && - twodiff=`git diff two` && + onediff=$(git diff one) && + twodiff=$(git diff two) && test -z "$onediff" -a -z "$twodiff" ' @@ -47,8 +47,8 @@ test_expect_success 'eol=crlf puts CRLFs in normalized file' ' has_cr one && ! has_cr two && - onediff=`git diff one` && - twodiff=`git diff two` && + onediff=$(git diff one) && + twodiff=$(git diff two) && test -z "$onediff" -a -z "$twodiff" ' @@ -61,8 +61,8 @@ test_expect_success 'autocrlf=true overrides eol=lf' ' has_cr one && has_cr two && - onediff=`git diff one` && - twodiff=`git diff two` && + onediff=$(git diff one) && + twodiff=$(git diff two) && test -z "$onediff" -a -z "$twodiff" ' @@ -75,8 +75,8 @@ test_expect_success 'autocrlf=true overrides unset eol' ' has_cr one && has_cr two && - onediff=`git diff one` && - twodiff=`git diff two` && + onediff=$(git diff one) && + twodiff=$(git diff two) && test -z "$onediff" -a -z "$twodiff" ' From 4d713567f9e79f738e7b309ad0222e1517871f9c Mon Sep 17 00:00:00 2001 From: Elia Pinto Date: Mon, 28 Apr 2014 05:57:29 -0700 Subject: [PATCH 19/41] t0030-stripspace.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 Reviewed-by: Matthieu Moy Signed-off-by: Junio C Hamano --- t/t0030-stripspace.sh | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/t/t0030-stripspace.sh b/t/t0030-stripspace.sh index a8e84d8546..0333dd9875 100755 --- a/t/t0030-stripspace.sh +++ b/t/t0030-stripspace.sh @@ -225,22 +225,22 @@ test_expect_success \ test_expect_success \ 'text without newline at end should end with newline' ' - test `printf "$ttt" | git stripspace | wc -l` -gt 0 && - test `printf "$ttt$ttt" | git stripspace | wc -l` -gt 0 && - test `printf "$ttt$ttt$ttt" | git stripspace | wc -l` -gt 0 && - test `printf "$ttt$ttt$ttt$ttt" | git stripspace | wc -l` -gt 0 + test $(printf "$ttt" | git stripspace | wc -l) -gt 0 && + test $(printf "$ttt$ttt" | git stripspace | wc -l) -gt 0 && + test $(printf "$ttt$ttt$ttt" | git stripspace | wc -l) -gt 0 && + test $(printf "$ttt$ttt$ttt$ttt" | git stripspace | wc -l) -gt 0 ' # text plus spaces at the end: test_expect_success \ 'text plus spaces without newline at end should end with newline' ' - test `printf "$ttt$sss" | git stripspace | wc -l` -gt 0 && - test `printf "$ttt$ttt$sss" | git stripspace | wc -l` -gt 0 && - test `printf "$ttt$ttt$ttt$sss" | git stripspace | wc -l` -gt 0 && - test `printf "$ttt$sss$sss" | git stripspace | wc -l` -gt 0 && - test `printf "$ttt$ttt$sss$sss" | git stripspace | wc -l` -gt 0 && - test `printf "$ttt$sss$sss$sss" | git stripspace | wc -l` -gt 0 + test $(printf "$ttt$sss" | git stripspace | wc -l) -gt 0 && + test $(printf "$ttt$ttt$sss" | git stripspace | wc -l) -gt 0 && + test $(printf "$ttt$ttt$ttt$sss" | git stripspace | wc -l) -gt 0 && + test $(printf "$ttt$sss$sss" | git stripspace | wc -l) -gt 0 && + test $(printf "$ttt$ttt$sss$sss" | git stripspace | wc -l) -gt 0 && + test $(printf "$ttt$sss$sss$sss" | git stripspace | wc -l) -gt 0 ' test_expect_success \ From dd64267fe2151b1ea3f19b5745d0fa8321995381 Mon Sep 17 00:00:00 2001 From: Elia Pinto Date: Mon, 28 Apr 2014 05:57:30 -0700 Subject: [PATCH 20/41] t0300-credentials.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 Reviewed-by: Matthieu Moy Signed-off-by: Junio C Hamano --- t/t0300-credentials.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/t0300-credentials.sh b/t/t0300-credentials.sh index 538ea5fb1c..57ea5a10c5 100755 --- a/t/t0300-credentials.sh +++ b/t/t0300-credentials.sh @@ -6,7 +6,7 @@ test_description='basic credential helper tests' test_expect_success 'setup helper scripts' ' cat >dump <<-\EOF && - whoami=`echo $0 | sed s/.*git-credential-//` + whoami=$(echo $0 | sed s/.*git-credential-//) echo >&2 "$whoami: $*" OIFS=$IFS IFS== From 86e30432177470f50be4207da2cc0422f86a24f7 Mon Sep 17 00:00:00 2001 From: Elia Pinto Date: Mon, 28 Apr 2014 05:57:31 -0700 Subject: [PATCH 21/41] t1000-read-tree-m-3way.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 Reviewed-by: Matthieu Moy Signed-off-by: Junio C Hamano --- t/t1000-read-tree-m-3way.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/t/t1000-read-tree-m-3way.sh b/t/t1000-read-tree-m-3way.sh index babcdd2343..a0b79b4839 100755 --- a/t/t1000-read-tree-m-3way.sh +++ b/t/t1000-read-tree-m-3way.sh @@ -519,10 +519,10 @@ test_expect_success \ 'rm -f .git/index F16 && echo F16 >F16 && git update-index --add F16 && - tree0=`git write-tree` && + tree0=$(git write-tree) && echo E16 >F16 && git update-index F16 && - tree1=`git write-tree` && + tree1=$(git write-tree) && read_tree_must_succeed -m $tree0 $tree1 $tree1 $tree0 && git ls-files --stage' From 142efa3e43e9c61cb5b97dbe69d36ca090d683d5 Mon Sep 17 00:00:00 2001 From: Elia Pinto Date: Mon, 28 Apr 2014 05:57:32 -0700 Subject: [PATCH 22/41] t1001-read-tree-m-2way.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 Reviewed-by: Matthieu Moy Signed-off-by: Junio C Hamano --- t/t1001-read-tree-m-2way.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/t/t1001-read-tree-m-2way.sh b/t/t1001-read-tree-m-2way.sh index acaab07fac..f0d8eb91b4 100755 --- a/t/t1001-read-tree-m-2way.sh +++ b/t/t1001-read-tree-m-2way.sh @@ -36,7 +36,7 @@ compare_change () { } check_cache_at () { - clean_if_empty=`git diff-files -- "$1"` + clean_if_empty=$(git diff-files -- "$1") case "$clean_if_empty" in '') echo "$1: clean" ;; ?*) echo "$1: dirty" ;; @@ -68,14 +68,14 @@ test_expect_success \ echo rezrov >rezrov && echo yomin >yomin && git update-index --add nitfol bozbar rezrov && - treeH=`git write-tree` && + treeH=$(git write-tree) && echo treeH $treeH && git ls-tree $treeH && cat bozbar-new >bozbar && git update-index --add frotz bozbar --force-remove rezrov && git ls-files --stage >M.out && - treeM=`git write-tree` && + treeM=$(git write-tree) && echo treeM $treeM && git ls-tree $treeM && git diff-tree $treeH $treeM' @@ -315,7 +315,7 @@ test_expect_success \ 'rm -f .git/index && echo DF >DF && git update-index --add DF && - treeDF=`git write-tree` && + treeDF=$(git write-tree) && echo treeDF $treeDF && git ls-tree $treeDF && @@ -323,7 +323,7 @@ test_expect_success \ mkdir DF && echo DF/DF >DF/DF && git update-index --add --remove DF DF/DF && - treeDFDF=`git write-tree` && + treeDFDF=$(git write-tree) && echo treeDFDF $treeDFDF && git ls-tree $treeDFDF && git ls-files --stage >DFDF.out' @@ -345,7 +345,7 @@ test_expect_success \ 'rm -f .git/index && : >a && git update-index --add a && - treeM=`git write-tree` && + treeM=$(git write-tree) && echo treeM $treeM && git ls-tree $treeM && git ls-files --stage >treeM.out && @@ -354,7 +354,7 @@ test_expect_success \ git update-index --remove a && mkdir a && : >a/b && - treeH=`git write-tree` && + treeH=$(git write-tree) && echo treeH $treeH && git ls-tree $treeH' @@ -372,7 +372,7 @@ test_expect_success \ mkdir c && : >c/d && git update-index --add a c/d && - treeM=`git write-tree` && + treeM=$(git write-tree) && echo treeM $treeM && git ls-tree $treeM && git ls-files --stage >treeM.out && @@ -381,7 +381,7 @@ test_expect_success \ mkdir a && : >a/b && git update-index --add --remove a a/b && - treeH=`git write-tree` && + treeH=$(git write-tree) && echo treeH $treeH && git ls-tree $treeH' From 9b3bc877f0b01826beaa3ef00b5e3b2c49fb09cc Mon Sep 17 00:00:00 2001 From: Elia Pinto Date: Mon, 28 Apr 2014 05:57:33 -0700 Subject: [PATCH 23/41] t1002-read-tree-m-u-2way.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 Reviewed-by: Matthieu Moy Signed-off-by: Junio C Hamano --- t/t1002-read-tree-m-u-2way.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/t/t1002-read-tree-m-u-2way.sh b/t/t1002-read-tree-m-u-2way.sh index a847709a13..fed877b20f 100755 --- a/t/t1002-read-tree-m-u-2way.sh +++ b/t/t1002-read-tree-m-u-2way.sh @@ -21,7 +21,7 @@ compare_change () { } check_cache_at () { - clean_if_empty=`git diff-files -- "$1"` + clean_if_empty=$(git diff-files -- "$1") case "$clean_if_empty" in '') echo "$1: clean" ;; ?*) echo "$1: dirty" ;; @@ -41,14 +41,14 @@ test_expect_success \ echo bozbar >bozbar && echo rezrov >rezrov && git update-index --add nitfol bozbar rezrov && - treeH=`git write-tree` && + treeH=$(git write-tree) && echo treeH $treeH && git ls-tree $treeH && echo gnusto >bozbar && git update-index --add frotz bozbar --force-remove rezrov && git ls-files --stage >M.out && - treeM=`git write-tree` && + treeM=$(git write-tree) && echo treeM $treeM && git ls-tree $treeM && sum bozbar frotz nitfol >M.sum && @@ -318,7 +318,7 @@ test_expect_success \ 'rm -f .git/index && echo DF >DF && git update-index --add DF && - treeDF=`git write-tree` && + treeDF=$(git write-tree) && echo treeDF $treeDF && git ls-tree $treeDF && @@ -326,7 +326,7 @@ test_expect_success \ mkdir DF && echo DF/DF >DF/DF && git update-index --add --remove DF DF/DF && - treeDFDF=`git write-tree` && + treeDFDF=$(git write-tree) && echo treeDFDF $treeDFDF && git ls-tree $treeDFDF && git ls-files --stage >DFDF.out' From 7f311eb54ba45e1bcdda0900da891e4652614b30 Mon Sep 17 00:00:00 2001 From: Elia Pinto Date: Mon, 28 Apr 2014 05:57:34 -0700 Subject: [PATCH 24/41] t1003-read-tree-prefix.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 Reviewed-by: Matthieu Moy Signed-off-by: Junio C Hamano --- t/t1003-read-tree-prefix.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/t1003-read-tree-prefix.sh b/t/t1003-read-tree-prefix.sh index 8c6d67edda..b6111cd150 100755 --- a/t/t1003-read-tree-prefix.sh +++ b/t/t1003-read-tree-prefix.sh @@ -11,7 +11,7 @@ test_description='git read-tree --prefix test. test_expect_success setup ' echo hello >one && git update-index --add one && - tree=`git write-tree` && + tree=$(git write-tree) && echo tree is $tree ' From 77317c0c5c24e799a397b7d32080a9490fc23b11 Mon Sep 17 00:00:00 2001 From: Elia Pinto Date: Mon, 28 Apr 2014 05:57:35 -0700 Subject: [PATCH 25/41] t1004-read-tree-m-u-wf.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 Reviewed-by: Matthieu Moy Signed-off-by: Junio C Hamano --- t/t1004-read-tree-m-u-wf.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/t/t1004-read-tree-m-u-wf.sh b/t/t1004-read-tree-m-u-wf.sh index 3e72aff470..c70cf42300 100755 --- a/t/t1004-read-tree-m-u-wf.sh +++ b/t/t1004-read-tree-m-u-wf.sh @@ -30,7 +30,7 @@ test_expect_success 'two-way not clobbering' ' echo >file2 master creates untracked file2 && echo >subdir/file2 master creates untracked subdir/file2 && - if err=`read_tree_u_must_succeed -m -u master side 2>&1` + if err=$(read_tree_u_must_succeed -m -u master side 2>&1) then echo should have complained false @@ -43,7 +43,7 @@ echo file2 >.gitignore test_expect_success 'two-way with incorrect --exclude-per-directory (1)' ' - if err=`read_tree_u_must_succeed -m --exclude-per-directory=.gitignore master side 2>&1` + if err=$(read_tree_u_must_succeed -m --exclude-per-directory=.gitignore master side 2>&1) then echo should have complained false @@ -54,7 +54,7 @@ test_expect_success 'two-way with incorrect --exclude-per-directory (1)' ' test_expect_success 'two-way with incorrect --exclude-per-directory (2)' ' - if err=`read_tree_u_must_succeed -m -u --exclude-per-directory=foo --exclude-per-directory=.gitignore master side 2>&1` + if err=$(read_tree_u_must_succeed -m -u --exclude-per-directory=foo --exclude-per-directory=.gitignore master side 2>&1) then echo should have complained false @@ -95,7 +95,7 @@ test_expect_success 'three-way not clobbering a working tree file' ' git checkout master && echo >file3 file three created in master, untracked && echo >subdir/file3 file three created in master, untracked && - if err=`read_tree_u_must_succeed -m -u branch-point master side 2>&1` + if err=$(read_tree_u_must_succeed -m -u branch-point master side 2>&1) then echo should have complained false From c9e454ccef2f572ce532e29b9d1317c02764545e Mon Sep 17 00:00:00 2001 From: Elia Pinto Date: Mon, 28 Apr 2014 05:57:36 -0700 Subject: [PATCH 26/41] t1020-subdirectory.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 Reviewed-by: Matthieu Moy Signed-off-by: Junio C Hamano --- t/t1020-subdirectory.sh | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/t/t1020-subdirectory.sh b/t/t1020-subdirectory.sh index 6902320e81..62c0d25af4 100755 --- a/t/t1020-subdirectory.sh +++ b/t/t1020-subdirectory.sh @@ -20,27 +20,27 @@ test_expect_success setup ' test_expect_success 'update-index and ls-files' ' git update-index --add one && - case "`git ls-files`" in + case "$(git ls-files)" in one) echo pass one ;; *) echo bad one; exit 1 ;; esac && ( cd dir && git update-index --add two && - case "`git ls-files`" in + case "$(git ls-files)" in two) echo pass two ;; *) echo bad two; exit 1 ;; esac ) && - case "`git ls-files`" in + case "$(git ls-files)" in dir/two"$LF"one) echo pass both ;; *) echo bad; exit 1 ;; esac ' test_expect_success 'cat-file' ' - two=`git ls-files -s dir/two` && - two=`expr "$two" : "[0-7]* \\([0-9a-f]*\\)"` && + two=$(git ls-files -s dir/two) && + two=$(expr "$two" : "[0-7]* \\([0-9a-f]*\\)") && echo "$two" && git cat-file -p "$two" >actual && cmp dir/two actual && @@ -55,18 +55,18 @@ rm -f actual dir/actual test_expect_success 'diff-files' ' echo a >>one && echo d >>dir/two && - case "`git diff-files --name-only`" in + case "$(git diff-files --name-only)" in dir/two"$LF"one) echo pass top ;; *) echo bad top; exit 1 ;; esac && # diff should not omit leading paths ( cd dir && - case "`git diff-files --name-only`" in + case "$(git diff-files --name-only)" in dir/two"$LF"one) echo pass subdir ;; *) echo bad subdir; exit 1 ;; esac && - case "`git diff-files --name-only .`" in + case "$(git diff-files --name-only .)" in dir/two) echo pass subdir limited ;; *) echo bad subdir limited; exit 1 ;; esac @@ -74,11 +74,11 @@ test_expect_success 'diff-files' ' ' test_expect_success 'write-tree' ' - top=`git write-tree` && + top=$(git write-tree) && echo $top && ( cd dir && - sub=`git write-tree` && + sub=$(git write-tree) && echo $sub && test "z$top" = "z$sub" ) @@ -96,7 +96,7 @@ test_expect_success 'checkout-index' ' test_expect_success 'read-tree' ' rm -f one dir/two && - tree=`git write-tree` && + tree=$(git write-tree) && read_tree_u_must_succeed --reset -u "$tree" && cmp one original.one && cmp dir/two original.two && From 714c71b2b1531f7e1099d17ab8ae03fa21f4b88c Mon Sep 17 00:00:00 2001 From: Elia Pinto Date: Mon, 28 Apr 2014 05:57:37 -0700 Subject: [PATCH 27/41] t1050-large.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 Reviewed-by: Matthieu Moy Signed-off-by: Junio C Hamano --- t/t1050-large.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/t/t1050-large.sh b/t/t1050-large.sh index fd10528009..aea493646e 100755 --- a/t/t1050-large.sh +++ b/t/t1050-large.sh @@ -131,7 +131,7 @@ test_expect_success 'git-show a large file' ' ' test_expect_success 'index-pack' ' - git clone file://"`pwd`"/.git foo && + git clone file://"$(pwd)"/.git foo && GIT_DIR=non-existent git index-pack --strict --verify foo/.git/objects/pack/*.pack ' @@ -140,7 +140,7 @@ test_expect_success 'repack' ' ' test_expect_success 'pack-objects with large loose object' ' - SHA1=`git hash-object huge` && + SHA1=$(git hash-object huge) && test_create_repo loose && echo $SHA1 | git pack-objects --stdout | GIT_ALLOC_LIMIT=0 GIT_DIR=loose/.git git unpack-objects && From cba1262100df44bdb2cd5a00741562afb3eeb9fd Mon Sep 17 00:00:00 2001 From: Elia Pinto Date: Wed, 30 Apr 2014 09:22:54 -0700 Subject: [PATCH 28/41] t3905-stash-include-untracked.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 Reviewed-by: Matthieu Moy Signed-off-by: Junio C Hamano --- t/t3905-stash-include-untracked.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/t/t3905-stash-include-untracked.sh b/t/t3905-stash-include-untracked.sh index a5e7e6b2ba..f372fc8ca8 100755 --- a/t/t3905-stash-include-untracked.sh +++ b/t/t3905-stash-include-untracked.sh @@ -96,8 +96,8 @@ test_expect_success 'stash pop after save --include-untracked leaves files untra git stash pop && git status --porcelain >actual && test_cmp expect actual && - test "1" = "`cat file2`" && - test untracked = "`cat untracked/untracked`" + test "1" = "$(cat file2)" && + test untracked = "$(cat untracked/untracked)" ' git clean --force --quiet -d From a4cf6b4b91835c1d8d13ebb5cf3ce9241e181f1b Mon Sep 17 00:00:00 2001 From: Elia Pinto Date: Wed, 30 Apr 2014 09:22:55 -0700 Subject: [PATCH 29/41] t3910-mac-os-precompose.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 Reviewed-by: Matthieu Moy Signed-off-by: Junio C Hamano --- t/t3910-mac-os-precompose.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/t/t3910-mac-os-precompose.sh b/t/t3910-mac-os-precompose.sh index e4ba6013e4..96941e94cc 100755 --- a/t/t3910-mac-os-precompose.sh +++ b/t/t3910-mac-os-precompose.sh @@ -14,13 +14,13 @@ then fi # create utf-8 variables -Adiarnfc=`printf '\303\204'` -Adiarnfd=`printf 'A\314\210'` +Adiarnfc=$(printf '\303\204') +Adiarnfd=$(printf 'A\314\210') -Odiarnfc=`printf '\303\226'` -Odiarnfd=`printf 'O\314\210'` -AEligatu=`printf '\303\206'` -Invalidu=`printf '\303\377'` +Odiarnfc=$(printf '\303\226') +Odiarnfd=$(printf 'O\314\210') +AEligatu=$(printf '\303\206') +Invalidu=$(printf '\303\377') #Create a string with 255 bytes (decomposed) @@ -35,7 +35,7 @@ Alongc=$Alongc$Alongc$Alongc$Alongc$Alongc #250 Byte Alongc=$Alongc$AEligatu$AEligatu #254 Byte test_expect_success "detect if nfd needed" ' - precomposeunicode=`git config core.precomposeunicode` && + precomposeunicode=$(git config core.precomposeunicode) && test "$precomposeunicode" = true && git config core.precomposeunicode true ' @@ -146,7 +146,7 @@ test_expect_success "respect git config --global core.precomposeunicode" ' git config --global core.precomposeunicode true && rm -rf .git && git init && - precomposeunicode=`git config core.precomposeunicode` && + precomposeunicode=$(git config core.precomposeunicode) && test "$precomposeunicode" = "true" ' From e1d6b55d5db4c1ad305b5ac6e4f1bb4bea3c1bee Mon Sep 17 00:00:00 2001 From: Elia Pinto Date: Wed, 30 Apr 2014 09:22:56 -0700 Subject: [PATCH 30/41] t4006-diff-mode.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 Reviewed-by: Matthieu Moy Signed-off-by: Junio C Hamano --- t/t4006-diff-mode.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/t4006-diff-mode.sh b/t/t4006-diff-mode.sh index 05911492ca..76f643b2c2 100755 --- a/t/t4006-diff-mode.sh +++ b/t/t4006-diff-mode.sh @@ -13,7 +13,7 @@ sed_script='s/\(:100644 100755\) \('"$_x40"'\) \2 /\1 X X /' test_expect_success 'setup' ' echo frotz >rezrov && git update-index --add rezrov && - tree=`git write-tree` && + tree=$(git write-tree) && echo $tree ' From 38b2e5d12cbe681bff8f31cf10e3de8bd6f6db52 Mon Sep 17 00:00:00 2001 From: Elia Pinto Date: Wed, 30 Apr 2014 09:22:57 -0700 Subject: [PATCH 31/41] t4010-diff-pathspec.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 Reviewed-by: Matthieu Moy Signed-off-by: Junio C Hamano --- t/t4010-diff-pathspec.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/t/t4010-diff-pathspec.sh b/t/t4010-diff-pathspec.sh index 2bb973655b..bf07841866 100755 --- a/t/t4010-diff-pathspec.sh +++ b/t/t4010-diff-pathspec.sh @@ -18,7 +18,7 @@ test_expect_success \ mkdir path1 && echo rezrov >path1/file1 && git update-index --add file0 path1/file1 && - tree=`git write-tree` && + tree=$(git write-tree) && echo "$tree" && echo nitfol >file0 && echo yomin >path1/file1 && @@ -131,7 +131,7 @@ test_expect_success 'diff multiple wildcard pathspecs' ' mkdir path2 && echo rezrov >path2/file1 && git update-index --add path2/file1 && - tree3=`git write-tree` && + tree3=$(git write-tree) && git diff --name-only $tree $tree3 -- "path2*1" "path1*1" >actual && cat <<-\EOF >expect && path1/file1 From e6ce6f4c7a8bcb2a77e664d0dfc42ee9c2d164d0 Mon Sep 17 00:00:00 2001 From: Elia Pinto Date: Wed, 30 Apr 2014 09:22:58 -0700 Subject: [PATCH 32/41] t4012-diff-binary.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 Reviewed-by: Matthieu Moy Signed-off-by: Junio C Hamano --- t/t4012-diff-binary.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/t/t4012-diff-binary.sh b/t/t4012-diff-binary.sh index 1215ae544b..643d729157 100755 --- a/t/t4012-diff-binary.sh +++ b/t/t4012-diff-binary.sh @@ -67,18 +67,18 @@ test_expect_success C_LOCALE_OUTPUT 'apply detecting corrupt patch correctly' ' git diff >output && sed -e "s/-CIT/xCIT/" broken && test_must_fail git apply --stat --summary broken 2>detected && - detected=`cat detected` && - detected=`expr "$detected" : "fatal.*at line \\([0-9]*\\)\$"` && - detected=`sed -ne "${detected}p" broken` && + detected=$(cat detected) && + detected=$(expr "$detected" : "fatal.*at line \\([0-9]*\\)\$") && + detected=$(sed -ne "${detected}p" broken) && test "$detected" = xCIT ' test_expect_success C_LOCALE_OUTPUT 'apply detecting corrupt patch correctly' ' git diff --binary | sed -e "s/-CIT/xCIT/" >broken && test_must_fail git apply --stat --summary broken 2>detected && - detected=`cat detected` && - detected=`expr "$detected" : "fatal.*at line \\([0-9]*\\)\$"` && - detected=`sed -ne "${detected}p" broken` && + detected=$(cat detected) && + detected=$(expr "$detected" : "fatal.*at line \\([0-9]*\\)\$") && + detected=$(sed -ne "${detected}p" broken) && test "$detected" = xCIT ' @@ -88,7 +88,7 @@ test_expect_success 'initial commit' 'git commit -a -m initial' test_expect_success 'diff-index with --binary' ' echo AIT >a && mv b e && echo CIT >c && cat e >d && git update-index --add --remove a b c d e && - tree0=`git write-tree` && + tree0=$(git write-tree) && git diff --cached --binary >current && git apply --stat --summary current ' @@ -96,7 +96,7 @@ test_expect_success 'diff-index with --binary' ' test_expect_success 'apply binary patch' ' git reset --hard && git apply --binary --index Date: Wed, 30 Apr 2014 09:22:59 -0700 Subject: [PATCH 33/41] t4013-diff-various.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 Reviewed-by: Matthieu Moy Signed-off-by: Junio C Hamano --- t/t4013-diff-various.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/t/t4013-diff-various.sh b/t/t4013-diff-various.sh index e77c09c37e..805b055c89 100755 --- a/t/t4013-diff-various.sh +++ b/t/t4013-diff-various.sh @@ -107,14 +107,14 @@ test_expect_success setup ' +*++ [initial] Initial EOF -V=`git version | sed -e 's/^git version //' -e 's/\./\\./g'` +V=$(git version | sed -e 's/^git version //' -e 's/\./\\./g') while read cmd 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="$TEST_DIRECTORY/t4013/diff.$test" actual="$pfx-diff.$test" From 54835fc57ea16ed19d1689b37073806537f14cf7 Mon Sep 17 00:00:00 2001 From: Elia Pinto Date: Wed, 30 Apr 2014 09:23:00 -0700 Subject: [PATCH 34/41] t4014-format-patch.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 Reviewed-by: Matthieu Moy Signed-off-by: Junio C Hamano --- t/t4014-format-patch.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh index 73194b2c3d..f9ed598afb 100755 --- a/t/t4014-format-patch.sh +++ b/t/t4014-format-patch.sh @@ -43,7 +43,7 @@ test_expect_success setup ' test_expect_success "format-patch --ignore-if-in-upstream" ' git format-patch --stdout master..side >patch0 && - cnt=`grep "^From " patch0 | wc -l` && + cnt=$(grep "^From " patch0 | wc -l) && test $cnt = 3 ' @@ -52,7 +52,7 @@ test_expect_success "format-patch --ignore-if-in-upstream" ' git format-patch --stdout \ --ignore-if-in-upstream master..side >patch1 && - cnt=`grep "^From " patch1 | wc -l` && + cnt=$(grep "^From " patch1 | wc -l) && test $cnt = 2 ' @@ -69,7 +69,7 @@ test_expect_success "format-patch doesn't consider merge commits" ' git checkout -b merger master && test_tick && git merge --no-ff slave && - cnt=`git format-patch -3 --stdout | grep "^From " | wc -l` && + cnt=$(git format-patch -3 --stdout | grep "^From " | wc -l) && test $cnt = 3 ' @@ -77,7 +77,7 @@ test_expect_success "format-patch result applies" ' git checkout -b rebuild-0 master && git am -3 patch0 && - cnt=`git rev-list master.. | wc -l` && + cnt=$(git rev-list master.. | wc -l) && test $cnt = 2 ' @@ -85,7 +85,7 @@ test_expect_success "format-patch --ignore-if-in-upstream result applies" ' git checkout -b rebuild-1 master && git am -3 patch1 && - cnt=`git rev-list master.. | wc -l` && + cnt=$(git rev-list master.. | wc -l) && test $cnt = 2 ' From 20cb28baf9d03c779f590baa475610788bc6eabf Mon Sep 17 00:00:00 2001 From: Elia Pinto Date: Wed, 30 Apr 2014 09:23:01 -0700 Subject: [PATCH 35/41] t4036-format-patch-signer-mime.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 Reviewed-by: Matthieu Moy Signed-off-by: Junio C Hamano --- t/t4036-format-patch-signer-mime.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/t4036-format-patch-signer-mime.sh b/t/t4036-format-patch-signer-mime.sh index ba43f18549..98d9713d8b 100755 --- a/t/t4036-format-patch-signer-mime.sh +++ b/t/t4036-format-patch-signer-mime.sh @@ -42,7 +42,7 @@ test_expect_success 'attach and signoff do not duplicate mime headers' ' GIT_COMMITTER_NAME="はまの ふにおう" \ git format-patch -s --stdout -1 --attach >output && - test `grep -ci ^MIME-Version: output` = 1 + test $(grep -ci ^MIME-Version: output) = 1 ' From 7c0c51baa4855c76a71820fb279c2ca1580d374b Mon Sep 17 00:00:00 2001 From: Elia Pinto Date: Wed, 30 Apr 2014 09:23:02 -0700 Subject: [PATCH 36/41] t4038-diff-combined.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 Reviewed-by: Matthieu Moy Signed-off-by: Junio C Hamano --- t/t4038-diff-combined.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/t4038-diff-combined.sh b/t/t4038-diff-combined.sh index 1019d7b35f..41913c3aa3 100755 --- a/t/t4038-diff-combined.sh +++ b/t/t4038-diff-combined.sh @@ -94,7 +94,7 @@ test_expect_success 'setup for --cc --raw' ' blob=$(echo file | git hash-object --stdin -w) && base_tree=$(echo "100644 blob $blob file" | git mktree) && trees= && - for i in `test_seq 1 40` + for i in $(test_seq 1 40) do blob=$(echo file$i | git hash-object --stdin -w) && trees="$trees$(echo "100644 blob $blob file" | git mktree)$LF" From 274447aa6bbe84c4e65607f48df18380766d24fe Mon Sep 17 00:00:00 2001 From: Elia Pinto Date: Wed, 30 Apr 2014 09:23:03 -0700 Subject: [PATCH 37/41] t4057-diff-combined-paths.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 Reviewed-by: Matthieu Moy Signed-off-by: Junio C Hamano --- t/t4057-diff-combined-paths.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/t4057-diff-combined-paths.sh b/t/t4057-diff-combined-paths.sh index 097e63215e..dff36b77ec 100755 --- a/t/t4057-diff-combined-paths.sh +++ b/t/t4057-diff-combined-paths.sh @@ -5,7 +5,7 @@ test_description='combined diff show only paths that are different to all parent . ./test-lib.sh # verify that diffc.expect matches output of -# `git diff -c --name-only HEAD HEAD^ HEAD^2` +# $(git diff -c --name-only HEAD HEAD^ HEAD^2) diffc_verify () { git diff -c --name-only HEAD HEAD^ HEAD^2 >diffc.actual && test_cmp diffc.expect diffc.actual From 991a9c3af984eb28b31f8642c97fd9ddb29cadc4 Mon Sep 17 00:00:00 2001 From: Elia Pinto Date: Wed, 30 Apr 2014 09:23:04 -0700 Subject: [PATCH 38/41] t4116-apply-reverse.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 Reviewed-by: Matthieu Moy Signed-off-by: Junio C Hamano --- t/t4116-apply-reverse.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/t/t4116-apply-reverse.sh b/t/t4116-apply-reverse.sh index 1e4d4380bf..ce8567f496 100755 --- a/t/t4116-apply-reverse.sh +++ b/t/t4116-apply-reverse.sh @@ -30,10 +30,10 @@ test_expect_success setup ' test_expect_success 'apply in forward' ' - T0=`git rev-parse "second^{tree}"` && + T0=$(git rev-parse "second^{tree}") && git reset --hard initial && git apply --index --binary patch && - T1=`git write-tree` && + T1=$(git write-tree) && test "$T0" = "$T1" ' @@ -62,22 +62,22 @@ test_expect_success 'setup separate repository lacking postimage' ' test_expect_success 'apply in forward without postimage' ' - T0=`git rev-parse "second^{tree}"` && + T0=$(git rev-parse "second^{tree}") && ( cd initial && git apply --index --binary ../patch && - T1=`git write-tree` && + T1=$(git write-tree) && test "$T0" = "$T1" ) ' test_expect_success 'apply in reverse without postimage' ' - T0=`git rev-parse "initial^{tree}"` && + T0=$(git rev-parse "initial^{tree}") && ( cd second && git apply --index --binary --reverse ../patch && - T1=`git write-tree` && + T1=$(git write-tree) && test "$T0" = "$T1" ) ' From 6003eb13c69516dfedc9466aeb8c3a32a054c286 Mon Sep 17 00:00:00 2001 From: Elia Pinto Date: Wed, 30 Apr 2014 09:23:05 -0700 Subject: [PATCH 39/41] t4119-apply-config.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 Reviewed-by: Matthieu Moy Signed-off-by: Junio C Hamano --- t/t4119-apply-config.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/t4119-apply-config.sh b/t/t4119-apply-config.sh index 3d0384daa8..c393be691b 100755 --- a/t/t4119-apply-config.sh +++ b/t/t4119-apply-config.sh @@ -68,7 +68,7 @@ test_expect_success 'apply --whitespace=strip from config' ' check_result sub/file1 ' -D=`pwd` +D=$(pwd) test_expect_success 'apply --whitespace=strip in subdir' ' From ce21ccfae0729fd73b54f3ae4935fc7769343561 Mon Sep 17 00:00:00 2001 From: Elia Pinto Date: Wed, 30 Apr 2014 09:23:06 -0700 Subject: [PATCH 40/41] t4204-patch-id.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 Reviewed-by: Matthieu Moy Signed-off-by: Junio C Hamano --- t/t4204-patch-id.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/t/t4204-patch-id.sh b/t/t4204-patch-id.sh index d2c930de87..7940f6f0b9 100755 --- a/t/t4204-patch-id.sh +++ b/t/t4204-patch-id.sh @@ -45,8 +45,8 @@ test_expect_success 'patch-id supports git-format-patch output' ' git checkout same && git format-patch -1 --stdout | calc_patch_id same && test_cmp patch-id_master patch-id_same && - set `git format-patch -1 --stdout | git patch-id` && - test "$2" = `git rev-parse HEAD` + set $(git format-patch -1 --stdout | git patch-id) && + test "$2" = $(git rev-parse HEAD) ' test_expect_success 'whitespace is irrelevant in footer' ' From f5efd5196cf2d7931785f663b219b40fd204e1b1 Mon Sep 17 00:00:00 2001 From: Elia Pinto Date: Wed, 30 Apr 2014 09:23:07 -0700 Subject: [PATCH 41/41] t5000-tar-tree.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 Reviewed-by: Matthieu Moy Signed-off-by: Junio C Hamano --- t/t5000-tar-tree.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/t/t5000-tar-tree.sh b/t/t5000-tar-tree.sh index 1cf0a4e103..74fc5a88ec 100755 --- a/t/t5000-tar-tree.sh +++ b/t/t5000-tar-tree.sh @@ -123,7 +123,7 @@ test_expect_success \ 'add files to repository' \ 'find a -type f | xargs git update-index --add && find a -type l | xargs git update-index --add && - treeid=`git write-tree` && + treeid=$(git write-tree) && echo $treeid >treeid && git update-ref HEAD $(TZ=GMT GIT_COMMITTER_DATE="2005-05-27 22:00:00" \ git commit-tree $treeid remote.tar && test_must_fail git archive --remote=. $sha1 >remote.tar @@ -215,7 +215,7 @@ test_expect_success 'clients cannot access unreachable commits' ' test_expect_success 'upload-archive can allow unreachable commits' ' test_commit unreachable1 && - sha1=`git rev-parse HEAD` && + sha1=$(git rev-parse HEAD) && git reset --hard HEAD^ && git archive $sha1 >remote.tar && test_config uploadarchive.allowUnreachable true &&