All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 001/14] howto-index.sh: use the $( ... ) construct for command substitution
@ 2014-04-16 17:29 Elia Pinto
  2014-04-16 17:29 ` [PATCH 002/14] install-webdoc.sh: " Elia Pinto
                   ` (13 more replies)
  0 siblings, 14 replies; 16+ messages in thread
From: Elia Pinto @ 2014-04-16 17:29 UTC (permalink / raw)
  To: git; +Cc: 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>
---
 Documentation/howto-index.sh |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/Documentation/howto-index.sh b/Documentation/howto-index.sh
index a234086..167b363 100755
--- a/Documentation/howto-index.sh
+++ b/Documentation/howto-index.sh
@@ -11,8 +11,8 @@ EOF
 
 for txt
 do
-	title=`expr "$txt" : '.*/\(.*\)\.txt$'`
-	from=`sed -ne '
+	title=$(expr "$txt" : '.*/\(.*\)\.txt$')
+	from=$(sed -ne '
 	/^$/q
 	/^From:[ 	]/{
 		s///
@@ -21,9 +21,9 @@ do
 		s/^/by /
 		p
 	}
-	' "$txt"`
+	' "$txt")
 
-	abstract=`sed -ne '
+	abstract=$(sed -ne '
 	/^Abstract:[ 	]/{
 		s/^[^ 	]*//
 		x
@@ -39,11 +39,11 @@ do
 		x
 		p
 		q
-	}' "$txt"`
+	}' "$txt")
 
 	if grep 'Content-type: text/asciidoc' >/dev/null $txt
 	then
-		file=`expr "$txt" : '\(.*\)\.txt$'`.html
+		file=$(expr "$txt" : '\(.*\)\.txt$').html
 	else
 		file="$txt"
 	fi
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 002/14] install-webdoc.sh: use the $( ... ) construct for command substitution
  2014-04-16 17:29 [PATCH 001/14] howto-index.sh: use the $( ... ) construct for command substitution Elia Pinto
@ 2014-04-16 17:29 ` Elia Pinto
  2014-04-16 17:29 ` [PATCH 003/14] git-checkout.sh: " Elia Pinto
                   ` (12 subsequent siblings)
  13 siblings, 0 replies; 16+ messages in thread
From: Elia Pinto @ 2014-04-16 17:29 UTC (permalink / raw)
  To: git; +Cc: 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>
---
 Documentation/install-webdoc.sh |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/Documentation/install-webdoc.sh b/Documentation/install-webdoc.sh
index 76d69a9..ed8b4ff 100755
--- a/Documentation/install-webdoc.sh
+++ b/Documentation/install-webdoc.sh
@@ -18,17 +18,17 @@ do
 	else
 		echo >&2 "# install $h $T/$h"
 		rm -f "$T/$h"
-		mkdir -p `dirname "$T/$h"`
+		mkdir -p $(dirname "$T/$h")
 		cp "$h" "$T/$h"
 	fi
 done
-strip_leading=`echo "$T/" | sed -e 's|.|.|g'`
+strip_leading=$(echo "$T/" | sed -e 's|.|.|g')
 for th in \
 	"$T"/*.html "$T"/*.txt \
 	"$T"/howto/*.txt "$T"/howto/*.html \
 	"$T"/technical/*.txt "$T"/technical/*.html
 do
-	h=`expr "$th" : "$strip_leading"'\(.*\)'`
+	h=$(expr "$th" : "$strip_leading"'\(.*\)')
 	case "$h" in
 	RelNotes-*.txt | index.html) continue ;;
 	esac
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 003/14] git-checkout.sh: use the $( ... ) construct for command substitution
  2014-04-16 17:29 [PATCH 001/14] howto-index.sh: use the $( ... ) construct for command substitution Elia Pinto
  2014-04-16 17:29 ` [PATCH 002/14] install-webdoc.sh: " Elia Pinto
@ 2014-04-16 17:29 ` Elia Pinto
  2014-04-16 17:29 ` [PATCH 004/14] git-clone.sh: " Elia Pinto
                   ` (11 subsequent siblings)
  13 siblings, 0 replies; 16+ messages in thread
From: Elia Pinto @ 2014-04-16 17:29 UTC (permalink / raw)
  To: git; +Cc: 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/examples/git-checkout.sh |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/contrib/examples/git-checkout.sh b/contrib/examples/git-checkout.sh
index d2c1f98..683cae7 100755
--- a/contrib/examples/git-checkout.sh
+++ b/contrib/examples/git-checkout.sh
@@ -222,7 +222,7 @@ else
 
 	# Match the index to the working tree, and do a three-way.
 	git diff-files --name-only | git update-index --remove --stdin &&
-	work=`git write-tree` &&
+	work=$(git write-tree) &&
 	git read-tree $v --reset -u $new || exit
 
 	eval GITHEAD_$new='${new_name:-${branch:-$new}}' &&
@@ -233,7 +233,7 @@ else
 	# Do not register the cleanly merged paths in the index yet.
 	# this is not a real merge before committing, but just carrying
 	# the working tree changes along.
-	unmerged=`git ls-files -u`
+	unmerged=$(git ls-files -u)
 	git read-tree $v --reset $new
 	case "$unmerged" in
 	'')	;;
@@ -269,7 +269,7 @@ if [ "$?" -eq 0 ]; then
 	fi
 	if test -n "$branch"
 	then
-		old_branch_name=`expr "z$oldbranch" : 'zrefs/heads/\(.*\)'`
+		old_branch_name=$(expr "z$oldbranch" : 'zrefs/heads/\(.*\)')
 		GIT_DIR="$GIT_DIR" git symbolic-ref -m "checkout: moving from ${old_branch_name:-$old} to $branch" HEAD "refs/heads/$branch"
 		if test -n "$quiet"
 		then
@@ -282,7 +282,7 @@ if [ "$?" -eq 0 ]; then
 		fi
 	elif test -n "$detached"
 	then
-		old_branch_name=`expr "z$oldbranch" : 'zrefs/heads/\(.*\)'`
+		old_branch_name=$(expr "z$oldbranch" : 'zrefs/heads/\(.*\)')
 		git update-ref --no-deref -m "checkout: moving from ${old_branch_name:-$old} to $arg" HEAD "$detached" ||
 			die "Cannot detach HEAD"
 		if test -n "$detach_warn"
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 004/14] git-clone.sh: use the $( ... ) construct for command substitution
  2014-04-16 17:29 [PATCH 001/14] howto-index.sh: use the $( ... ) construct for command substitution Elia Pinto
  2014-04-16 17:29 ` [PATCH 002/14] install-webdoc.sh: " Elia Pinto
  2014-04-16 17:29 ` [PATCH 003/14] git-checkout.sh: " Elia Pinto
@ 2014-04-16 17:29 ` Elia Pinto
  2014-04-16 17:29 ` [PATCH 005/14] git-commit.sh: " Elia Pinto
                   ` (10 subsequent siblings)
  13 siblings, 0 replies; 16+ messages in thread
From: Elia Pinto @ 2014-04-16 17:29 UTC (permalink / raw)
  To: git; +Cc: 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/examples/git-clone.sh |   20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/contrib/examples/git-clone.sh b/contrib/examples/git-clone.sh
index 547228e..b4c9376 100755
--- a/contrib/examples/git-clone.sh
+++ b/contrib/examples/git-clone.sh
@@ -40,7 +40,7 @@ eval "$(echo "$OPTIONS_SPEC" | git rev-parse --parseopt -- "$@" || echo exit $?)
 
 get_repo_base() {
 	(
-		cd "`/bin/pwd`" &&
+		cd "$(/bin/pwd)" &&
 		cd "$1" || cd "$1.git" &&
 		{
 			cd .git
@@ -50,7 +50,7 @@ get_repo_base() {
 }
 
 if [ -n "$GIT_SSL_NO_VERIFY" -o \
-	"`git config --bool http.sslVerify`" = false ]; then
+	"$(git config --bool http.sslVerify)" = false ]; then
     curl_extra_args="-k"
 fi
 
@@ -70,7 +70,7 @@ clone_dumb_http () {
 	clone_tmp="$GIT_DIR/clone-tmp" &&
 	mkdir -p "$clone_tmp" || exit 1
 	if [ -n "$GIT_CURL_FTP_NO_EPSV" -o \
-		"`git config --bool http.noEPSV`" = true ]; then
+		"$(git config --bool http.noEPSV)" = true ]; then
 		curl_extra_args="${curl_extra_args} --disable-epsv"
 	fi
 	http_fetch "$1/info/refs" "$clone_tmp/refs" ||
@@ -79,7 +79,7 @@ Perhaps git-update-server-info needs to be run there?"
 	test "z$quiet" = z && v=-v || v=
 	while read sha1 refname
 	do
-		name=`expr "z$refname" : 'zrefs/\(.*\)'` &&
+		name=$(expr "z$refname" : 'zrefs/\(.*\)') &&
 		case "$name" in
 		*^*)	continue;;
 		esac
@@ -88,7 +88,7 @@ Perhaps git-update-server-info needs to be run there?"
 		*)	continue ;;
 		esac
 		if test -n "$use_separate_remote" &&
-		   branch_name=`expr "z$name" : 'zheads/\(.*\)'`
+		   branch_name=$(expr "z$name" : 'zheads/\(.*\)')
 		then
 			tname="remotes/$origin/$branch_name"
 		else
@@ -100,7 +100,7 @@ Perhaps git-update-server-info needs to be run there?"
 	http_fetch "$1/HEAD" "$GIT_DIR/REMOTE_HEAD" ||
 	rm -f "$GIT_DIR/REMOTE_HEAD"
 	if test -f "$GIT_DIR/REMOTE_HEAD"; then
-		head_sha1=`cat "$GIT_DIR/REMOTE_HEAD"`
+		head_sha1=$(cat "$GIT_DIR/REMOTE_HEAD")
 		case "$head_sha1" in
 		'ref: refs/'*)
 			;;
@@ -444,15 +444,15 @@ then
 	# a non-bare repository is always in separate-remote layout
 	remote_top="refs/remotes/$origin"
 	head_sha1=
-	test ! -r "$GIT_DIR/REMOTE_HEAD" || head_sha1=`cat "$GIT_DIR/REMOTE_HEAD"`
+	test ! -r "$GIT_DIR/REMOTE_HEAD" || head_sha1=$(cat "$GIT_DIR/REMOTE_HEAD")
 	case "$head_sha1" in
 	'ref: refs/'*)
 		# Uh-oh, the remote told us (http transport done against
 		# new style repository with a symref HEAD).
 		# Ideally we should skip the guesswork but for now
 		# opt for minimum change.
-		head_sha1=`expr "z$head_sha1" : 'zref: refs/heads/\(.*\)'`
-		head_sha1=`cat "$GIT_DIR/$remote_top/$head_sha1"`
+		head_sha1=$(expr "z$head_sha1" : 'zref: refs/heads/\(.*\)')
+		head_sha1=$(cat "$GIT_DIR/$remote_top/$head_sha1")
 		;;
 	esac
 
@@ -467,7 +467,7 @@ then
 		while read name
 		do
 			test t = $done && continue
-			branch_tip=`cat "$GIT_DIR/$remote_top/$name"`
+			branch_tip=$(cat "$GIT_DIR/$remote_top/$name")
 			if test "$head_sha1" = "$branch_tip"
 			then
 				echo "$name"
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 005/14] git-commit.sh: use the $( ... ) construct for command substitution
  2014-04-16 17:29 [PATCH 001/14] howto-index.sh: use the $( ... ) construct for command substitution Elia Pinto
                   ` (2 preceding siblings ...)
  2014-04-16 17:29 ` [PATCH 004/14] git-clone.sh: " Elia Pinto
@ 2014-04-16 17:29 ` Elia Pinto
  2014-04-16 17:29 ` [PATCH 006/14] git-fetch.sh: " Elia Pinto
                   ` (9 subsequent siblings)
  13 siblings, 0 replies; 16+ messages in thread
From: Elia Pinto @ 2014-04-16 17:29 UTC (permalink / raw)
  To: git; +Cc: 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/examples/git-commit.sh |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/contrib/examples/git-commit.sh b/contrib/examples/git-commit.sh
index 4aab1a6..5cafe2e 100755
--- a/contrib/examples/git-commit.sh
+++ b/contrib/examples/git-commit.sh
@@ -91,7 +91,7 @@ signoff=
 force_author=
 only_include_assumed=
 untracked_files=
-templatefile="`git config commit.template`"
+templatefile="$(git config commit.template)"
 while test $# != 0
 do
 	case "$1" in
@@ -350,7 +350,7 @@ t,)
 		TMP_INDEX="$GIT_DIR/tmp-index$$"
 		W=
 		test -z "$initial_commit" && W=--with-tree=HEAD
-		commit_only=`git ls-files --error-unmatch $W -- "$@"` || exit
+		commit_only=$(git ls-files --error-unmatch $W -- "$@") || exit
 
 		# Build a temporary index and update the real index
 		# the same way.
@@ -475,8 +475,8 @@ then
 fi
 if test '' != "$force_author"
 then
-	GIT_AUTHOR_NAME=`expr "z$force_author" : 'z\(.*[^ ]\) *<.*'` &&
-	GIT_AUTHOR_EMAIL=`expr "z$force_author" : '.*\(<.*\)'` &&
+	GIT_AUTHOR_NAME=$(expr "z$force_author" : 'z\(.*[^ ]\) *<.*') &&
+	GIT_AUTHOR_EMAIL=$(expr "z$force_author" : '.*\(<.*\)') &&
 	test '' != "$GIT_AUTHOR_NAME" &&
 	test '' != "$GIT_AUTHOR_EMAIL" ||
 	die "malformed --author parameter"
@@ -489,7 +489,7 @@ then
 	rloga='commit'
 	if [ -f "$GIT_DIR/MERGE_HEAD" ]; then
 		rloga='commit (merge)'
-		PARENTS="-p HEAD "`sed -e 's/^/-p /' "$GIT_DIR/MERGE_HEAD"`
+		PARENTS="-p HEAD "$(sed -e 's/^/-p /' "$GIT_DIR/MERGE_HEAD")
 	elif test -n "$amend"; then
 		rloga='commit (amend)'
 		PARENTS=$(git cat-file commit HEAD |
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 006/14] git-fetch.sh: use the $( ... ) construct for command substitution
  2014-04-16 17:29 [PATCH 001/14] howto-index.sh: use the $( ... ) construct for command substitution Elia Pinto
                   ` (3 preceding siblings ...)
  2014-04-16 17:29 ` [PATCH 005/14] git-commit.sh: " Elia Pinto
@ 2014-04-16 17:29 ` Elia Pinto
  2014-04-16 17:29 ` [PATCH 007/14] git-ls-remote.sh: " Elia Pinto
                   ` (8 subsequent siblings)
  13 siblings, 0 replies; 16+ messages in thread
From: Elia Pinto @ 2014-04-16 17:29 UTC (permalink / raw)
  To: git; +Cc: 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/examples/git-fetch.sh |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/contrib/examples/git-fetch.sh b/contrib/examples/git-fetch.sh
index a314273..5540709 100755
--- a/contrib/examples/git-fetch.sh
+++ b/contrib/examples/git-fetch.sh
@@ -67,7 +67,7 @@ do
 		keep='-k -k'
 		;;
 	--depth=*)
-		shallow_depth="--depth=`expr "z$1" : 'z-[^=]*=\(.*\)'`"
+		shallow_depth="--depth=$(expr "z$1" : 'z-[^=]*=\(.*\)')"
 		;;
 	--depth)
 		shift
@@ -262,12 +262,12 @@ fetch_per_ref () {
       http://* | https://* | ftp://*)
 	  test -n "$shallow_depth" &&
 		die "shallow clone with http not supported"
-	  proto=`expr "$remote" : '\([^:]*\):'`
+	  proto=$(expr "$remote" : '\([^:]*\):')
 	  if [ -n "$GIT_SSL_NO_VERIFY" ]; then
 	      curl_extra_args="-k"
 	  fi
 	  if [ -n "$GIT_CURL_FTP_NO_EPSV" -o \
-		"`git config --bool http.noEPSV`" = true ]; then
+		"$(git config --bool http.noEPSV)" = true ]; then
 	      noepsv_opt="--disable-epsv"
 	  fi
 
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 007/14] git-ls-remote.sh: use the $( ... ) construct for command substitution
  2014-04-16 17:29 [PATCH 001/14] howto-index.sh: use the $( ... ) construct for command substitution Elia Pinto
                   ` (4 preceding siblings ...)
  2014-04-16 17:29 ` [PATCH 006/14] git-fetch.sh: " Elia Pinto
@ 2014-04-16 17:29 ` Elia Pinto
  2014-04-16 17:29 ` [PATCH 008/14] git-merge.sh: " Elia Pinto
                   ` (7 subsequent siblings)
  13 siblings, 0 replies; 16+ messages in thread
From: Elia Pinto @ 2014-04-16 17:29 UTC (permalink / raw)
  To: git; +Cc: 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/examples/git-ls-remote.sh |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/contrib/examples/git-ls-remote.sh b/contrib/examples/git-ls-remote.sh
index fec70bb..2aa89a7 100755
--- a/contrib/examples/git-ls-remote.sh
+++ b/contrib/examples/git-ls-remote.sh
@@ -55,11 +55,11 @@ tmpdir=$tmp-d
 case "$peek_repo" in
 http://* | https://* | ftp://* )
 	if [ -n "$GIT_SSL_NO_VERIFY" -o \
-		"`git config --bool http.sslVerify`" = false ]; then
+		"$(git config --bool http.sslVerify)" = false ]; then
 		curl_extra_args="-k"
 	fi
 	if [ -n "$GIT_CURL_FTP_NO_EPSV" -o \
-		"`git config --bool http.noEPSV`" = true ]; then
+		"$(git config --bool http.noEPSV)" = true ]; then
 		curl_extra_args="${curl_extra_args} --disable-epsv"
 	fi
 	curl -nsf $curl_extra_args --header "Pragma: no-cache" "$peek_repo/info/refs" ||
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 008/14] git-merge.sh: use the $( ... ) construct for command substitution
  2014-04-16 17:29 [PATCH 001/14] howto-index.sh: use the $( ... ) construct for command substitution Elia Pinto
                   ` (5 preceding siblings ...)
  2014-04-16 17:29 ` [PATCH 007/14] git-ls-remote.sh: " Elia Pinto
@ 2014-04-16 17:29 ` Elia Pinto
  2014-04-16 17:29 ` [PATCH 009/14] git-repack.sh: " Elia Pinto
                   ` (6 subsequent siblings)
  13 siblings, 0 replies; 16+ messages in thread
From: Elia Pinto @ 2014-04-16 17:29 UTC (permalink / raw)
  To: git; +Cc: 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/examples/git-merge.sh |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/contrib/examples/git-merge.sh b/contrib/examples/git-merge.sh
index a5e42a9..7e40f40 100755
--- a/contrib/examples/git-merge.sh
+++ b/contrib/examples/git-merge.sh
@@ -341,7 +341,7 @@ case "$use_strategies" in
 '')
 	case "$#" in
 	1)
-		var="`git config --get pull.twohead`"
+		var="$(git config --get pull.twohead)"
 		if test -n "$var"
 		then
 			use_strategies="$var"
@@ -349,7 +349,7 @@ case "$use_strategies" in
 			use_strategies="$default_twohead_strategies"
 		fi ;;
 	*)
-		var="`git config --get pull.octopus`"
+		var="$(git config --get pull.octopus)"
 		if test -n "$var"
 		then
 			use_strategies="$var"
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 009/14] git-repack.sh: use the $( ... ) construct for command substitution
  2014-04-16 17:29 [PATCH 001/14] howto-index.sh: use the $( ... ) construct for command substitution Elia Pinto
                   ` (6 preceding siblings ...)
  2014-04-16 17:29 ` [PATCH 008/14] git-merge.sh: " Elia Pinto
@ 2014-04-16 17:29 ` Elia Pinto
  2014-04-16 17:29 ` [PATCH 010/14] git-resolve.sh: " Elia Pinto
                   ` (5 subsequent siblings)
  13 siblings, 0 replies; 16+ messages in thread
From: Elia Pinto @ 2014-04-16 17:29 UTC (permalink / raw)
  To: git; +Cc: 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/examples/git-repack.sh |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/contrib/examples/git-repack.sh b/contrib/examples/git-repack.sh
index 7579331..f312405 100755
--- a/contrib/examples/git-repack.sh
+++ b/contrib/examples/git-repack.sh
@@ -49,7 +49,7 @@ do
 	shift
 done
 
-case "`git config --bool repack.usedeltabaseoffset || echo true`" in
+case "$(git config --bool repack.usedeltabaseoffset || echo true)" in
 true)
 	extra="$extra --delta-base-offset" ;;
 esac
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 010/14] git-resolve.sh: use the $( ... ) construct for command substitution
  2014-04-16 17:29 [PATCH 001/14] howto-index.sh: use the $( ... ) construct for command substitution Elia Pinto
                   ` (7 preceding siblings ...)
  2014-04-16 17:29 ` [PATCH 009/14] git-repack.sh: " Elia Pinto
@ 2014-04-16 17:29 ` Elia Pinto
  2014-04-16 17:29 ` [PATCH 011/14] git-revert.sh: " Elia Pinto
                   ` (4 subsequent siblings)
  13 siblings, 0 replies; 16+ messages in thread
From: Elia Pinto @ 2014-04-16 17:29 UTC (permalink / raw)
  To: git; +Cc: 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/examples/git-resolve.sh |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/contrib/examples/git-resolve.sh b/contrib/examples/git-resolve.sh
index 8f98142..48d0fc9 100755
--- a/contrib/examples/git-resolve.sh
+++ b/contrib/examples/git-resolve.sh
@@ -75,7 +75,7 @@ case "$common" in
 		GIT_INDEX_FILE=$G git read-tree -m $c $head $merge \
 			2>/dev/null || continue
 		# Count the paths that are unmerged.
-		cnt=`GIT_INDEX_FILE=$G git ls-files --unmerged | wc -l`
+		cnt=$(GIT_INDEX_FILE=$G git ls-files --unmerged | wc -l)
 		if test $best_cnt -le 0 -o $cnt -le $best_cnt
 		then
 			best=$c
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 011/14] git-revert.sh: use the $( ... ) construct for command substitution
  2014-04-16 17:29 [PATCH 001/14] howto-index.sh: use the $( ... ) construct for command substitution Elia Pinto
                   ` (8 preceding siblings ...)
  2014-04-16 17:29 ` [PATCH 010/14] git-resolve.sh: " Elia Pinto
@ 2014-04-16 17:29 ` Elia Pinto
  2014-04-16 17:29 ` [PATCH 012/14] git-tag.sh: " Elia Pinto
                   ` (3 subsequent siblings)
  13 siblings, 0 replies; 16+ messages in thread
From: Elia Pinto @ 2014-04-16 17:29 UTC (permalink / raw)
  To: git; +Cc: 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/examples/git-revert.sh |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/contrib/examples/git-revert.sh b/contrib/examples/git-revert.sh
index 6bf155c..7e2aad5 100755
--- a/contrib/examples/git-revert.sh
+++ b/contrib/examples/git-revert.sh
@@ -137,7 +137,7 @@ cherry-pick)
 		q
 	}'
 
-	logmsg=`git show -s --pretty=raw --encoding="$encoding" "$commit"`
+	logmsg=$(git show -s --pretty=raw --encoding="$encoding" "$commit")
 	set_author_env=`echo "$logmsg" |
 	LANG=C LC_ALL=C sed -ne "$pick_author_script"`
 	eval "$set_author_env"
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 012/14] git-tag.sh: use the $( ... ) construct for command substitution
  2014-04-16 17:29 [PATCH 001/14] howto-index.sh: use the $( ... ) construct for command substitution Elia Pinto
                   ` (9 preceding siblings ...)
  2014-04-16 17:29 ` [PATCH 011/14] git-revert.sh: " Elia Pinto
@ 2014-04-16 17:29 ` Elia Pinto
  2014-04-16 17:29 ` [PATCH 013/14] t9360-mw-to-git-clone.sh: " Elia Pinto
                   ` (2 subsequent siblings)
  13 siblings, 0 replies; 16+ messages in thread
From: Elia Pinto @ 2014-04-16 17:29 UTC (permalink / raw)
  To: git; +Cc: 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/examples/git-tag.sh |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/contrib/examples/git-tag.sh b/contrib/examples/git-tag.sh
index 2c15bc9..1bd8f3c 100755
--- a/contrib/examples/git-tag.sh
+++ b/contrib/examples/git-tag.sh
@@ -156,7 +156,7 @@ prev=0000000000000000000000000000000000000000
 if git show-ref --verify --quiet -- "refs/tags/$name"
 then
     test -n "$force" || die "tag '$name' already exists"
-    prev=`git rev-parse "refs/tags/$name"`
+    prev=$(git rev-parse "refs/tags/$name")
 fi
 shift
 git check-ref-format "tags/$name" ||
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 013/14] t9360-mw-to-git-clone.sh: use the $( ... ) construct for command substitution
  2014-04-16 17:29 [PATCH 001/14] howto-index.sh: use the $( ... ) construct for command substitution Elia Pinto
                   ` (10 preceding siblings ...)
  2014-04-16 17:29 ` [PATCH 012/14] git-tag.sh: " Elia Pinto
@ 2014-04-16 17:29 ` Elia Pinto
  2014-04-16 17:29 ` [PATCH 014/14] t9362-mw-to-git-utf8.sh: " Elia Pinto
  2014-04-17  9:00 ` [PATCH 001/14] howto-index.sh: " Matthieu Moy
  13 siblings, 0 replies; 16+ messages in thread
From: Elia Pinto @ 2014-04-16 17:29 UTC (permalink / raw)
  To: git; +Cc: 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/t9360-mw-to-git-clone.sh |   14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/contrib/mw-to-git/t/t9360-mw-to-git-clone.sh b/contrib/mw-to-git/t/t9360-mw-to-git-clone.sh
index 811a90c..22f069d 100755
--- a/contrib/mw-to-git/t/t9360-mw-to-git-clone.sh
+++ b/contrib/mw-to-git/t/t9360-mw-to-git-clone.sh
@@ -191,10 +191,10 @@ test_expect_success 'Git clone works with the shallow option' '
 	test_path_is_file mw_dir_11/Main_Page.mw &&
 	(
 		cd mw_dir_11 &&
-		test `git log --oneline Nyan.mw | wc -l` -eq 1 &&
-		test `git log --oneline Foo.mw | wc -l` -eq 1 &&
-		test `git log --oneline Bar.mw | wc -l` -eq 1 &&
-		test `git log --oneline Main_Page.mw | wc -l ` -eq 1
+		test $(git log --oneline Nyan.mw | wc -l) -eq 1 &&
+		test $(git log --oneline Foo.mw | wc -l) -eq 1 &&
+		test $(git log --oneline Bar.mw | wc -l) -eq 1 &&
+		test $(git log --oneline Main_Page.mw | wc -l ) -eq 1
 	) &&
 	wiki_check_content mw_dir_11/Nyan.mw Nyan &&
 	wiki_check_content mw_dir_11/Foo.mw Foo &&
@@ -218,9 +218,9 @@ test_expect_success 'Git clone works with the shallow option with a delete page'
 	test_path_is_file mw_dir_12/Main_Page.mw &&
 	(
 		cd mw_dir_12 &&
-		test `git log --oneline Nyan.mw | wc -l` -eq 1 &&
-		test `git log --oneline Bar.mw | wc -l` -eq 1 &&
-		test `git log --oneline Main_Page.mw | wc -l ` -eq 1
+		test $(git log --oneline Nyan.mw | wc -l) -eq 1 &&
+		test $(git log --oneline Bar.mw | wc -l) -eq 1 &&
+		test $(git log --oneline Main_Page.mw | wc -l ) -eq 1
 	) &&
 	wiki_check_content mw_dir_12/Nyan.mw Nyan &&
 	wiki_check_content mw_dir_12/Bar.mw Bar &&
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 014/14] t9362-mw-to-git-utf8.sh: use the $( ... ) construct for command substitution
  2014-04-16 17:29 [PATCH 001/14] howto-index.sh: use the $( ... ) construct for command substitution Elia Pinto
                   ` (11 preceding siblings ...)
  2014-04-16 17:29 ` [PATCH 013/14] t9360-mw-to-git-clone.sh: " Elia Pinto
@ 2014-04-16 17:29 ` Elia Pinto
  2014-04-17  9:00 ` [PATCH 001/14] howto-index.sh: " Matthieu Moy
  13 siblings, 0 replies; 16+ messages in thread
From: Elia Pinto @ 2014-04-16 17:29 UTC (permalink / raw)
  To: git; +Cc: 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/t9362-mw-to-git-utf8.sh |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/contrib/mw-to-git/t/t9362-mw-to-git-utf8.sh b/contrib/mw-to-git/t/t9362-mw-to-git-utf8.sh
index 37021e2..6b0dbda 100755
--- a/contrib/mw-to-git/t/t9362-mw-to-git-utf8.sh
+++ b/contrib/mw-to-git/t/t9362-mw-to-git-utf8.sh
@@ -70,8 +70,8 @@ test_expect_success 'The shallow option works with accents' '
 	test_path_is_file mw_dir_4/Main_Page.mw &&
 	(
 		cd mw_dir_4 &&
-		test `git log --oneline Néoà.mw | wc -l` -eq 1 &&
-		test `git log --oneline Main_Page.mw | wc -l ` -eq 1
+		test $(git log --oneline Néoà.mw | wc -l) -eq 1 &&
+		test $(git log --oneline Main_Page.mw | wc -l ) -eq 1
 	) &&
 	wiki_check_content mw_dir_4/Néoà.mw Néoà &&
 	wiki_check_content mw_dir_4/Main_Page.mw Main_Page
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* Re: [PATCH 001/14] howto-index.sh: use the $( ... ) construct for command substitution
  2014-04-16 17:29 [PATCH 001/14] howto-index.sh: use the $( ... ) construct for command substitution Elia Pinto
                   ` (12 preceding siblings ...)
  2014-04-16 17:29 ` [PATCH 014/14] t9362-mw-to-git-utf8.sh: " Elia Pinto
@ 2014-04-17  9:00 ` Matthieu Moy
  2014-04-17 18:25   ` Junio C Hamano
  13 siblings, 1 reply; 16+ messages in thread
From: Matthieu Moy @ 2014-04-17  9:00 UTC (permalink / raw)
  To: Elia Pinto; +Cc: git

Elia Pinto <gitter.spiros@gmail.com> writes:

> The Git CodingGuidelines prefer the $(...) construct for command
> substitution instead of using the backquotes `...`.

For patches 1 to 14:

Reviewed-by: Matthieu Moy <Matthieu.Moy@imag.fr>

(reviewed the patches in my mailer, and the "diff --color-words=." after
applying in addition)

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 001/14] howto-index.sh: use the $( ... ) construct for command substitution
  2014-04-17  9:00 ` [PATCH 001/14] howto-index.sh: " Matthieu Moy
@ 2014-04-17 18:25   ` Junio C Hamano
  0 siblings, 0 replies; 16+ messages in thread
From: Junio C Hamano @ 2014-04-17 18:25 UTC (permalink / raw)
  To: Matthieu Moy; +Cc: Elia Pinto, git

Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:

> Elia Pinto <gitter.spiros@gmail.com> writes:
>
>> The Git CodingGuidelines prefer the $(...) construct for command
>> substitution instead of using the backquotes `...`.
>
> For patches 1 to 14:
>
> Reviewed-by: Matthieu Moy <Matthieu.Moy@imag.fr>
>
> (reviewed the patches in my mailer, and the "diff --color-words=." after
> applying in addition)

Thanks both.

Ideally, we should keep these scripted Porcelain implementations in
the contrib/examples/ hierarchy up-to-date to still work with the
recent versions of Git as they used to.  We do not need to backport
new features, but they should follow the best-current-practice of
the use of plumbing features and scripting in general, and this
update is probably a step in the right direction.  It is somewhat
sad that these are not tested but I do not think of an unintrusive
easy way to keep them also in the test suite.

Will queue.

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2014-04-17 18:25 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-16 17:29 [PATCH 001/14] howto-index.sh: use the $( ... ) construct for command substitution Elia Pinto
2014-04-16 17:29 ` [PATCH 002/14] install-webdoc.sh: " Elia Pinto
2014-04-16 17:29 ` [PATCH 003/14] git-checkout.sh: " Elia Pinto
2014-04-16 17:29 ` [PATCH 004/14] git-clone.sh: " Elia Pinto
2014-04-16 17:29 ` [PATCH 005/14] git-commit.sh: " Elia Pinto
2014-04-16 17:29 ` [PATCH 006/14] git-fetch.sh: " Elia Pinto
2014-04-16 17:29 ` [PATCH 007/14] git-ls-remote.sh: " Elia Pinto
2014-04-16 17:29 ` [PATCH 008/14] git-merge.sh: " Elia Pinto
2014-04-16 17:29 ` [PATCH 009/14] git-repack.sh: " Elia Pinto
2014-04-16 17:29 ` [PATCH 010/14] git-resolve.sh: " Elia Pinto
2014-04-16 17:29 ` [PATCH 011/14] git-revert.sh: " Elia Pinto
2014-04-16 17:29 ` [PATCH 012/14] git-tag.sh: " Elia Pinto
2014-04-16 17:29 ` [PATCH 013/14] t9360-mw-to-git-clone.sh: " Elia Pinto
2014-04-16 17:29 ` [PATCH 014/14] t9362-mw-to-git-utf8.sh: " Elia Pinto
2014-04-17  9:00 ` [PATCH 001/14] howto-index.sh: " Matthieu Moy
2014-04-17 18:25   ` Junio C Hamano

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.