* [PATCH] rebase: standardize on $() for command substitution
@ 2007-11-01 4:50 Dan McGee
2007-11-01 5:16 ` Junio C Hamano
0 siblings, 1 reply; 3+ messages in thread
From: Dan McGee @ 2007-11-01 4:50 UTC (permalink / raw)
To: git; +Cc: Dan McGee
Commit 889a50e909dba5f4416049afc5eeae601fe133bc changed several `` to $()
format for command substitution, so we should standardize on one format
for clarity.
Signed-off-by: Dan McGee <dpmcgee@gmail.com>
---
git-rebase.sh | 16 ++++++++--------
1 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/git-rebase.sh b/git-rebase.sh
index 224cca9..63dea56 100755
--- a/git-rebase.sh
+++ b/git-rebase.sh
@@ -59,7 +59,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"
@@ -74,7 +74,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"
@@ -203,7 +203,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 ;;
*)
@@ -265,7 +265,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.
@@ -288,9 +288,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
@@ -343,11 +343,11 @@ fi
mkdir -p "$dotest"
echo "$onto" > "$dotest/onto"
echo "$onto_name" > "$dotest/onto_name"
-prev_head=`git rev-parse HEAD^0`
+prev_head=$(git rev-parse HEAD^0)
echo "$prev_head" > "$dotest/prev_head"
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.3.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] rebase: standardize on $() for command substitution
2007-11-01 4:50 [PATCH] rebase: standardize on $() for command substitution Dan McGee
@ 2007-11-01 5:16 ` Junio C Hamano
2007-11-01 5:27 ` Dan McGee
0 siblings, 1 reply; 3+ messages in thread
From: Junio C Hamano @ 2007-11-01 5:16 UTC (permalink / raw)
To: Dan McGee; +Cc: git
Dan McGee <dpmcgee@gmail.com> writes:
> Commit 889a50e909dba5f4416049afc5eeae601fe133bc changed several `` to $()
> format for command substitution, so we should standardize on one format
> for clarity.
> ...
> @@ -203,7 +203,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 ;;
> *)
The patch might have meant well, but it is a rather unnecessary
code churn without fixing anything and introducing a bug X-<.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] rebase: standardize on $() for command substitution
2007-11-01 5:16 ` Junio C Hamano
@ 2007-11-01 5:27 ` Dan McGee
0 siblings, 0 replies; 3+ messages in thread
From: Dan McGee @ 2007-11-01 5:27 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
On 11/1/07, Junio C Hamano <gitster@pobox.com> wrote:
> Dan McGee <dpmcgee@gmail.com> writes:
>
> > Commit 889a50e909dba5f4416049afc5eeae601fe133bc changed several `` to $()
> > format for command substitution, so we should standardize on one format
> > for clarity.
> > ...
> > @@ -203,7 +203,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 ;;
> > *)
>
> The patch might have meant well, but it is a rather unnecessary
> code churn without fixing anything and introducing a bug X-<.
Wow, back to the drawing board here. I've been up too long today.
-Dan
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-11-01 5:28 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-01 4:50 [PATCH] rebase: standardize on $() for command substitution Dan McGee
2007-11-01 5:16 ` Junio C Hamano
2007-11-01 5:27 ` Dan McGee
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).