* [PATCH] Fix problematic ']'
@ 2007-07-23 20:36 Johannes Sixt
2007-07-23 20:51 ` Johannes Schindelin
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Johannes Sixt @ 2007-07-23 20:36 UTC (permalink / raw)
To: git; +Cc: Johannes Schindelin
Not all shells grok a closing ']' of the shell '[' command without
surrounding space.
Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
---
I didn't go the long way to change all `[ ... ]` into `test ...`
git-rebase--interactive.sh | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
index 579a45e..e0d1326 100755
--- a/git-rebase--interactive.sh
+++ b/git-rebase--interactive.sh
@@ -385,7 +385,7 @@ do
require_clean_work_tree
- if [ ! -z "$2"]
+ if [ ! -z "$2" ]
then
git show-ref --verify --quiet "refs/heads/$2" ||
die "Invalid branchname: $2"
--
1.5.3.rc0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] Fix problematic ']'
2007-07-23 20:36 [PATCH] Fix problematic ']' Johannes Sixt
@ 2007-07-23 20:51 ` Johannes Schindelin
2007-07-23 20:58 ` Timo Hirvonen
2007-07-24 2:01 ` Junio C Hamano
2 siblings, 0 replies; 5+ messages in thread
From: Johannes Schindelin @ 2007-07-23 20:51 UTC (permalink / raw)
To: Johannes Sixt; +Cc: git
Hi,
On Mon, 23 Jul 2007, Johannes Sixt wrote:
> Not all shells grok a closing ']' of the shell '[' command without
> surrounding space.
Darn.
Thanks for cleaning up behind me,
Dscho
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Fix problematic ']'
2007-07-23 20:36 [PATCH] Fix problematic ']' Johannes Sixt
2007-07-23 20:51 ` Johannes Schindelin
@ 2007-07-23 20:58 ` Timo Hirvonen
2007-07-24 2:01 ` Junio C Hamano
2 siblings, 0 replies; 5+ messages in thread
From: Timo Hirvonen @ 2007-07-23 20:58 UTC (permalink / raw)
To: Johannes Sixt; +Cc: git, Johannes Schindelin
Johannes Sixt <johannes.sixt@telecom.at> wrote:
> Not all shells grok a closing ']' of the shell '[' command without
> surrounding space.
That's one good reason to use test instead of /usr/bin/[ hack (yes it
has been a shell built-in for a long time). [ is just like test but
expects ] as last parameter and ignores it. Very ugly IMO.
--
http://onion.dynserv.net/~timo/
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Fix problematic ']'
2007-07-23 20:36 [PATCH] Fix problematic ']' Johannes Sixt
2007-07-23 20:51 ` Johannes Schindelin
2007-07-23 20:58 ` Timo Hirvonen
@ 2007-07-24 2:01 ` Junio C Hamano
2007-07-24 2:18 ` [PATCH] rebase -i: exchange all "if [ .. ]" by "if test .." Johannes Schindelin
2 siblings, 1 reply; 5+ messages in thread
From: Junio C Hamano @ 2007-07-24 2:01 UTC (permalink / raw)
To: Johannes Sixt; +Cc: git, Johannes Schindelin
Johannes Sixt <johannes.sixt@telecom.at> writes:
> Not all shells grok a closing ']' of the shell '[' command without
> surrounding space.
>
> Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
> ---
>
> I didn't go the long way to change all `[ ... ]` into `test ...`
Maybe that would have been a better idea.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] rebase -i: exchange all "if [ .. ]" by "if test .."
2007-07-24 2:01 ` Junio C Hamano
@ 2007-07-24 2:18 ` Johannes Schindelin
0 siblings, 0 replies; 5+ messages in thread
From: Johannes Schindelin @ 2007-07-24 2:18 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Johannes Sixt, git
This patch is literally
:%s/if \[ *\(.*[^ ]\) *\]/if test \1/
in vi, after making sure that the other instances of "[..]" are not
actually invocations of "test".
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
On Mon, 23 Jul 2007, Junio C Hamano wrote:
> Johannes Sixt <johannes.sixt@telecom.at> writes:
>
> > Not all shells grok a closing ']' of the shell '[' command without
> > surrounding space.
> >
> > Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
> > ---
> >
> > I didn't go the long way to change all `[ ... ]` into `test ...`
>
> Maybe that would have been a better idea.
Voila.
(Obviously, this is on top of my last patch to rebase -i, to bug
you into applying it ;-)
Seriously again, if I should rather redo it relative to "master",
please say so. Or apply the regsub and get all the karma for
free...
git-rebase--interactive.sh | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
index ac1f5a2..93289c0 100755
--- a/git-rebase--interactive.sh
+++ b/git-rebase--interactive.sh
@@ -102,7 +102,7 @@ pick_one () {
pick_one_preserving_merges "$@" && return
parent_sha1=$(git rev-parse --verify $sha1^ 2>/dev/null)
current_sha1=$(git rev-parse --verify HEAD)
- if [ $current_sha1 = $parent_sha1 ]; then
+ if test $current_sha1 = $parent_sha1; then
output git reset --hard $sha1
test "a$1" = a-n && output git reset --soft $current_sha1
sha1=$(git rev-parse --short $sha1)
@@ -116,7 +116,7 @@ pick_one_preserving_merges () {
case "$1" in -n) sha1=$2 ;; *) sha1=$1 ;; esac
sha1=$(git rev-parse $sha1)
- if [ -f "$DOTEST"/current-commit ]
+ if test -f "$DOTEST"/current-commit
then
current_commit=$(cat "$DOTEST"/current-commit) &&
git rev-parse HEAD > "$REWRITTEN"/$current_commit &&
@@ -130,7 +130,7 @@ pick_one_preserving_merges () {
new_parents=
for p in $(git rev-list --parents -1 $sha1 | cut -d\ -f2-)
do
- if [ -f "$REWRITTEN"/$p ]
+ if test -f "$REWRITTEN"/$p
then
preserve=f
new_p=$(cat "$REWRITTEN"/$p)
@@ -188,7 +188,7 @@ nth_string () {
}
make_squash_message () {
- if [ -f "$SQUASH_MSG" ]; then
+ if test -f "$SQUASH_MSG"; then
COUNT=$(($(sed -n "s/^# This is [^0-9]*\([0-9]\+\).*/\1/p" \
< "$SQUASH_MSG" | tail -n 1)+1))
echo "# This is a combination of $COUNT commits."
@@ -286,7 +286,7 @@ do_next () {
HEADNAME=$(cat "$DOTEST"/head-name) &&
OLDHEAD=$(cat "$DOTEST"/head) &&
SHORTONTO=$(git rev-parse --short $(cat "$DOTEST"/onto)) &&
- if [ -d "$REWRITTEN" ]
+ if test -d "$REWRITTEN"
then
test -f "$DOTEST"/current-commit &&
current_commit=$(cat "$DOTEST"/current-commit) &&
@@ -403,7 +403,7 @@ do
require_clean_work_tree
- if [ ! -z "$2"]
+ if test ! -z "$2"
then
output git show-ref --verify --quiet "refs/heads/$2" ||
die "Invalid branchname: $2"
@@ -426,7 +426,7 @@ do
echo $ONTO > "$DOTEST"/onto
test -z "$STRATEGY" || echo "$STRATEGY" > "$DOTEST"/strategy
test t = "$VERBOSE" && : > "$DOTEST"/verbose
- if [ t = "$PRESERVE_MERGES" ]
+ if test t = "$PRESERVE_MERGES"
then
# $REWRITTEN contains files for each commit that is
# reachable by at least one merge base of $HEAD and
--
1.5.3.rc2.32.g35c5b-dirty
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2007-07-24 2:18 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-23 20:36 [PATCH] Fix problematic ']' Johannes Sixt
2007-07-23 20:51 ` Johannes Schindelin
2007-07-23 20:58 ` Timo Hirvonen
2007-07-24 2:01 ` Junio C Hamano
2007-07-24 2:18 ` [PATCH] rebase -i: exchange all "if [ .. ]" by "if test .." Johannes Schindelin
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).