* [PATCH 01/14] t9365-continuing-queries.sh: use the $( ... ) construct for command substitution
@ 2014-04-23 13:43 Elia Pinto
2014-04-23 13:43 ` [PATCH 02/14] test-gitmw-lib.sh: " Elia Pinto
` (13 more replies)
0 siblings, 14 replies; 20+ messages in thread
From: Elia Pinto @ 2014-04-23 13:43 UTC (permalink / raw)
To: git; +Cc: matthieu.moy, Elia Pinto
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>
---
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 27e267f..0164547 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<br/>" true
--
1.7.10.4
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 02/14] test-gitmw-lib.sh: use the $( ... ) construct for command substitution
2014-04-23 13:43 [PATCH 01/14] t9365-continuing-queries.sh: use the $( ... ) construct for command substitution Elia Pinto
@ 2014-04-23 13:43 ` Elia Pinto
2014-04-23 13:43 ` [PATCH 03/14] t7900-subtree.sh: " Elia Pinto
` (12 subsequent siblings)
13 siblings, 0 replies; 20+ messages in thread
From: Elia Pinto @ 2014-04-23 13:43 UTC (permalink / raw)
To: git; +Cc: matthieu.moy, Elia Pinto
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>
---
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 3372b2a..c783752 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 <dir> contains exactly <N> 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/" ||
--
1.7.10.4
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 03/14] t7900-subtree.sh: use the $( ... ) construct for command substitution
2014-04-23 13:43 [PATCH 01/14] t9365-continuing-queries.sh: use the $( ... ) construct for command substitution Elia Pinto
2014-04-23 13:43 ` [PATCH 02/14] test-gitmw-lib.sh: " Elia Pinto
@ 2014-04-23 13:43 ` Elia Pinto
2014-04-23 13:43 ` [PATCH 04/14] appp.sh: " Elia Pinto
` (11 subsequent siblings)
13 siblings, 0 replies; 20+ messages in thread
From: Elia Pinto @ 2014-04-23 13:43 UTC (permalink / raw)
To: git; +Cc: matthieu.moy, Elia Pinto
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>
---
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 66ce4b0..b22b710 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 &&
--
1.7.10.4
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 04/14] appp.sh: use the $( ... ) construct for command substitution
2014-04-23 13:43 [PATCH 01/14] t9365-continuing-queries.sh: use the $( ... ) construct for command substitution Elia Pinto
2014-04-23 13:43 ` [PATCH 02/14] test-gitmw-lib.sh: " Elia Pinto
2014-04-23 13:43 ` [PATCH 03/14] t7900-subtree.sh: " Elia Pinto
@ 2014-04-23 13:43 ` Elia Pinto
2014-04-25 22:58 ` brian m. carlson
2014-04-23 13:43 ` [PATCH 05/14] txt-to-pot.sh: " Elia Pinto
` (10 subsequent siblings)
13 siblings, 1 reply; 20+ messages in thread
From: Elia Pinto @ 2014-04-23 13:43 UTC (permalink / raw)
To: git; +Cc: matthieu.moy, Elia Pinto
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>
---
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 5eb4a51..8dc73ec 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}_"
--
1.7.10.4
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 05/14] txt-to-pot.sh: use the $( ... ) construct for command substitution
2014-04-23 13:43 [PATCH 01/14] t9365-continuing-queries.sh: use the $( ... ) construct for command substitution Elia Pinto
` (2 preceding siblings ...)
2014-04-23 13:43 ` [PATCH 04/14] appp.sh: " Elia Pinto
@ 2014-04-23 13:43 ` Elia Pinto
2014-04-23 14:44 ` Matthieu Moy
2014-04-23 13:43 ` [PATCH 06/14] git-pull.sh: " Elia Pinto
` (9 subsequent siblings)
13 siblings, 1 reply; 20+ messages in thread
From: Elia Pinto @ 2014-04-23 13:43 UTC (permalink / raw)
To: git; +Cc: matthieu.moy, Elia Pinto
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>
---
git-gui/po/glossary/txt-to-pot.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/git-gui/po/glossary/txt-to-pot.sh b/git-gui/po/glossary/txt-to-pot.sh
index 49bf7c5..8249915 100755
--- a/git-gui/po/glossary/txt-to-pot.sh
+++ b/git-gui/po/glossary/txt-to-pot.sh
@@ -11,7 +11,7 @@
if [ $# -eq 0 ]
then
cat <<!
-Usage: `basename $0` git-gui-glossary.txt > git-gui-glossary.pot
+Usage: $(basename $0) git-gui-glossary.txt > git-gui-glossary.pot
!
exit 1;
fi
@@ -33,7 +33,7 @@ cat <<!
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
-"POT-Creation-Date: `date +'%Y-%m-%d %H:%M%z'`\n"
+"POT-Creation-Date: $(date +'%Y-%m-%d %H:%M%z')\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
--
1.7.10.4
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 06/14] git-pull.sh: use the $( ... ) construct for command substitution
2014-04-23 13:43 [PATCH 01/14] t9365-continuing-queries.sh: use the $( ... ) construct for command substitution Elia Pinto
` (3 preceding siblings ...)
2014-04-23 13:43 ` [PATCH 05/14] txt-to-pot.sh: " Elia Pinto
@ 2014-04-23 13:43 ` Elia Pinto
2014-04-23 13:43 ` [PATCH 07/14] git-rebase--merge.sh: " Elia Pinto
` (8 subsequent siblings)
13 siblings, 0 replies; 20+ messages in thread
From: Elia Pinto @ 2014-04-23 13:43 UTC (permalink / raw)
To: git; +Cc: matthieu.moy, Elia Pinto
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>
---
git-pull.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/git-pull.sh b/git-pull.sh
index 6cd8ebc..cfc589d 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 ;;
*)
--
1.7.10.4
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 07/14] git-rebase--merge.sh: use the $( ... ) construct for command substitution
2014-04-23 13:43 [PATCH 01/14] t9365-continuing-queries.sh: use the $( ... ) construct for command substitution Elia Pinto
` (4 preceding siblings ...)
2014-04-23 13:43 ` [PATCH 06/14] git-pull.sh: " Elia Pinto
@ 2014-04-23 13:43 ` Elia Pinto
2014-04-23 13:44 ` [PATCH 08/14] git-rebase.sh: " Elia Pinto
` (7 subsequent siblings)
13 siblings, 0 replies; 20+ messages in thread
From: Elia Pinto @ 2014-04-23 13:43 UTC (permalink / raw)
To: git; +Cc: matthieu.moy, Elia Pinto
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>
---
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 71429fd..6d77b3c 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"
@@ -143,7 +143,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"
--
1.7.10.4
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 08/14] git-rebase.sh: use the $( ... ) construct for command substitution
2014-04-23 13:43 [PATCH 01/14] t9365-continuing-queries.sh: use the $( ... ) construct for command substitution Elia Pinto
` (5 preceding siblings ...)
2014-04-23 13:43 ` [PATCH 07/14] git-rebase--merge.sh: " Elia Pinto
@ 2014-04-23 13:44 ` Elia Pinto
2014-04-23 13:44 ` [PATCH 09/14] git-stash.sh: " Elia Pinto
` (6 subsequent siblings)
13 siblings, 0 replies; 20+ messages in thread
From: Elia Pinto @ 2014-04-23 13:44 UTC (permalink / raw)
To: git; +Cc: matthieu.moy, Elia Pinto
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>
---
git-rebase.sh | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/git-rebase.sh b/git-rebase.sh
index 4543815..5c7a0a1 100755
--- a/git-rebase.sh
+++ b/git-rebase.sh
@@ -457,8 +457,8 @@ then
else
if test -z "$onto"
then
- empty_tree=`git hash-object -t tree /dev/null`
- onto=`git commit-tree $empty_tree </dev/null`
+ empty_tree=$(git hash-object -t tree /dev/null)
+ onto=$(git commit-tree $empty_tree </dev/null)
squash_onto="$onto"
fi
unset upstream_name
@@ -516,10 +516,10 @@ case "$#" in
;;
0)
# Do not need to switch branches, we are already on it.
- if branch_name=`git symbolic-ref -q HEAD`
+ if branch_name=$(git symbolic-ref -q HEAD)
then
head_name=$branch_name
- branch_name=`expr "z$branch_name" : 'zrefs/heads/\(.*\)'`
+ branch_name=$(expr "z$branch_name" : 'zrefs/heads/\(.*\)')
else
head_name="detached HEAD"
branch_name=HEAD ;# detached
--
1.7.10.4
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 09/14] git-stash.sh: use the $( ... ) construct for command substitution
2014-04-23 13:43 [PATCH 01/14] t9365-continuing-queries.sh: use the $( ... ) construct for command substitution Elia Pinto
` (6 preceding siblings ...)
2014-04-23 13:44 ` [PATCH 08/14] git-rebase.sh: " Elia Pinto
@ 2014-04-23 13:44 ` Elia Pinto
2014-04-23 13:44 ` [PATCH 10/14] git-web--browse.sh: " Elia Pinto
` (5 subsequent siblings)
13 siblings, 0 replies; 20+ messages in thread
From: Elia Pinto @ 2014-04-23 13:44 UTC (permalink / raw)
To: git; +Cc: matthieu.moy, Elia Pinto
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>
---
git-stash.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/git-stash.sh b/git-stash.sh
index 4798bcf..af549c7 100755
--- a/git-stash.sh
+++ b/git-stash.sh
@@ -13,7 +13,7 @@ USAGE="list [<options>]
SUBDIRECTORY_OK=Yes
OPTIONS_SPEC=
-START_DIR=`pwd`
+START_DIR=$(pwd)
. git-sh-setup
. git-sh-i18n
require_work_tree
--
1.7.10.4
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 10/14] git-web--browse.sh: use the $( ... ) construct for command substitution
2014-04-23 13:43 [PATCH 01/14] t9365-continuing-queries.sh: use the $( ... ) construct for command substitution Elia Pinto
` (7 preceding siblings ...)
2014-04-23 13:44 ` [PATCH 09/14] git-stash.sh: " Elia Pinto
@ 2014-04-23 13:44 ` Elia Pinto
2014-04-23 13:44 ` [PATCH 11/14] lib-credential.sh: " Elia Pinto
` (4 subsequent siblings)
13 siblings, 0 replies; 20+ messages in thread
From: Elia Pinto @ 2014-04-23 13:44 UTC (permalink / raw)
To: git; +Cc: matthieu.moy, Elia Pinto
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>
---
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 ebdfba6..ae15253 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
--
1.7.10.4
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 11/14] lib-credential.sh: use the $( ... ) construct for command substitution
2014-04-23 13:43 [PATCH 01/14] t9365-continuing-queries.sh: use the $( ... ) construct for command substitution Elia Pinto
` (8 preceding siblings ...)
2014-04-23 13:44 ` [PATCH 10/14] git-web--browse.sh: " Elia Pinto
@ 2014-04-23 13:44 ` Elia Pinto
2014-04-23 13:44 ` [PATCH 12/14] lib-cvs.sh: " Elia Pinto
` (3 subsequent siblings)
13 siblings, 0 replies; 20+ messages in thread
From: Elia Pinto @ 2014-04-23 13:44 UTC (permalink / raw)
To: git; +Cc: matthieu.moy, Elia Pinto
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>
---
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 957ae93..9e7d796 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
--
1.7.10.4
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 12/14] lib-cvs.sh: use the $( ... ) construct for command substitution
2014-04-23 13:43 [PATCH 01/14] t9365-continuing-queries.sh: use the $( ... ) construct for command substitution Elia Pinto
` (9 preceding siblings ...)
2014-04-23 13:44 ` [PATCH 11/14] lib-credential.sh: " Elia Pinto
@ 2014-04-23 13:44 ` Elia Pinto
2014-04-23 13:44 ` [PATCH 13/14] lib-gpg.sh: " Elia Pinto
` (2 subsequent siblings)
13 siblings, 0 replies; 20+ messages in thread
From: Elia Pinto @ 2014-04-23 13:44 UTC (permalink / raw)
To: git; +Cc: matthieu.moy, Elia Pinto
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>
---
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 5076718..9b2bcfb 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*)
;;
--
1.7.10.4
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 13/14] lib-gpg.sh: use the $( ... ) construct for command substitution
2014-04-23 13:43 [PATCH 01/14] t9365-continuing-queries.sh: use the $( ... ) construct for command substitution Elia Pinto
` (10 preceding siblings ...)
2014-04-23 13:44 ` [PATCH 12/14] lib-cvs.sh: " Elia Pinto
@ 2014-04-23 13:44 ` Elia Pinto
2014-04-23 13:44 ` [PATCH 14/14] p5302-pack-index.sh: " Elia Pinto
2014-04-23 14:45 ` [PATCH 01/14] t9365-continuing-queries.sh: " Matthieu Moy
13 siblings, 0 replies; 20+ messages in thread
From: Elia Pinto @ 2014-04-23 13:44 UTC (permalink / raw)
To: git; +Cc: matthieu.moy, Elia Pinto
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>
---
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 05824fa..fd499e7 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
--
1.7.10.4
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 14/14] p5302-pack-index.sh: use the $( ... ) construct for command substitution
2014-04-23 13:43 [PATCH 01/14] t9365-continuing-queries.sh: use the $( ... ) construct for command substitution Elia Pinto
` (11 preceding siblings ...)
2014-04-23 13:44 ` [PATCH 13/14] lib-gpg.sh: " Elia Pinto
@ 2014-04-23 13:44 ` Elia Pinto
2014-04-23 14:45 ` [PATCH 01/14] t9365-continuing-queries.sh: " Matthieu Moy
13 siblings, 0 replies; 20+ messages in thread
From: Elia Pinto @ 2014-04-23 13:44 UTC (permalink / raw)
To: git; +Cc: matthieu.moy, Elia Pinto
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>
---
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 6cb5b0d..5ee9211 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
'
--
1.7.10.4
^ permalink raw reply related [flat|nested] 20+ messages in thread
* Re: [PATCH 05/14] txt-to-pot.sh: use the $( ... ) construct for command substitution
2014-04-23 13:43 ` [PATCH 05/14] txt-to-pot.sh: " Elia Pinto
@ 2014-04-23 14:44 ` Matthieu Moy
0 siblings, 0 replies; 20+ messages in thread
From: Matthieu Moy @ 2014-04-23 14:44 UTC (permalink / raw)
To: Elia Pinto; +Cc: git
Elia Pinto <gitter.spiros@gmail.com> writes:
> git-gui/po/glossary/txt-to-pot.sh | 4 ++--
git-gui is a separate project, patches are normally applied to git-gui
first, and then pulled by Junio.
I'd suggest dropping this patch, it's probably not worth the trouble
(although the patch is correct).
--
Matthieu Moy
http://www-verimag.imag.fr/~moy/
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 01/14] t9365-continuing-queries.sh: use the $( ... ) construct for command substitution
2014-04-23 13:43 [PATCH 01/14] t9365-continuing-queries.sh: use the $( ... ) construct for command substitution Elia Pinto
` (12 preceding siblings ...)
2014-04-23 13:44 ` [PATCH 14/14] p5302-pack-index.sh: " Elia Pinto
@ 2014-04-23 14:45 ` Matthieu Moy
13 siblings, 0 replies; 20+ messages in thread
From: Matthieu Moy @ 2014-04-23 14:45 UTC (permalink / raw)
To: Elia Pinto; +Cc: git
Patches 01 to 14/14 are
Reviewed-by: Matthieu Moy <Matthieu.Moy@imag.fr>
--
Matthieu Moy
http://www-verimag.imag.fr/~moy/
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 04/14] appp.sh: use the $( ... ) construct for command substitution
2014-04-23 13:43 ` [PATCH 04/14] appp.sh: " Elia Pinto
@ 2014-04-25 22:58 ` brian m. carlson
2014-04-28 17:53 ` Junio C Hamano
0 siblings, 1 reply; 20+ messages in thread
From: brian m. carlson @ 2014-04-25 22:58 UTC (permalink / raw)
To: Elia Pinto; +Cc: git, matthieu.moy
[-- Attachment #1: Type: text/plain, Size: 994 bytes --]
On Wed, Apr 23, 2014 at 06:43:56AM -0700, Elia Pinto wrote:
> @@ -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'`
It looks like you may have missed a usage here due to the line break.
--
brian m. carlson / brian with sandals: Houston, Texas, US
+1 832 623 2791 | http://www.crustytoothpaste.net/~bmc | My opinion only
OpenPGP: RSA v4 4096b: 88AC E9B2 9196 305B A994 7552 F1BA 225C 0223 B187
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 04/14] appp.sh: use the $( ... ) construct for command substitution
2014-04-25 22:58 ` brian m. carlson
@ 2014-04-28 17:53 ` Junio C Hamano
2014-04-28 18:07 ` Matthieu Moy
0 siblings, 1 reply; 20+ messages in thread
From: Junio C Hamano @ 2014-04-28 17:53 UTC (permalink / raw)
To: brian m. carlson; +Cc: Elia Pinto, git, matthieu.moy
"brian m. carlson" <sandals@crustytoothpaste.net> writes:
>> CCS=`echo -e "$CMT_MSG\n$HEADERS" | sed -n -e 's/^Cc: \(.*\)$/\1,/gp' \
>> -e 's/^Signed-off-by: \(.*\)/\1,/gp'`
>
> It looks like you may have missed a usage here due to the line break.
Good eyes ;-)
The following may be an obvious replacement patch, but alternatively
we could just drop the whole thing (contrib/ material is not
something we would need to police strictly for the style---nobody
should be mimicking their styles as they are not part of _our_
codebase in the first place).
contrib/thunderbird-patch-inline/appp.sh | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/contrib/thunderbird-patch-inline/appp.sh b/contrib/thunderbird-patch-inline/appp.sh
index 5eb4a51..1053872 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,14 +25,14 @@ 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'`
+CCS=$(echo -e "$CMT_MSG\n$HEADERS" | sed -n -e 's/^Cc: \(.*\)$/\1,/gp' \
+ -e 's/^Signed-off-by: \(.*\)/\1,/gp')
echo "$SUBJECT" > $1
echo "Cc: $CCS" >> $1
@@ -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}_"
^ permalink raw reply related [flat|nested] 20+ messages in thread
* Re: [PATCH 04/14] appp.sh: use the $( ... ) construct for command substitution
2014-04-28 17:53 ` Junio C Hamano
@ 2014-04-28 18:07 ` Matthieu Moy
2014-04-28 19:20 ` Junio C Hamano
0 siblings, 1 reply; 20+ messages in thread
From: Matthieu Moy @ 2014-04-28 18:07 UTC (permalink / raw)
To: Junio C Hamano; +Cc: brian m. carlson, Elia Pinto, git
Junio C Hamano <gitster@pobox.com> writes:
> "brian m. carlson" <sandals@crustytoothpaste.net> writes:
>
>>> CCS=`echo -e "$CMT_MSG\n$HEADERS" | sed -n -e 's/^Cc: \(.*\)$/\1,/gp' \
>>> -e 's/^Signed-off-by: \(.*\)/\1,/gp'`
>>
>> It looks like you may have missed a usage here due to the line break.
>
> Good eyes ;-)
>
> The following may be an obvious replacement patch, but alternatively
> we could just drop the whole thing (contrib/ material is not
> something we would need to police strictly for the style---nobody
> should be mimicking their styles as they are not part of _our_
> codebase in the first place).
My vote goes for keeping the patch as it is, so that future people
grepping for `...` construct do not find any after the series is
finished.
(and because it's simple to do)
--
Matthieu Moy
http://www-verimag.imag.fr/~moy/
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 04/14] appp.sh: use the $( ... ) construct for command substitution
2014-04-28 18:07 ` Matthieu Moy
@ 2014-04-28 19:20 ` Junio C Hamano
0 siblings, 0 replies; 20+ messages in thread
From: Junio C Hamano @ 2014-04-28 19:20 UTC (permalink / raw)
To: Matthieu Moy; +Cc: brian m. carlson, Elia Pinto, git
Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:
> Junio C Hamano <gitster@pobox.com> writes:
>
>> "brian m. carlson" <sandals@crustytoothpaste.net> writes:
>>
>>>> CCS=`echo -e "$CMT_MSG\n$HEADERS" | sed -n -e 's/^Cc: \(.*\)$/\1,/gp' \
>>>> -e 's/^Signed-off-by: \(.*\)/\1,/gp'`
>>>
>>> It looks like you may have missed a usage here due to the line break.
>>
>> Good eyes ;-)
>>
>> The following may be an obvious replacement patch, but alternatively
>> we could just drop the whole thing (contrib/ material is not
>> something we would need to police strictly for the style---nobody
>> should be mimicking their styles as they are not part of _our_
>> codebase in the first place).
>
> My vote goes for keeping the patch as it is, so that future people
> grepping for `...` construct do not find any after the series is
> finished.
>
> (and because it's simple to do)
Sure, let's do that.
^ permalink raw reply [flat|nested] 20+ messages in thread
end of thread, other threads:[~2014-04-28 19:20 UTC | newest]
Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-23 13:43 [PATCH 01/14] t9365-continuing-queries.sh: use the $( ... ) construct for command substitution Elia Pinto
2014-04-23 13:43 ` [PATCH 02/14] test-gitmw-lib.sh: " Elia Pinto
2014-04-23 13:43 ` [PATCH 03/14] t7900-subtree.sh: " Elia Pinto
2014-04-23 13:43 ` [PATCH 04/14] appp.sh: " Elia Pinto
2014-04-25 22:58 ` brian m. carlson
2014-04-28 17:53 ` Junio C Hamano
2014-04-28 18:07 ` Matthieu Moy
2014-04-28 19:20 ` Junio C Hamano
2014-04-23 13:43 ` [PATCH 05/14] txt-to-pot.sh: " Elia Pinto
2014-04-23 14:44 ` Matthieu Moy
2014-04-23 13:43 ` [PATCH 06/14] git-pull.sh: " Elia Pinto
2014-04-23 13:43 ` [PATCH 07/14] git-rebase--merge.sh: " Elia Pinto
2014-04-23 13:44 ` [PATCH 08/14] git-rebase.sh: " Elia Pinto
2014-04-23 13:44 ` [PATCH 09/14] git-stash.sh: " Elia Pinto
2014-04-23 13:44 ` [PATCH 10/14] git-web--browse.sh: " Elia Pinto
2014-04-23 13:44 ` [PATCH 11/14] lib-credential.sh: " Elia Pinto
2014-04-23 13:44 ` [PATCH 12/14] lib-cvs.sh: " Elia Pinto
2014-04-23 13:44 ` [PATCH 13/14] lib-gpg.sh: " Elia Pinto
2014-04-23 13:44 ` [PATCH 14/14] p5302-pack-index.sh: " Elia Pinto
2014-04-23 14:45 ` [PATCH 01/14] t9365-continuing-queries.sh: " Matthieu Moy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).