From: Jari Aalto <jari.aalto@cante.net>
To: git@vger.kernel.org
Subject: [PATCH] git-rebase.sh: Use POSIX/Susv command substitution instead of backticks
Date: Wed, 06 Feb 2008 00:08:06 +0200 [thread overview]
Message-ID: <lk5zxdix.fsf@blue.sea.net> (raw)
Use redable $(<command>) syntax instead of backtics in code. See The
Open Group Base Specifications Issue 6, IEEE Std 1003.1, 2004 Edition
Signed-off-by: Jari Aalto <jari.aalto AT cante.net>
---
See http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag_02_06_03
git-rebase.sh | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/git-rebase.sh b/git-rebase.sh
index bdcea0e..d2b329f 100755
--- a/git-rebase.sh
+++ b/git-rebase.sh
@@ -60,7 +60,7 @@ continue_merge () {
die "$RESOLVEMSG"
fi
- cmt=`cat "$dotest/current"`
+ cmt=$(cat "$dotest/current")
if ! git diff-index --quiet HEAD --
then
if ! git-commit -C "$cmt"
@@ -75,7 +75,7 @@ continue_merge () {
fi
git rev-list --pretty=oneline -1 "$cmt" | sed -e 's/^[^ ]* //'
- prev_head=`git rev-parse HEAD^0`
+ prev_head=$(git rev-parse HEAD^0)
# save the resulting commit so we can read-tree on it later
echo "$prev_head" > "$dotest/prev_head"
@@ -233,7 +233,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 ;;
*)
@@ -295,7 +295,7 @@ esac
# The upstream head must be given. Make sure it is valid.
upstream_name="$1"
-upstream=`git rev-parse --verify "${upstream_name}^0"` ||
+upstream=$(git rev-parse --verify "${upstream_name}^0") ||
die "invalid upstream $upstream_name"
# Make sure the branch to rebase onto is valid.
@@ -318,9 +318,9 @@ case "$#" in
git-checkout "$2" || usage
;;
*)
- if branch_name=`git symbolic-ref -q HEAD`
+ if branch_name=$(git symbolic-ref -q HEAD)
then
- branch_name=`expr "z$branch_name" : 'zrefs/heads/\(.*\)'`
+ branch_name=$(expr "z$branch_name" : 'zrefs/heads/\(.*\)')
else
branch_name=HEAD ;# detached
fi
@@ -399,7 +399,7 @@ echo "$orig_head" > "$dotest/orig-head"
echo "$head_name" > "$dotest/head-name"
msgnum=0
-for cmt in `git rev-list --reverse --no-merges "$upstream"..ORIG_HEAD`
+for cmt in $(git rev-list --reverse --no-merges "$upstream"..ORIG_HEAD)
do
msgnum=$(($msgnum + 1))
echo "$cmt" > "$dotest/cmt.$msgnum"
--
1.5.4-rc5.GIT-dirty
--
Welcome to FOSS revolution: we fix and modify until it shines
next reply other threads:[~2008-02-05 22:09 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-05 22:08 Jari Aalto [this message]
2008-02-05 22:27 ` [PATCH] git-rebase.sh: Use POSIX/Susv command substitution instead of backticks Johannes Schindelin
2008-02-05 22:53 ` Jari Aalto
2008-02-05 23:06 ` Johannes Schindelin
2008-02-06 0:59 ` Junio C Hamano
2008-02-06 2:03 ` Junio C Hamano
2008-02-06 9:23 ` Ralf Wildenhues
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=lk5zxdix.fsf@blue.sea.net \
--to=jari.aalto@cante.net \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox