git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [GUILT 1/6] Refuse to push corrupt patches
@ 2011-09-28 14:15 Alan Jenkins
  2011-09-28 14:15 ` [GUILT 2/6] guilt-header: fix patch corruption Alan Jenkins
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Alan Jenkins @ 2011-09-28 14:15 UTC (permalink / raw)
  To: jeffpc; +Cc: git, Alan Jenkins

"guilt push" would treat corrupt patches as empty,
because "git apply --numstat" prints nothing on stdout.

(You do get an error message on stderr,
 but then guilt says "Patch applied" etc,
 and I didn't notice the earlier error message
 for quite some time.)

Signed-off-by: Alan Jenkins <alan.christopher.jenkins@googlemail.com>
---
 guilt |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/guilt b/guilt
index d1e17d4..51532f9 100755
--- a/guilt
+++ b/guilt
@@ -611,7 +611,7 @@ push_patch()
 		cd_to_toplevel
 
 		# apply the patch if and only if there is something to apply
-		if [ `git apply --numstat "$p" | wc -l` -gt 0 ]; then
+		if [ `do_get_patch "$p" | wc -l` -gt 0 ]; then
 			if [ "$bail_action" = abort ]; then
 				reject=""
 			fi
-- 
1.7.4.1

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

* [GUILT 2/6] guilt-header: fix patch corruption
  2011-09-28 14:15 [GUILT 1/6] Refuse to push corrupt patches Alan Jenkins
@ 2011-09-28 14:15 ` Alan Jenkins
  2011-09-28 14:15 ` [GUILT 3/6] Handle paths that contain spaces Alan Jenkins
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Alan Jenkins @ 2011-09-28 14:15 UTC (permalink / raw)
  To: jeffpc; +Cc: git, Alan Jenkins

Hunks containing the string "END{}" were being corrupted.

Signed-off-by: Alan Jenkins <alan.christopher.jenkins@googlemail.com>
---
 guilt |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/guilt b/guilt
index 51532f9..5d79e0f 100755
--- a/guilt
+++ b/guilt
@@ -341,7 +341,9 @@ do_get_patch()
 {
 	cat "$1" | awk '
 BEGIN{}
-/^(diff |---$|--- )/,/END{}/
+/^(diff |---$|--- )/ {patch = 1}
+patch == 1 {print $0}
+END{}
 '
 }
 
-- 
1.7.4.1

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

* [GUILT 3/6] Handle paths that contain spaces
  2011-09-28 14:15 [GUILT 1/6] Refuse to push corrupt patches Alan Jenkins
  2011-09-28 14:15 ` [GUILT 2/6] guilt-header: fix patch corruption Alan Jenkins
@ 2011-09-28 14:15 ` Alan Jenkins
  2011-09-28 14:15 ` [GUILT 4/6] Run regression tests in a directory which contains spaces Alan Jenkins
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Alan Jenkins @ 2011-09-28 14:15 UTC (permalink / raw)
  To: jeffpc; +Cc: git, Alan Jenkins


Signed-off-by: Alan Jenkins <alan.christopher.jenkins@googlemail.com>
---
 guilt           |    6 +++---
 guilt-applied   |    4 ++--
 guilt-files     |    4 ++--
 guilt-fold      |    2 +-
 guilt-new       |    2 +-
 guilt-next      |    2 +-
 guilt-pop       |   12 ++++++------
 guilt-push      |    6 +++---
 guilt-series    |    4 ++--
 guilt-unapplied |    2 +-
 10 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/guilt b/guilt
index 5d79e0f..9f06b41 100755
--- a/guilt
+++ b/guilt
@@ -196,7 +196,7 @@ get_full_series()
 
 		p
 		}
-		" $series
+		" "$series"
 }
 
 get_series()
@@ -632,7 +632,7 @@ push_patch()
 
 		commit "$pname" HEAD
 
-		echo "$pname" >> $applied
+		echo "$pname" >> "$applied"
 
 		rm -f "$TMP_LOG"
 	)
@@ -739,7 +739,7 @@ __refresh_patch()
 
 		# move the new patch in
 		mv "$p" "$p~"
-		mv "$TMP_DIFF" $p
+		mv "$TMP_DIFF" "$p"
 
 		# commit
 		commit "$pname" "HEAD~$3"
diff --git a/guilt-applied b/guilt-applied
index ead787b..a1f684a 100755
--- a/guilt-applied
+++ b/guilt-applied
@@ -14,7 +14,7 @@ _main() {
 case $# in
 	0)
 		# just output the regular series-style applied list
-		cat $applied
+		cat "$applied"
 	;;
 
 	1)
@@ -22,7 +22,7 @@ case $# in
 			usage
 		fi
 
-		cat $applied | while read pname; do
+		cat "$applied" | while read pname; do
 			git show-ref refs/patches/$branch/$pname | sed -e "s,refs/patches/$branch/,,"
 		done
 	;;
diff --git a/guilt-files b/guilt-files
index 9188070..f31a94c 100755
--- a/guilt-files
+++ b/guilt-files
@@ -34,9 +34,9 @@ top_patch=`get_top`
 
 IFS=:
 if [ -n "$opt_all" ]; then
-	cat $applied
+	cat "$applied"
 else
-	tail -n 1 $applied
+	tail -n 1 "$applied"
 fi | while read patch; do
 	obj=`git rev-parse refs/patches/$branch/$patch`
 
diff --git a/guilt-fold b/guilt-fold
index 9bf0d6e..06fbb7f 100755
--- a/guilt-fold
+++ b/guilt-fold
@@ -36,7 +36,7 @@ if ! must_commit_first; then
 fi
 
 # make sure it is not applied
-pline=`cat $applied | grep -e "^$patch$"`
+pline=`cat "$applied" | grep -e "^$patch$"`
 if [ ! -z "$pline" ]; then
 	die "Patch is applied. Pop the patch first."
 fi
diff --git a/guilt-new b/guilt-new
index c660dfc..402104e 100755
--- a/guilt-new
+++ b/guilt-new
@@ -95,7 +95,7 @@ fi
 series_insert_patch "$patch"
 
 # apply the patch
-echo "$patch" >> $applied
+echo "$patch" >> "$applied"
 commit "$patch" HEAD
 
 }
diff --git a/guilt-next b/guilt-next
index 5ac026b..a0941fc 100755
--- a/guilt-next
+++ b/guilt-next
@@ -21,7 +21,7 @@ while [ $# -ne 0 ]; do
 	shift
 done
 
-n=`wc -l < $applied`
+n=`wc -l < "$applied"`
 n=$(($n + 1))
 
 p=`get_series | awk "{ if (NR == $n) print \\$0}"`
diff --git a/guilt-pop b/guilt-pop
index 77d2c88..df466c7 100755
--- a/guilt-pop
+++ b/guilt-pop
@@ -55,14 +55,14 @@ if [ ! -s "$applied" ]; then
 elif [ "$patch" = "-a" ]; then
 	# we are supposed to pop all patches
 
-	sidx=`wc -l < $applied`
+	sidx=`wc -l < "$applied"`
 	eidx=0
 elif [ ! -z "$num" ]; then
 	# we are supposed to pop a set number of patches
 
 	[ "$patch" -lt 0 ] && die "Invalid number of patches to pop."
 
-	sidx=`wc -l < $applied`
+	sidx=`wc -l < "$applied"`
 	eidx=`expr $sidx - $patch`
 
 	# catch underflow
@@ -71,19 +71,19 @@ elif [ ! -z "$num" ]; then
 elif [ -z "$patch" ]; then
 	# we are supposed to pop only the current patch on the stack
 
-	sidx=`wc -l < $applied`
+	sidx=`wc -l < "$applied"`
 	eidx=`expr $sidx - 1`
 else
 	# we're supposed to pop only up to a patch, make sure the patch is
 	# in the series
 
-	eidx=`cat $applied | grep -ne "^$patch$" | cut -d: -f 1`
+	eidx=`cat "$applied" | grep -ne "^$patch$" | cut -d: -f 1`
 	if [ -z "$eidx" ]; then
 		die "Patch $patch is not in the series/is not applied"
 	fi
 
 	eidx=`expr $eidx - 1`
-	sidx=`wc -l < $applied`
+	sidx=`wc -l < "$applied"`
 fi
 
 # make sure that there are no unapplied changes
@@ -94,7 +94,7 @@ elif ! must_commit_first; then
 	die "Uncommited changes detected. Refresh first."
 fi
 
-l=`awk "BEGIN{n=0}(n==$eidx){print \\$0; exit}{n=n+1}END{}" < $applied`
+l=`awk "BEGIN{n=0}(n==$eidx){print \\$0; exit}{n=n+1}END{}" < "$applied"`
 
 pop_many_patches `git rev-parse refs/patches/$branch/$l^` `expr $sidx - $eidx`
 
diff --git a/guilt-push b/guilt-push
index 05bcef5..d9a8590 100755
--- a/guilt-push
+++ b/guilt-push
@@ -72,7 +72,7 @@ elif [ ! -z "$num" ]; then
 	eidx=`get_series | wc -l`
 
 	# calculate end index from current
-	tidx=`wc -l < $applied`
+	tidx=`wc -l < "$applied"`
 	tidx=`expr $tidx + $patch`
 
 	# clamp to minimum
@@ -81,7 +81,7 @@ elif [ ! -z "$num" ]; then
 elif [ -z "$patch" ]; then
 	# we are supposed to push only the next patch onto the stack
 
-	eidx=`wc -l < $applied`
+	eidx=`wc -l < "$applied"`
 	eidx=`expr $eidx + 1`
 else
 	# we're supposed to push only up to a patch, make sure the patch is
@@ -99,7 +99,7 @@ if ! must_commit_first; then
 fi
 
 # now, find the starting patch
-sidx=`wc -l < $applied`
+sidx=`wc -l < "$applied"`
 sidx=`expr $sidx + 1`
 
 # do we actually have to push anything?
diff --git a/guilt-series b/guilt-series
index d9b1cc2..c87b31e 100755
--- a/guilt-series
+++ b/guilt-series
@@ -30,8 +30,8 @@ if [ ! -z "$edit" ]; then
 	git_editor "$series"
 elif [ ! -z "$gui" ]; then
 	[ -z "`get_top`" ] && die "No patches applied."
-	bottom=`git rev-parse refs/patches/$branch/$(head_n 1 $applied)`
-	top=`git rev-parse refs/patches/$branch/$(tail -n 1 $applied)`
+	bottom=`git rev-parse refs/patches/$branch/$(head_n 1 "$applied")`
+	top=`git rev-parse refs/patches/$branch/$(tail -n 1 "$applied")`
 	range="$bottom..$top"
 
 	# FIXME, this doesn't quite work - it's perfectly fine with
diff --git a/guilt-unapplied b/guilt-unapplied
index 67ee1aa..e703408 100755
--- a/guilt-unapplied
+++ b/guilt-unapplied
@@ -15,7 +15,7 @@ if [ $# -ne 0 ]; then
 	usage
 fi
 
-n=`wc -l < $applied`
+n=`wc -l < "$applied"`
 n=`expr $n + 1`
 
 get_series | sed -n -e "$n,\$p"
-- 
1.7.4.1

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

* [GUILT 4/6] Run regression tests in a directory which contains spaces
  2011-09-28 14:15 [GUILT 1/6] Refuse to push corrupt patches Alan Jenkins
  2011-09-28 14:15 ` [GUILT 2/6] guilt-header: fix patch corruption Alan Jenkins
  2011-09-28 14:15 ` [GUILT 3/6] Handle paths that contain spaces Alan Jenkins
@ 2011-09-28 14:15 ` Alan Jenkins
  2011-09-28 14:15 ` [GUILT 5/6] Allow guilt scripts to be run from " Alan Jenkins
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Alan Jenkins @ 2011-09-28 14:15 UTC (permalink / raw)
  To: jeffpc; +Cc: git, Alan Jenkins

This helped me in finding some of the issues in the previous patch.

Signed-off-by: Alan Jenkins <alan.christopher.jenkins@googlemail.com>
---
 regression/run-tests |   17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/regression/run-tests b/regression/run-tests
index 4cb3eb4..a10e796 100755
--- a/regression/run-tests
+++ b/regression/run-tests
@@ -9,9 +9,9 @@ source scaffold
 # usage: empty_repo
 function empty_repo
 {
-	rm -rf $REPODIR
-	mkdir $REPODIR
-	cd $REPODIR > /dev/null
+	rm -rf "$REPODIR"
+	mkdir "$REPODIR"
+	cd "$REPODIR" > /dev/null
 	git init 2> /dev/null > /dev/null
 	cd - > /dev/null
 }
@@ -22,8 +22,9 @@ function test_failed
 Test failed!
 
 Test:		$TESTNAME
-Repo dir:	$REPODIR
 Log file:	$LOGFILE
+Repo dir:	"$REPODIR"
+
 DONE
 	exit 1
 }
@@ -42,7 +43,9 @@ function check_test
 # usage: run_test <test number>
 function run_test
 {
-	export REPODIR="/tmp/guilt.reg.$RANDOM"
+	# We make sure we can handle space characters
+	# by including one in REPODIR.
+	export REPODIR="/tmp/guilt reg.$RANDOM"
 	export LOGFILE="/tmp/guilt.log.$RANDOM"
 	export TESTNAME="$1"
 
@@ -51,7 +54,7 @@ function run_test
 	empty_repo
 
 	# run the test
-	cd $REPODIR > /dev/null
+	cd "$REPODIR" > /dev/null
 	"$REG_DIR/t-$1.sh" 2>&1 > "$LOGFILE"
 	ERR=$?
 	cd - > /dev/null
@@ -61,7 +64,7 @@ function run_test
 
 	echo "done."
 
-	rm -rf $REPODIR $LOGFILE
+	rm -rf "$REPODIR" "$LOGFILE"
 }
 
 case "$1" in
-- 
1.7.4.1

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

* [GUILT 5/6] Allow guilt scripts to be run from a directory which contains spaces
  2011-09-28 14:15 [GUILT 1/6] Refuse to push corrupt patches Alan Jenkins
                   ` (2 preceding siblings ...)
  2011-09-28 14:15 ` [GUILT 4/6] Run regression tests in a directory which contains spaces Alan Jenkins
@ 2011-09-28 14:15 ` Alan Jenkins
  2011-09-28 14:15 ` [GUILT 6/6] Allow the regression tests to be run from a directory with spaces in Alan Jenkins
  2011-09-30 17:15 ` [GUILT 1/6] Refuse to push corrupt patches Josef 'Jeff' Sipek
  5 siblings, 0 replies; 7+ messages in thread
From: Alan Jenkins @ 2011-09-28 14:15 UTC (permalink / raw)
  To: jeffpc; +Cc: git, Alan Jenkins

`dirname $0` breaks if $0 includes spaces.

I don't need this; it was the result of a mis-understanding.
But here it is anyway; take it if you think it's useful.

Signed-off-by: Alan Jenkins <alan.christopher.jenkins@googlemail.com>
---
 guilt               |   22 +++++++++++++---------
 guilt-add           |    2 +-
 guilt-applied       |    2 +-
 guilt-branch        |    2 +-
 guilt-commit        |    2 +-
 guilt-delete        |    2 +-
 guilt-diff          |    2 +-
 guilt-export        |    2 +-
 guilt-files         |    2 +-
 guilt-fold          |    2 +-
 guilt-fork          |    2 +-
 guilt-graph         |    2 +-
 guilt-guard         |    2 +-
 guilt-header        |    2 +-
 guilt-help          |    2 +-
 guilt-import        |    2 +-
 guilt-import-commit |    2 +-
 guilt-init          |    2 +-
 guilt-new           |    2 +-
 guilt-next          |    2 +-
 guilt-patchbomb     |    2 +-
 guilt-pop           |    2 +-
 guilt-prev          |    2 +-
 guilt-push          |    2 +-
 guilt-rebase        |    2 +-
 guilt-refresh       |    2 +-
 guilt-repair        |    2 +-
 guilt-rm            |    2 +-
 guilt-select        |    2 +-
 guilt-series        |    2 +-
 guilt-status        |    2 +-
 guilt-top           |    2 +-
 guilt-unapplied     |    2 +-
 33 files changed, 45 insertions(+), 41 deletions(-)

diff --git a/guilt b/guilt
index 9f06b41..45bdb66 100755
--- a/guilt
+++ b/guilt
@@ -6,12 +6,14 @@
 GUILT_VERSION="0.35"
 GUILT_NAME="Gloria"
 
+GUILT="$(basename "$0")"
+
 # If the first argument is one of the below, display the man page instead of
 # the rather silly and mostly useless usage string
 case $1 in
 	-h|--h|--he|--hel|--help)
 	shift
-	exec "guilt help" "`basename $0`"
+	exec "guilt help" "$GUILT"
 	exit
 	;;
 	-V|--ver|--versi|--versio|--version)
@@ -69,10 +71,12 @@ silent()
 
 ########
 
+GUILT_PATH="$(dirname "$0")"
+
 guilt_commands()
 {
-	find "`dirname $0`/../lib/guilt" -maxdepth 1 -name "guilt-*" -type f -perm +111 2> /dev/null | sed -e "s/.*\\/`basename $0`-//"
-	find "`dirname $0`" -maxdepth 1 -name "guilt-*" -type f -perm +111 | sed -e "s/.*\\/`basename $0`-//"
+	find "$GUILT_PATH/../lib/guilt" -maxdepth 1 -name "guilt-*" -type f -perm +111 2> /dev/null | sed -e "s/.*\\/$GUILT-//"
+	find "$GUILT_PATH" -maxdepth 1 -name "guilt-*" -type f -perm +111 | sed -e "s/.*\\/$GUILT-//"
 }
 
 # by default, we shouldn't fail
@@ -82,8 +86,8 @@ if [ $# -ne 0 ]; then
 	# take first arg, and try to execute it
 
 	arg="$1"
-	dir=`dirname $0`
-	libdir="`dirname $0`/../lib/guilt"
+	dir="$GUILT_PATH"
+	libdir="$GUILT_PATH/../lib/guilt"
 
 	if [ -x "$dir/guilt-$arg" ]; then
 		cmd="$dir/guilt-$arg"
@@ -870,10 +874,10 @@ pager="more"
 
 UNAME_S=`uname -s`
 
-if [ -r "`dirname $0`/os.$UNAME_S" ]; then
-	. "`dirname $0`/os.$UNAME_S"
-elif [ -r "`dirname $0`/../lib/guilt/os.$UNAME_S" ]; then
-	. "`dirname $0`/../lib/guilt/os.$UNAME_S"
+if [ -r "$GUILT_PATH/os.$UNAME_S" ]; then
+	. "$GUILT_PATH/os.$UNAME_S"
+elif [ -r "$GUILT_PATH/../lib/guilt/os.$UNAME_S" ]; then
+	. "$GUILT_PATH/../lib/guilt/os.$UNAME_S"
 else
 	die "Unsupported operating system: $UNAME_S"
 fi
diff --git a/guilt-add b/guilt-add
index 6529949..8a6b5a7 100755
--- a/guilt-add
+++ b/guilt-add
@@ -5,7 +5,7 @@
 
 USAGE="<file>..."
 if [ -z "$GUILT_VERSION" ]; then
-	echo "Invoking `basename $0` directly is no longer supported." >&2
+	echo "Invoking $GUILT directly is no longer supported." >&2
 	exit 1
 fi
 
diff --git a/guilt-applied b/guilt-applied
index a1f684a..a84f1f7 100755
--- a/guilt-applied
+++ b/guilt-applied
@@ -5,7 +5,7 @@
 
 USAGE="[-c]"
 if [ -z "$GUILT_VERSION" ]; then
-	echo "Invoking `basename $0` directly is no longer supported." >&2
+	echo "Invoking $GUILT directly is no longer supported." >&2
 	exit 1
 fi
 
diff --git a/guilt-branch b/guilt-branch
index 909f740..3e88321 100755
--- a/guilt-branch
+++ b/guilt-branch
@@ -5,7 +5,7 @@
 
 USAGE="[<new_name>]"
 if [ -z "$GUILT_VERSION" ]; then
-	echo "Invoking `basename $0` directly is no longer supported." >&2
+	echo "Invoking $GUILT directly is no longer supported." >&2
 	exit 1
 fi
 
diff --git a/guilt-commit b/guilt-commit
index 4228be6..4ef6605 100755
--- a/guilt-commit
+++ b/guilt-commit
@@ -5,7 +5,7 @@
 
 USAGE="-n <num> | -a | --all"
 if [ -z "$GUILT_VERSION" ]; then
-	echo "Invoking `basename $0` directly is no longer supported." >&2
+	echo "Invoking $GUILT directly is no longer supported." >&2
 	exit 1
 fi
 
diff --git a/guilt-delete b/guilt-delete
index 4ab9c94..551e6a4 100755
--- a/guilt-delete
+++ b/guilt-delete
@@ -5,7 +5,7 @@
 
 USAGE="[-f] <patchname>"
 if [ -z "$GUILT_VERSION" ]; then
-	echo "Invoking `basename $0` directly is no longer supported." >&2
+	echo "Invoking $GUILT directly is no longer supported." >&2
 	exit 1
 fi
 
diff --git a/guilt-diff b/guilt-diff
index 0061926..182fa59 100755
--- a/guilt-diff
+++ b/guilt-diff
@@ -5,7 +5,7 @@
 
 USAGE="[-z] [<path>...]"
 if [ -z "$GUILT_VERSION" ]; then
-	echo "Invoking `basename $0` directly is no longer supported." >&2
+	echo "Invoking $GUILT directly is no longer supported." >&2
 	exit 1
 fi
 
diff --git a/guilt-export b/guilt-export
index 8361902..62c1ef6 100755
--- a/guilt-export
+++ b/guilt-export
@@ -5,7 +5,7 @@
 
 USAGE="[<target_dir>]"
 if [ -z "$GUILT_VERSION" ]; then
-	echo "Invoking `basename $0` directly is no longer supported." >&2
+	echo "Invoking $GUILT directly is no longer supported." >&2
 	exit 1
 fi
 
diff --git a/guilt-files b/guilt-files
index f31a94c..aab35d5 100755
--- a/guilt-files
+++ b/guilt-files
@@ -5,7 +5,7 @@
 
 USAGE="[-v] [-a] [-l]"
 if [ -z "$GUILT_VERSION" ]; then
-	echo "Invoking `basename $0` directly is no longer supported." >&2
+	echo "Invoking $GUILT directly is no longer supported." >&2
 	exit 1
 fi
 
diff --git a/guilt-fold b/guilt-fold
index 06fbb7f..07d77a1 100755
--- a/guilt-fold
+++ b/guilt-fold
@@ -5,7 +5,7 @@
 
 USAGE="[-k] <patchname>"
 if [ -z "$GUILT_VERSION" ]; then
-	echo "Invoking `basename $0` directly is no longer supported." >&2
+	echo "Invoking $GUILT directly is no longer supported." >&2
 	exit 1
 fi
 
diff --git a/guilt-fork b/guilt-fork
index 8d58ffd..5677e1b 100755
--- a/guilt-fork
+++ b/guilt-fork
@@ -5,7 +5,7 @@
 
 USAGE="[<new_name>]"
 if [ -z "$GUILT_VERSION" ]; then
-	echo "Invoking `basename $0` directly is no longer supported." >&2
+	echo "Invoking $GUILT directly is no longer supported." >&2
 	exit 1
 fi
 
diff --git a/guilt-graph b/guilt-graph
index 496a831..1c9fade 100755
--- a/guilt-graph
+++ b/guilt-graph
@@ -5,7 +5,7 @@
 
 USAGE="[<patchname>]"
 if [ -z "$GUILT_VERSION" ]; then
-	echo "Invoking `basename $0` directly is no longer supported." >&2
+	echo "Invoking $GUILT directly is no longer supported." >&2
 	exit 1
 fi
 
diff --git a/guilt-guard b/guilt-guard
index 2c12fca..ada7f45 100755
--- a/guilt-guard
+++ b/guilt-guard
@@ -5,7 +5,7 @@
 
 USAGE="[-l | --list | -n | --none | [<patchname>] [(+|-)<guard>...]]"
 if [ -z "$GUILT_VERSION" ]; then
-	echo "Invoking `basename $0` directly is no longer supported." >&2
+	echo "Invoking $GUILT directly is no longer supported." >&2
 	exit 1
 fi
 
diff --git a/guilt-header b/guilt-header
index 9910708..19cfd45 100755
--- a/guilt-header
+++ b/guilt-header
@@ -5,7 +5,7 @@
 
 USAGE="[-eE] [<patchname>]"
 if [ -z "$GUILT_VERSION" ]; then
-	echo "Invoking `basename $0` directly is no longer supported." >&2
+	echo "Invoking $GUILT directly is no longer supported." >&2
 	exit 1
 fi
 
diff --git a/guilt-help b/guilt-help
index e1807a8..001ddfb 100755
--- a/guilt-help
+++ b/guilt-help
@@ -7,7 +7,7 @@ DO_NOT_CHECK_BRANCH_EXISTENCE=1
 
 USAGE="[<command> | <topic>]"
 if [ -z "$GUILT_VERSION" ]; then
-	echo "Invoking `basename $0` directly is no longer supported." >&2
+	echo "Invoking $GUILT directly is no longer supported." >&2
 	exit 1
 fi
 
diff --git a/guilt-import b/guilt-import
index 72ba7c3..041d20a 100755
--- a/guilt-import
+++ b/guilt-import
@@ -5,7 +5,7 @@
 
 USAGE="[-P <patch> ] <patch_file>"
 if [ -z "$GUILT_VERSION" ]; then
-	echo "Invoking `basename $0` directly is no longer supported." >&2
+	echo "Invoking $GUILT directly is no longer supported." >&2
 	exit 1
 fi
 
diff --git a/guilt-import-commit b/guilt-import-commit
index 3045a5f..1784f26 100755
--- a/guilt-import-commit
+++ b/guilt-import-commit
@@ -5,7 +5,7 @@
 
 USAGE="[<hash> | <since>..[<until>] | ..<until>]"
 if [ -z "$GUILT_VERSION" ]; then
-	echo "Invoking `basename $0` directly is no longer supported." >&2
+	echo "Invoking $GUILT directly is no longer supported." >&2
 	exit 1
 fi
 
diff --git a/guilt-init b/guilt-init
index 646e24b..148699c 100755
--- a/guilt-init
+++ b/guilt-init
@@ -7,7 +7,7 @@ DO_NOT_CHECK_BRANCH_EXISTENCE=1
 
 USAGE=""
 if [ -z "$GUILT_VERSION" ]; then
-	echo "Invoking `basename $0` directly is no longer supported." >&2
+	echo "Invoking $GUILT directly is no longer supported." >&2
 	exit 1
 fi
 
diff --git a/guilt-new b/guilt-new
index 402104e..0803063 100755
--- a/guilt-new
+++ b/guilt-new
@@ -5,7 +5,7 @@
 
 USAGE="[-f] [-s] [-e|-m message] <patchname>"
 if [ -z "$GUILT_VERSION" ]; then
-	echo "Invoking `basename $0` directly is no longer supported." >&2
+	echo "Invoking $GUILT directly is no longer supported." >&2
 	exit 1
 fi
 
diff --git a/guilt-next b/guilt-next
index a0941fc..c7263f1 100755
--- a/guilt-next
+++ b/guilt-next
@@ -5,7 +5,7 @@
 
 USAGE="[-p|--path]"
 if [ -z "$GUILT_VERSION" ]; then
-	echo "Invoking `basename $0` directly is no longer supported." >&2
+	echo "Invoking $GUILT directly is no longer supported." >&2
 	exit 1
 fi
 
diff --git a/guilt-patchbomb b/guilt-patchbomb
index b72a706..c61cd1b 100755
--- a/guilt-patchbomb
+++ b/guilt-patchbomb
@@ -7,7 +7,7 @@ DO_NOT_CHECK_BRANCH_EXISTENCE=1
 
 USAGE="[-n] [-s] [--in-reply-to <msgid>] [--git] [--subject-prefix <prefix>] [<hash> | <since>..[<until>] | ..<until>]"
 if [ -z "$GUILT_VERSION" ]; then
-	echo "Invoking `basename $0` directly is no longer supported." >&2
+	echo "Invoking $GUILT directly is no longer supported." >&2
 	exit 1
 fi
 
diff --git a/guilt-pop b/guilt-pop
index df466c7..1e36f00 100755
--- a/guilt-pop
+++ b/guilt-pop
@@ -5,7 +5,7 @@
 
 USAGE="[-f] [-a | --all | -n <num> | <patchname>]"
 if [ -z "$GUILT_VERSION" ]; then
-	echo "Invoking `basename $0` directly is no longer supported." >&2
+	echo "Invoking $GUILT directly is no longer supported." >&2
 	exit 1
 fi
 
diff --git a/guilt-prev b/guilt-prev
index d454030..31c054c 100755
--- a/guilt-prev
+++ b/guilt-prev
@@ -5,7 +5,7 @@
 
 USAGE="[-p|--path]"
 if [ -z "$GUILT_VERSION" ]; then
-	echo "Invoking `basename $0` directly is no longer supported." >&2
+	echo "Invoking $GUILT directly is no longer supported." >&2
 	exit 1
 fi
 
diff --git a/guilt-push b/guilt-push
index d9a8590..4a54d07 100755
--- a/guilt-push
+++ b/guilt-push
@@ -5,7 +5,7 @@
 
 USAGE="[ -f ] [-a | --all | -n <num> | <patchname>]"
 if [ -z "$GUILT_VERSION" ]; then
-	echo "Invoking `basename $0` directly is no longer supported." >&2
+	echo "Invoking $GUILT directly is no longer supported." >&2
 	exit 1
 fi
 
diff --git a/guilt-rebase b/guilt-rebase
index 614ba22..c33022f 100755
--- a/guilt-rebase
+++ b/guilt-rebase
@@ -7,7 +7,7 @@
 
 USAGE="<upstream>"
 if [ -z "$GUILT_VERSION" ]; then
-	echo "Invoking `basename $0` directly is no longer supported." >&2
+	echo "Invoking $GUILT directly is no longer supported." >&2
 	exit 1
 fi
 
diff --git a/guilt-refresh b/guilt-refresh
index f764937..4e22929 100755
--- a/guilt-refresh
+++ b/guilt-refresh
@@ -5,7 +5,7 @@
 
 USAGE="[--git] [--diffstat]"
 if [ -z "$GUILT_VERSION" ]; then
-	echo "Invoking `basename $0` directly is no longer supported." >&2
+	echo "Invoking $GUILT directly is no longer supported." >&2
 	exit 1
 fi
 
diff --git a/guilt-repair b/guilt-repair
index 77ad223..99df731 100755
--- a/guilt-repair
+++ b/guilt-repair
@@ -7,7 +7,7 @@ DO_NOT_CHECK_STATUS_FILE_FORMAT=1
 
 USAGE="--full | --status"
 if [ -z "$GUILT_VERSION" ]; then
-	echo "Invoking `basename $0` directly is no longer supported." >&2
+	echo "Invoking $GUILT directly is no longer supported." >&2
 	exit 1
 fi
 
diff --git a/guilt-rm b/guilt-rm
index 351ec93..d68622b 100755
--- a/guilt-rm
+++ b/guilt-rm
@@ -5,7 +5,7 @@
 
 USAGE="<file>..."
 if [ -z "$GUILT_VERSION" ]; then
-	echo "Invoking `basename $0` directly is no longer supported." >&2
+	echo "Invoking $GUILT directly is no longer supported." >&2
 	exit 1
 fi
 
diff --git a/guilt-select b/guilt-select
index 8b139d4..fb7941b 100755
--- a/guilt-select
+++ b/guilt-select
@@ -5,7 +5,7 @@
 
 USAGE="[ -n | --none | -s | --series | [--pop|--reapply] <guards...> ]"
 if [ -z "$GUILT_VERSION" ]; then
-	echo "Invoking `basename $0` directly is no longer supported." >&2
+	echo "Invoking $GUILT directly is no longer supported." >&2
 	exit 1
 fi
 
diff --git a/guilt-series b/guilt-series
index c87b31e..f8cd7c7 100755
--- a/guilt-series
+++ b/guilt-series
@@ -5,7 +5,7 @@
 
 USAGE="[-v | -g | -e]"
 if [ -z "$GUILT_VERSION" ]; then
-	echo "Invoking `basename $0` directly is no longer supported." >&2
+	echo "Invoking $GUILT directly is no longer supported." >&2
 	exit 1
 fi
 
diff --git a/guilt-status b/guilt-status
index c701fd1..b4cd1eb 100755
--- a/guilt-status
+++ b/guilt-status
@@ -5,7 +5,7 @@
 
 USAGE="[-a|-A] [-c|-C] [-d|-D] [-m|-M] [-r|-R] [-t|-T] [-u|-U] [-x|-X] [-n]"
 if [ -z "$GUILT_VERSION" ]; then
-	echo "Invoking `basename $0` directly is no longer supported." >&2
+	echo "Invoking $GUILT directly is no longer supported." >&2
 	exit 1
 fi
 
diff --git a/guilt-top b/guilt-top
index 3b1d596..6215009 100755
--- a/guilt-top
+++ b/guilt-top
@@ -5,7 +5,7 @@
 
 USAGE="[-p|--path]"
 if [ -z "$GUILT_VERSION" ]; then
-	echo "Invoking `basename $0` directly is no longer supported." >&2
+	echo "Invoking $GUILT directly is no longer supported." >&2
 	exit 1
 fi
 
diff --git a/guilt-unapplied b/guilt-unapplied
index e703408..9aec87a 100755
--- a/guilt-unapplied
+++ b/guilt-unapplied
@@ -5,7 +5,7 @@
 
 USAGE=""
 if [ -z "$GUILT_VERSION" ]; then
-	echo "Invoking `basename $0` directly is no longer supported." >&2
+	echo "Invoking $GUILT directly is no longer supported." >&2
 	exit 1
 fi
 
-- 
1.7.4.1

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

* [GUILT 6/6] Allow the regression tests to be run from a directory with spaces in
  2011-09-28 14:15 [GUILT 1/6] Refuse to push corrupt patches Alan Jenkins
                   ` (3 preceding siblings ...)
  2011-09-28 14:15 ` [GUILT 5/6] Allow guilt scripts to be run from " Alan Jenkins
@ 2011-09-28 14:15 ` Alan Jenkins
  2011-09-30 17:15 ` [GUILT 1/6] Refuse to push corrupt patches Josef 'Jeff' Sipek
  5 siblings, 0 replies; 7+ messages in thread
From: Alan Jenkins @ 2011-09-28 14:15 UTC (permalink / raw)
  To: jeffpc; +Cc: git, Alan Jenkins

sed -i regression/*.sh 's|source $REG_DIR/scaffold|source "$REG_DIR/scaffold"|'

Same as the previous patch: it turned out I don't need this,
but you might think it's a good idea anyway.

Signed-off-by: Alan Jenkins <alan.christopher.jenkins@googlemail.com>
---
 regression/t-010.sh |    2 +-
 regression/t-011.sh |    2 +-
 regression/t-020.sh |    2 +-
 regression/t-021.sh |    2 +-
 regression/t-022.sh |    2 +-
 regression/t-023.sh |    2 +-
 regression/t-024.sh |    2 +-
 regression/t-025.sh |    2 +-
 regression/t-026.sh |    2 +-
 regression/t-027.sh |    2 +-
 regression/t-028.sh |    2 +-
 regression/t-029.sh |    2 +-
 regression/t-030.sh |    2 +-
 regression/t-031.sh |    2 +-
 regression/t-032.sh |    2 +-
 regression/t-050.sh |    2 +-
 regression/t-051.sh |    2 +-
 regression/t-052.sh |    2 +-
 regression/t-060.sh |    2 +-
 19 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/regression/t-010.sh b/regression/t-010.sh
index 1fc88fa..9bbf32a 100755
--- a/regression/t-010.sh
+++ b/regression/t-010.sh
@@ -3,7 +3,7 @@
 # Test the init code
 #
 
-source $REG_DIR/scaffold
+source "$REG_DIR/scaffold"
 
 function opts
 {
diff --git a/regression/t-011.sh b/regression/t-011.sh
index fde7b90..55a72d7 100755
--- a/regression/t-011.sh
+++ b/regression/t-011.sh
@@ -4,7 +4,7 @@
 # not guilt init'ed
 #
 
-source $REG_DIR/scaffold
+source "$REG_DIR/scaffold"
 
 cmd setup_git_repo
 
diff --git a/regression/t-020.sh b/regression/t-020.sh
index 6598b02..cdd08ba 100755
--- a/regression/t-020.sh
+++ b/regression/t-020.sh
@@ -3,7 +3,7 @@
 # Test the push code
 #
 
-source $REG_DIR/scaffold
+source "$REG_DIR/scaffold"
 
 cmd setup_repo
 
diff --git a/regression/t-021.sh b/regression/t-021.sh
index 035973c..6337d7b 100755
--- a/regression/t-021.sh
+++ b/regression/t-021.sh
@@ -3,7 +3,7 @@
 # Test the pop code
 #
 
-source $REG_DIR/scaffold
+source "$REG_DIR/scaffold"
 
 cmd setup_repo
 
diff --git a/regression/t-022.sh b/regression/t-022.sh
index e43dc0a..0fe345b 100755
--- a/regression/t-022.sh
+++ b/regression/t-022.sh
@@ -3,7 +3,7 @@
 # Test the applied code
 #
 
-source $REG_DIR/scaffold
+source "$REG_DIR/scaffold"
 
 cmd setup_repo
 
diff --git a/regression/t-023.sh b/regression/t-023.sh
index 1e976fd..c0530d6 100755
--- a/regression/t-023.sh
+++ b/regression/t-023.sh
@@ -3,7 +3,7 @@
 # Test the top code
 #
 
-source $REG_DIR/scaffold
+source "$REG_DIR/scaffold"
 
 cmd setup_repo
 
diff --git a/regression/t-024.sh b/regression/t-024.sh
index 9b11286..38f53aa 100755
--- a/regression/t-024.sh
+++ b/regression/t-024.sh
@@ -3,7 +3,7 @@
 # Test the unapplied code
 #
 
-source $REG_DIR/scaffold
+source "$REG_DIR/scaffold"
 
 cmd setup_repo
 
diff --git a/regression/t-025.sh b/regression/t-025.sh
index 6aa9bd3..3824608 100755
--- a/regression/t-025.sh
+++ b/regression/t-025.sh
@@ -3,7 +3,7 @@
 # Test the new code
 #
 
-source $REG_DIR/scaffold
+source "$REG_DIR/scaffold"
 
 cmd setup_repo
 
diff --git a/regression/t-026.sh b/regression/t-026.sh
index 5f29352..0ccdf85 100755
--- a/regression/t-026.sh
+++ b/regression/t-026.sh
@@ -3,7 +3,7 @@
 # Test the delete code
 #
 
-source $REG_DIR/scaffold
+source "$REG_DIR/scaffold"
 
 cmd setup_repo
 
diff --git a/regression/t-027.sh b/regression/t-027.sh
index ee70229..2f5bb9f 100755
--- a/regression/t-027.sh
+++ b/regression/t-027.sh
@@ -3,7 +3,7 @@
 # Test the refresh code
 #
 
-source $REG_DIR/scaffold
+source "$REG_DIR/scaffold"
 
 cmd setup_repo
 
diff --git a/regression/t-028.sh b/regression/t-028.sh
index 83fa879..8480100 100755
--- a/regression/t-028.sh
+++ b/regression/t-028.sh
@@ -3,7 +3,7 @@
 # Test the header code
 #
 
-source $REG_DIR/scaffold
+source "$REG_DIR/scaffold"
 
 cmd setup_repo
 
diff --git a/regression/t-029.sh b/regression/t-029.sh
index 83e1d2b..e4036bf 100755
--- a/regression/t-029.sh
+++ b/regression/t-029.sh
@@ -5,7 +5,7 @@
 
 # FIXME: test status file format upgrade code
 
-source $REG_DIR/scaffold
+source "$REG_DIR/scaffold"
 
 cmd setup_repo
 
diff --git a/regression/t-030.sh b/regression/t-030.sh
index 0352948..06bd58f 100755
--- a/regression/t-030.sh
+++ b/regression/t-030.sh
@@ -3,7 +3,7 @@
 # Test the commit code
 #
 
-source $REG_DIR/scaffold
+source "$REG_DIR/scaffold"
 
 cmd setup_repo
 
diff --git a/regression/t-031.sh b/regression/t-031.sh
index 9b5db6f..20c2a6b 100755
--- a/regression/t-031.sh
+++ b/regression/t-031.sh
@@ -3,7 +3,7 @@
 # Test the fork code
 #
 
-source $REG_DIR/scaffold
+source "$REG_DIR/scaffold"
 
 cmd setup_repo
 
diff --git a/regression/t-032.sh b/regression/t-032.sh
index 3b32da5..b1d5f19 100755
--- a/regression/t-032.sh
+++ b/regression/t-032.sh
@@ -3,7 +3,7 @@
 # Test the import code
 #
 
-source $REG_DIR/scaffold
+source "$REG_DIR/scaffold"
 
 cmd setup_repo
 
diff --git a/regression/t-050.sh b/regression/t-050.sh
index 82ac412..88be546 100755
--- a/regression/t-050.sh
+++ b/regression/t-050.sh
@@ -3,7 +3,7 @@
 # Test the series code
 #
 
-source $REG_DIR/scaffold
+source "$REG_DIR/scaffold"
 
 cmd setup_repo
 
diff --git a/regression/t-051.sh b/regression/t-051.sh
index a05fcca..293459c 100755
--- a/regression/t-051.sh
+++ b/regression/t-051.sh
@@ -3,7 +3,7 @@
 # Test the commands that use get_*_series, while applying guards
 #
 
-source $REG_DIR/scaffold
+source "$REG_DIR/scaffold"
 
 cmd setup_repo
 
diff --git a/regression/t-052.sh b/regression/t-052.sh
index e9c1a59..f8c60ab 100755
--- a/regression/t-052.sh
+++ b/regression/t-052.sh
@@ -3,7 +3,7 @@
 # Test the commands that use get_*_series, while applying guards
 #
 
-source $REG_DIR/scaffold
+source "$REG_DIR/scaffold"
 
 cmd setup_repo
 
diff --git a/regression/t-060.sh b/regression/t-060.sh
index ec33d80..ebe93bd 100755
--- a/regression/t-060.sh
+++ b/regression/t-060.sh
@@ -3,7 +3,7 @@
 # Test the guilt files code
 #
 
-source $REG_DIR/scaffold
+source "$REG_DIR/scaffold"
 
 cmd setup_repo
 
-- 
1.7.4.1

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

* Re: [GUILT 1/6] Refuse to push corrupt patches
  2011-09-28 14:15 [GUILT 1/6] Refuse to push corrupt patches Alan Jenkins
                   ` (4 preceding siblings ...)
  2011-09-28 14:15 ` [GUILT 6/6] Allow the regression tests to be run from a directory with spaces in Alan Jenkins
@ 2011-09-30 17:15 ` Josef 'Jeff' Sipek
  5 siblings, 0 replies; 7+ messages in thread
From: Josef 'Jeff' Sipek @ 2011-09-30 17:15 UTC (permalink / raw)
  To: Alan Jenkins; +Cc: git

Thanks for the patches.  I looked them over and they look good.  I'll give
them another thorough reading once I have a bit of time to apply them.

Jeff.

On Wed, Sep 28, 2011 at 03:15:19PM +0100, Alan Jenkins wrote:
> "guilt push" would treat corrupt patches as empty,
> because "git apply --numstat" prints nothing on stdout.
> 
> (You do get an error message on stderr,
>  but then guilt says "Patch applied" etc,
>  and I didn't notice the earlier error message
>  for quite some time.)
> 
> Signed-off-by: Alan Jenkins <alan.christopher.jenkins@googlemail.com>
> ---
>  guilt |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/guilt b/guilt
> index d1e17d4..51532f9 100755
> --- a/guilt
> +++ b/guilt
> @@ -611,7 +611,7 @@ push_patch()
>  		cd_to_toplevel
>  
>  		# apply the patch if and only if there is something to apply
> -		if [ `git apply --numstat "$p" | wc -l` -gt 0 ]; then
> +		if [ `do_get_patch "$p" | wc -l` -gt 0 ]; then
>  			if [ "$bail_action" = abort ]; then
>  				reject=""
>  			fi
> -- 
> 1.7.4.1
> 

-- 
Hegh QaQ law'
quvHa'ghach QaQ puS

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

end of thread, other threads:[~2011-09-30 17:24 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-28 14:15 [GUILT 1/6] Refuse to push corrupt patches Alan Jenkins
2011-09-28 14:15 ` [GUILT 2/6] guilt-header: fix patch corruption Alan Jenkins
2011-09-28 14:15 ` [GUILT 3/6] Handle paths that contain spaces Alan Jenkins
2011-09-28 14:15 ` [GUILT 4/6] Run regression tests in a directory which contains spaces Alan Jenkins
2011-09-28 14:15 ` [GUILT 5/6] Allow guilt scripts to be run from " Alan Jenkins
2011-09-28 14:15 ` [GUILT 6/6] Allow the regression tests to be run from a directory with spaces in Alan Jenkins
2011-09-30 17:15 ` [GUILT 1/6] Refuse to push corrupt patches Josef 'Jeff' Sipek

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).