{"thread":{"id":"28519","subject":"[GUILT 1/6] Refuse to push corrupt patches","startedAt":"2011-09-28T14:15:19Z","lastAt":"2011-09-30T17:15:02Z","messageCount":7,"participants":["Alan Jenkins","Josef 'Jeff' Sipek"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"176409","messageId":"1317219324-10319-1-git-send-email-alan.christopher.jenkins@googlemail.com","threadId":"28519","inReplyTo":null,"subject":"[GUILT 1/6] Refuse to push corrupt patches","fromName":"Alan Jenkins","fromEmail":"alan.christopher.jenkins@googlemail.com","sentAt":"2011-09-28T14:15:19Z","receivedAt":"2011-09-28T14:15:19Z","isPatch":false,"sender":{"key":"alan.christopher.jenkins@googlemail.com","avatar":null},"body":"\"guilt push\" would treat corrupt patches as empty,\nbecause \"git apply --numstat\" prints nothing on stdout.\n\n(You do get an error message on stderr,\n but then guilt says \"Patch applied\" etc,\n and I didn't notice the earlier error message\n for quite some time.)\n\nSigned-off-by: Alan Jenkins <alan.christopher.jenkins@googlemail.com>\n---\n guilt |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/guilt b/guilt\nindex d1e17d4..51532f9 100755\n--- a/guilt\n+++ b/guilt\n@@ -611,7 +611,7 @@ push_patch()\n \t\tcd_to_toplevel\n \n \t\t# apply the patch if and only if there is something to apply\n-\t\tif [ `git apply --numstat \"$p\" | wc -l` -gt 0 ]; then\n+\t\tif [ `do_get_patch \"$p\" | wc -l` -gt 0 ]; then\n \t\t\tif [ \"$bail_action\" = abort ]; then\n \t\t\t\treject=\"\"\n \t\t\tfi\n-- \n1.7.4.1\n"},{"id":"176410","messageId":"1317219324-10319-2-git-send-email-alan.christopher.jenkins@googlemail.com","threadId":"28519","inReplyTo":"1317219324-10319-1-git-send-email-alan.christopher.jenkins@googlemail.com","subject":"[GUILT 2/6] guilt-header: fix patch corruption","fromName":"Alan Jenkins","fromEmail":"alan.christopher.jenkins@googlemail.com","sentAt":"2011-09-28T14:15:20Z","receivedAt":"2011-09-28T14:15:20Z","isPatch":false,"sender":{"key":"alan.christopher.jenkins@googlemail.com","avatar":null},"body":"Hunks containing the string \"END{}\" were being corrupted.\n\nSigned-off-by: Alan Jenkins <alan.christopher.jenkins@googlemail.com>\n---\n guilt |    4 +++-\n 1 files changed, 3 insertions(+), 1 deletions(-)\n\ndiff --git a/guilt b/guilt\nindex 51532f9..5d79e0f 100755\n--- a/guilt\n+++ b/guilt\n@@ -341,7 +341,9 @@ do_get_patch()\n {\n \tcat \"$1\" | awk '\n BEGIN{}\n-/^(diff |---$|--- )/,/END{}/\n+/^(diff |---$|--- )/ {patch = 1}\n+patch == 1 {print $0}\n+END{}\n '\n }\n \n-- \n1.7.4.1\n"},{"id":"176411","messageId":"1317219324-10319-3-git-send-email-alan.christopher.jenkins@googlemail.com","threadId":"28519","inReplyTo":"1317219324-10319-1-git-send-email-alan.christopher.jenkins@googlemail.com","subject":"[GUILT 3/6] Handle paths that contain spaces","fromName":"Alan Jenkins","fromEmail":"alan.christopher.jenkins@googlemail.com","sentAt":"2011-09-28T14:15:21Z","receivedAt":"2011-09-28T14:15:21Z","isPatch":false,"sender":{"key":"alan.christopher.jenkins@googlemail.com","avatar":null},"body":"\nSigned-off-by: Alan Jenkins <alan.christopher.jenkins@googlemail.com>\n---\n guilt           |    6 +++---\n guilt-applied   |    4 ++--\n guilt-files     |    4 ++--\n guilt-fold      |    2 +-\n guilt-new       |    2 +-\n guilt-next      |    2 +-\n guilt-pop       |   12 ++++++------\n guilt-push      |    6 +++---\n guilt-series    |    4 ++--\n guilt-unapplied |    2 +-\n 10 files changed, 22 insertions(+), 22 deletions(-)\n\ndiff --git a/guilt b/guilt\nindex 5d79e0f..9f06b41 100755\n--- a/guilt\n+++ b/guilt\n@@ -196,7 +196,7 @@ get_full_series()\n \n \t\tp\n \t\t}\n-\t\t\" $series\n+\t\t\" \"$series\"\n }\n \n get_series()\n@@ -632,7 +632,7 @@ push_patch()\n \n \t\tcommit \"$pname\" HEAD\n \n-\t\techo \"$pname\" >> $applied\n+\t\techo \"$pname\" >> \"$applied\"\n \n \t\trm -f \"$TMP_LOG\"\n \t)\n@@ -739,7 +739,7 @@ __refresh_patch()\n \n \t\t# move the new patch in\n \t\tmv \"$p\" \"$p~\"\n-\t\tmv \"$TMP_DIFF\" $p\n+\t\tmv \"$TMP_DIFF\" \"$p\"\n \n \t\t# commit\n \t\tcommit \"$pname\" \"HEAD~$3\"\ndiff --git a/guilt-applied b/guilt-applied\nindex ead787b..a1f684a 100755\n--- a/guilt-applied\n+++ b/guilt-applied\n@@ -14,7 +14,7 @@ _main() {\n case $# in\n \t0)\n \t\t# just output the regular series-style applied list\n-\t\tcat $applied\n+\t\tcat \"$applied\"\n \t;;\n \n \t1)\n@@ -22,7 +22,7 @@ case $# in\n \t\t\tusage\n \t\tfi\n \n-\t\tcat $applied | while read pname; do\n+\t\tcat \"$applied\" | while read pname; do\n \t\t\tgit show-ref refs/patches/$branch/$pname | sed -e \"s,refs/patches/$branch/,,\"\n \t\tdone\n \t;;\ndiff --git a/guilt-files b/guilt-files\nindex 9188070..f31a94c 100755\n--- a/guilt-files\n+++ b/guilt-files\n@@ -34,9 +34,9 @@ top_patch=`get_top`\n \n IFS=:\n if [ -n \"$opt_all\" ]; then\n-\tcat $applied\n+\tcat \"$applied\"\n else\n-\ttail -n 1 $applied\n+\ttail -n 1 \"$applied\"\n fi | while read patch; do\n \tobj=`git rev-parse refs/patches/$branch/$patch`\n \ndiff --git a/guilt-fold b/guilt-fold\nindex 9bf0d6e..06fbb7f 100755\n--- a/guilt-fold\n+++ b/guilt-fold\n@@ -36,7 +36,7 @@ if ! must_commit_first; then\n fi\n \n # make sure it is not applied\n-pline=`cat $applied | grep -e \"^$patch$\"`\n+pline=`cat \"$applied\" | grep -e \"^$patch$\"`\n if [ ! -z \"$pline\" ]; then\n \tdie \"Patch is applied. Pop the patch first.\"\n fi\ndiff --git a/guilt-new b/guilt-new\nindex c660dfc..402104e 100755\n--- a/guilt-new\n+++ b/guilt-new\n@@ -95,7 +95,7 @@ fi\n series_insert_patch \"$patch\"\n \n # apply the patch\n-echo \"$patch\" >> $applied\n+echo \"$patch\" >> \"$applied\"\n commit \"$patch\" HEAD\n \n }\ndiff --git a/guilt-next b/guilt-next\nindex 5ac026b..a0941fc 100755\n--- a/guilt-next\n+++ b/guilt-next\n@@ -21,7 +21,7 @@ while [ $# -ne 0 ]; do\n \tshift\n done\n \n-n=`wc -l < $applied`\n+n=`wc -l < \"$applied\"`\n n=$(($n + 1))\n \n p=`get_series | awk \"{ if (NR == $n) print \\\\$0}\"`\ndiff --git a/guilt-pop b/guilt-pop\nindex 77d2c88..df466c7 100755\n--- a/guilt-pop\n+++ b/guilt-pop\n@@ -55,14 +55,14 @@ if [ ! -s \"$applied\" ]; then\n elif [ \"$patch\" = \"-a\" ]; then\n \t# we are supposed to pop all patches\n \n-\tsidx=`wc -l < $applied`\n+\tsidx=`wc -l < \"$applied\"`\n \teidx=0\n elif [ ! -z \"$num\" ]; then\n \t# we are supposed to pop a set number of patches\n \n \t[ \"$patch\" -lt 0 ] && die \"Invalid number of patches to pop.\"\n \n-\tsidx=`wc -l < $applied`\n+\tsidx=`wc -l < \"$applied\"`\n \teidx=`expr $sidx - $patch`\n \n \t# catch underflow\n@@ -71,19 +71,19 @@ elif [ ! -z \"$num\" ]; then\n elif [ -z \"$patch\" ]; then\n \t# we are supposed to pop only the current patch on the stack\n \n-\tsidx=`wc -l < $applied`\n+\tsidx=`wc -l < \"$applied\"`\n \teidx=`expr $sidx - 1`\n else\n \t# we're supposed to pop only up to a patch, make sure the patch is\n \t# in the series\n \n-\teidx=`cat $applied | grep -ne \"^$patch$\" | cut -d: -f 1`\n+\teidx=`cat \"$applied\" | grep -ne \"^$patch$\" | cut -d: -f 1`\n \tif [ -z \"$eidx\" ]; then\n \t\tdie \"Patch $patch is not in the series/is not applied\"\n \tfi\n \n \teidx=`expr $eidx - 1`\n-\tsidx=`wc -l < $applied`\n+\tsidx=`wc -l < \"$applied\"`\n fi\n \n # make sure that there are no unapplied changes\n@@ -94,7 +94,7 @@ elif ! must_commit_first; then\n \tdie \"Uncommited changes detected. Refresh first.\"\n fi\n \n-l=`awk \"BEGIN{n=0}(n==$eidx){print \\\\$0; exit}{n=n+1}END{}\" < $applied`\n+l=`awk \"BEGIN{n=0}(n==$eidx){print \\\\$0; exit}{n=n+1}END{}\" < \"$applied\"`\n \n pop_many_patches `git rev-parse refs/patches/$branch/$l^` `expr $sidx - $eidx`\n \ndiff --git a/guilt-push b/guilt-push\nindex 05bcef5..d9a8590 100755\n--- a/guilt-push\n+++ b/guilt-push\n@@ -72,7 +72,7 @@ elif [ ! -z \"$num\" ]; then\n \teidx=`get_series | wc -l`\n \n \t# calculate end index from current\n-\ttidx=`wc -l < $applied`\n+\ttidx=`wc -l < \"$applied\"`\n \ttidx=`expr $tidx + $patch`\n \n \t# clamp to minimum\n@@ -81,7 +81,7 @@ elif [ ! -z \"$num\" ]; then\n elif [ -z \"$patch\" ]; then\n \t# we are supposed to push only the next patch onto the stack\n \n-\teidx=`wc -l < $applied`\n+\teidx=`wc -l < \"$applied\"`\n \teidx=`expr $eidx + 1`\n else\n \t# we're supposed to push only up to a patch, make sure the patch is\n@@ -99,7 +99,7 @@ if ! must_commit_first; then\n fi\n \n # now, find the starting patch\n-sidx=`wc -l < $applied`\n+sidx=`wc -l < \"$applied\"`\n sidx=`expr $sidx + 1`\n \n # do we actually have to push anything?\ndiff --git a/guilt-series b/guilt-series\nindex d9b1cc2..c87b31e 100755\n--- a/guilt-series\n+++ b/guilt-series\n@@ -30,8 +30,8 @@ if [ ! -z \"$edit\" ]; then\n \tgit_editor \"$series\"\n elif [ ! -z \"$gui\" ]; then\n \t[ -z \"`get_top`\" ] && die \"No patches applied.\"\n-\tbottom=`git rev-parse refs/patches/$branch/$(head_n 1 $applied)`\n-\ttop=`git rev-parse refs/patches/$branch/$(tail -n 1 $applied)`\n+\tbottom=`git rev-parse refs/patches/$branch/$(head_n 1 \"$applied\")`\n+\ttop=`git rev-parse refs/patches/$branch/$(tail -n 1 \"$applied\")`\n \trange=\"$bottom..$top\"\n \n \t# FIXME, this doesn't quite work - it's perfectly fine with\ndiff --git a/guilt-unapplied b/guilt-unapplied\nindex 67ee1aa..e703408 100755\n--- a/guilt-unapplied\n+++ b/guilt-unapplied\n@@ -15,7 +15,7 @@ if [ $# -ne 0 ]; then\n \tusage\n fi\n \n-n=`wc -l < $applied`\n+n=`wc -l < \"$applied\"`\n n=`expr $n + 1`\n \n get_series | sed -n -e \"$n,\\$p\"\n-- \n1.7.4.1\n"},{"id":"176413","messageId":"1317219324-10319-4-git-send-email-alan.christopher.jenkins@googlemail.com","threadId":"28519","inReplyTo":"1317219324-10319-1-git-send-email-alan.christopher.jenkins@googlemail.com","subject":"[GUILT 4/6] Run regression tests in a directory which contains spaces","fromName":"Alan Jenkins","fromEmail":"alan.christopher.jenkins@googlemail.com","sentAt":"2011-09-28T14:15:22Z","receivedAt":"2011-09-28T14:15:22Z","isPatch":false,"sender":{"key":"alan.christopher.jenkins@googlemail.com","avatar":null},"body":"This helped me in finding some of the issues in the previous patch.\n\nSigned-off-by: Alan Jenkins <alan.christopher.jenkins@googlemail.com>\n---\n regression/run-tests |   17 ++++++++++-------\n 1 files changed, 10 insertions(+), 7 deletions(-)\n\ndiff --git a/regression/run-tests b/regression/run-tests\nindex 4cb3eb4..a10e796 100755\n--- a/regression/run-tests\n+++ b/regression/run-tests\n@@ -9,9 +9,9 @@ source scaffold\n # usage: empty_repo\n function empty_repo\n {\n-\trm -rf $REPODIR\n-\tmkdir $REPODIR\n-\tcd $REPODIR > /dev/null\n+\trm -rf \"$REPODIR\"\n+\tmkdir \"$REPODIR\"\n+\tcd \"$REPODIR\" > /dev/null\n \tgit init 2> /dev/null > /dev/null\n \tcd - > /dev/null\n }\n@@ -22,8 +22,9 @@ function test_failed\n Test failed!\n \n Test:\t\t$TESTNAME\n-Repo dir:\t$REPODIR\n Log file:\t$LOGFILE\n+Repo dir:\t\"$REPODIR\"\n+\n DONE\n \texit 1\n }\n@@ -42,7 +43,9 @@ function check_test\n # usage: run_test <test number>\n function run_test\n {\n-\texport REPODIR=\"/tmp/guilt.reg.$RANDOM\"\n+\t# We make sure we can handle space characters\n+\t# by including one in REPODIR.\n+\texport REPODIR=\"/tmp/guilt reg.$RANDOM\"\n \texport LOGFILE=\"/tmp/guilt.log.$RANDOM\"\n \texport TESTNAME=\"$1\"\n \n@@ -51,7 +54,7 @@ function run_test\n \tempty_repo\n \n \t# run the test\n-\tcd $REPODIR > /dev/null\n+\tcd \"$REPODIR\" > /dev/null\n \t\"$REG_DIR/t-$1.sh\" 2>&1 > \"$LOGFILE\"\n \tERR=$?\n \tcd - > /dev/null\n@@ -61,7 +64,7 @@ function run_test\n \n \techo \"done.\"\n \n-\trm -rf $REPODIR $LOGFILE\n+\trm -rf \"$REPODIR\" \"$LOGFILE\"\n }\n \n case \"$1\" in\n-- \n1.7.4.1\n"},{"id":"176414","messageId":"1317219324-10319-5-git-send-email-alan.christopher.jenkins@googlemail.com","threadId":"28519","inReplyTo":"1317219324-10319-1-git-send-email-alan.christopher.jenkins@googlemail.com","subject":"[GUILT 5/6] Allow guilt scripts to be run from a directory which contains spaces","fromName":"Alan Jenkins","fromEmail":"alan.christopher.jenkins@googlemail.com","sentAt":"2011-09-28T14:15:23Z","receivedAt":"2011-09-28T14:15:23Z","isPatch":false,"sender":{"key":"alan.christopher.jenkins@googlemail.com","avatar":null},"body":"`dirname $0` breaks if $0 includes spaces.\n\nI don't need this; it was the result of a mis-understanding.\nBut here it is anyway; take it if you think it's useful.\n\nSigned-off-by: Alan Jenkins <alan.christopher.jenkins@googlemail.com>\n---\n guilt               |   22 +++++++++++++---------\n guilt-add           |    2 +-\n guilt-applied       |    2 +-\n guilt-branch        |    2 +-\n guilt-commit        |    2 +-\n guilt-delete        |    2 +-\n guilt-diff          |    2 +-\n guilt-export        |    2 +-\n guilt-files         |    2 +-\n guilt-fold          |    2 +-\n guilt-fork          |    2 +-\n guilt-graph         |    2 +-\n guilt-guard         |    2 +-\n guilt-header        |    2 +-\n guilt-help          |    2 +-\n guilt-import        |    2 +-\n guilt-import-commit |    2 +-\n guilt-init          |    2 +-\n guilt-new           |    2 +-\n guilt-next          |    2 +-\n guilt-patchbomb     |    2 +-\n guilt-pop           |    2 +-\n guilt-prev          |    2 +-\n guilt-push          |    2 +-\n guilt-rebase        |    2 +-\n guilt-refresh       |    2 +-\n guilt-repair        |    2 +-\n guilt-rm            |    2 +-\n guilt-select        |    2 +-\n guilt-series        |    2 +-\n guilt-status        |    2 +-\n guilt-top           |    2 +-\n guilt-unapplied     |    2 +-\n 33 files changed, 45 insertions(+), 41 deletions(-)\n\ndiff --git a/guilt b/guilt\nindex 9f06b41..45bdb66 100755\n--- a/guilt\n+++ b/guilt\n@@ -6,12 +6,14 @@\n GUILT_VERSION=\"0.35\"\n GUILT_NAME=\"Gloria\"\n \n+GUILT=\"$(basename \"$0\")\"\n+\n # If the first argument is one of the below, display the man page instead of\n # the rather silly and mostly useless usage string\n case $1 in\n \t-h|--h|--he|--hel|--help)\n \tshift\n-\texec \"guilt help\" \"`basename $0`\"\n+\texec \"guilt help\" \"$GUILT\"\n \texit\n \t;;\n \t-V|--ver|--versi|--versio|--version)\n@@ -69,10 +71,12 @@ silent()\n \n ########\n \n+GUILT_PATH=\"$(dirname \"$0\")\"\n+\n guilt_commands()\n {\n-\tfind \"`dirname $0`/../lib/guilt\" -maxdepth 1 -name \"guilt-*\" -type f -perm +111 2> /dev/null | sed -e \"s/.*\\\\/`basename $0`-//\"\n-\tfind \"`dirname $0`\" -maxdepth 1 -name \"guilt-*\" -type f -perm +111 | sed -e \"s/.*\\\\/`basename $0`-//\"\n+\tfind \"$GUILT_PATH/../lib/guilt\" -maxdepth 1 -name \"guilt-*\" -type f -perm +111 2> /dev/null | sed -e \"s/.*\\\\/$GUILT-//\"\n+\tfind \"$GUILT_PATH\" -maxdepth 1 -name \"guilt-*\" -type f -perm +111 | sed -e \"s/.*\\\\/$GUILT-//\"\n }\n \n # by default, we shouldn't fail\n@@ -82,8 +86,8 @@ if [ $# -ne 0 ]; then\n \t# take first arg, and try to execute it\n \n \targ=\"$1\"\n-\tdir=`dirname $0`\n-\tlibdir=\"`dirname $0`/../lib/guilt\"\n+\tdir=\"$GUILT_PATH\"\n+\tlibdir=\"$GUILT_PATH/../lib/guilt\"\n \n \tif [ -x \"$dir/guilt-$arg\" ]; then\n \t\tcmd=\"$dir/guilt-$arg\"\n@@ -870,10 +874,10 @@ pager=\"more\"\n \n UNAME_S=`uname -s`\n \n-if [ -r \"`dirname $0`/os.$UNAME_S\" ]; then\n-\t. \"`dirname $0`/os.$UNAME_S\"\n-elif [ -r \"`dirname $0`/../lib/guilt/os.$UNAME_S\" ]; then\n-\t. \"`dirname $0`/../lib/guilt/os.$UNAME_S\"\n+if [ -r \"$GUILT_PATH/os.$UNAME_S\" ]; then\n+\t. \"$GUILT_PATH/os.$UNAME_S\"\n+elif [ -r \"$GUILT_PATH/../lib/guilt/os.$UNAME_S\" ]; then\n+\t. \"$GUILT_PATH/../lib/guilt/os.$UNAME_S\"\n else\n \tdie \"Unsupported operating system: $UNAME_S\"\n fi\ndiff --git a/guilt-add b/guilt-add\nindex 6529949..8a6b5a7 100755\n--- a/guilt-add\n+++ b/guilt-add\n@@ -5,7 +5,7 @@\n \n USAGE=\"<file>...\"\n if [ -z \"$GUILT_VERSION\" ]; then\n-\techo \"Invoking `basename $0` directly is no longer supported.\" >&2\n+\techo \"Invoking $GUILT directly is no longer supported.\" >&2\n \texit 1\n fi\n \ndiff --git a/guilt-applied b/guilt-applied\nindex a1f684a..a84f1f7 100755\n--- a/guilt-applied\n+++ b/guilt-applied\n@@ -5,7 +5,7 @@\n \n USAGE=\"[-c]\"\n if [ -z \"$GUILT_VERSION\" ]; then\n-\techo \"Invoking `basename $0` directly is no longer supported.\" >&2\n+\techo \"Invoking $GUILT directly is no longer supported.\" >&2\n \texit 1\n fi\n \ndiff --git a/guilt-branch b/guilt-branch\nindex 909f740..3e88321 100755\n--- a/guilt-branch\n+++ b/guilt-branch\n@@ -5,7 +5,7 @@\n \n USAGE=\"[<new_name>]\"\n if [ -z \"$GUILT_VERSION\" ]; then\n-\techo \"Invoking `basename $0` directly is no longer supported.\" >&2\n+\techo \"Invoking $GUILT directly is no longer supported.\" >&2\n \texit 1\n fi\n \ndiff --git a/guilt-commit b/guilt-commit\nindex 4228be6..4ef6605 100755\n--- a/guilt-commit\n+++ b/guilt-commit\n@@ -5,7 +5,7 @@\n \n USAGE=\"-n <num> | -a | --all\"\n if [ -z \"$GUILT_VERSION\" ]; then\n-\techo \"Invoking `basename $0` directly is no longer supported.\" >&2\n+\techo \"Invoking $GUILT directly is no longer supported.\" >&2\n \texit 1\n fi\n \ndiff --git a/guilt-delete b/guilt-delete\nindex 4ab9c94..551e6a4 100755\n--- a/guilt-delete\n+++ b/guilt-delete\n@@ -5,7 +5,7 @@\n \n USAGE=\"[-f] <patchname>\"\n if [ -z \"$GUILT_VERSION\" ]; then\n-\techo \"Invoking `basename $0` directly is no longer supported.\" >&2\n+\techo \"Invoking $GUILT directly is no longer supported.\" >&2\n \texit 1\n fi\n \ndiff --git a/guilt-diff b/guilt-diff\nindex 0061926..182fa59 100755\n--- a/guilt-diff\n+++ b/guilt-diff\n@@ -5,7 +5,7 @@\n \n USAGE=\"[-z] [<path>...]\"\n if [ -z \"$GUILT_VERSION\" ]; then\n-\techo \"Invoking `basename $0` directly is no longer supported.\" >&2\n+\techo \"Invoking $GUILT directly is no longer supported.\" >&2\n \texit 1\n fi\n \ndiff --git a/guilt-export b/guilt-export\nindex 8361902..62c1ef6 100755\n--- a/guilt-export\n+++ b/guilt-export\n@@ -5,7 +5,7 @@\n \n USAGE=\"[<target_dir>]\"\n if [ -z \"$GUILT_VERSION\" ]; then\n-\techo \"Invoking `basename $0` directly is no longer supported.\" >&2\n+\techo \"Invoking $GUILT directly is no longer supported.\" >&2\n \texit 1\n fi\n \ndiff --git a/guilt-files b/guilt-files\nindex f31a94c..aab35d5 100755\n--- a/guilt-files\n+++ b/guilt-files\n@@ -5,7 +5,7 @@\n \n USAGE=\"[-v] [-a] [-l]\"\n if [ -z \"$GUILT_VERSION\" ]; then\n-\techo \"Invoking `basename $0` directly is no longer supported.\" >&2\n+\techo \"Invoking $GUILT directly is no longer supported.\" >&2\n \texit 1\n fi\n \ndiff --git a/guilt-fold b/guilt-fold\nindex 06fbb7f..07d77a1 100755\n--- a/guilt-fold\n+++ b/guilt-fold\n@@ -5,7 +5,7 @@\n \n USAGE=\"[-k] <patchname>\"\n if [ -z \"$GUILT_VERSION\" ]; then\n-\techo \"Invoking `basename $0` directly is no longer supported.\" >&2\n+\techo \"Invoking $GUILT directly is no longer supported.\" >&2\n \texit 1\n fi\n \ndiff --git a/guilt-fork b/guilt-fork\nindex 8d58ffd..5677e1b 100755\n--- a/guilt-fork\n+++ b/guilt-fork\n@@ -5,7 +5,7 @@\n \n USAGE=\"[<new_name>]\"\n if [ -z \"$GUILT_VERSION\" ]; then\n-\techo \"Invoking `basename $0` directly is no longer supported.\" >&2\n+\techo \"Invoking $GUILT directly is no longer supported.\" >&2\n \texit 1\n fi\n \ndiff --git a/guilt-graph b/guilt-graph\nindex 496a831..1c9fade 100755\n--- a/guilt-graph\n+++ b/guilt-graph\n@@ -5,7 +5,7 @@\n \n USAGE=\"[<patchname>]\"\n if [ -z \"$GUILT_VERSION\" ]; then\n-\techo \"Invoking `basename $0` directly is no longer supported.\" >&2\n+\techo \"Invoking $GUILT directly is no longer supported.\" >&2\n \texit 1\n fi\n \ndiff --git a/guilt-guard b/guilt-guard\nindex 2c12fca..ada7f45 100755\n--- a/guilt-guard\n+++ b/guilt-guard\n@@ -5,7 +5,7 @@\n \n USAGE=\"[-l | --list | -n | --none | [<patchname>] [(+|-)<guard>...]]\"\n if [ -z \"$GUILT_VERSION\" ]; then\n-\techo \"Invoking `basename $0` directly is no longer supported.\" >&2\n+\techo \"Invoking $GUILT directly is no longer supported.\" >&2\n \texit 1\n fi\n \ndiff --git a/guilt-header b/guilt-header\nindex 9910708..19cfd45 100755\n--- a/guilt-header\n+++ b/guilt-header\n@@ -5,7 +5,7 @@\n \n USAGE=\"[-eE] [<patchname>]\"\n if [ -z \"$GUILT_VERSION\" ]; then\n-\techo \"Invoking `basename $0` directly is no longer supported.\" >&2\n+\techo \"Invoking $GUILT directly is no longer supported.\" >&2\n \texit 1\n fi\n \ndiff --git a/guilt-help b/guilt-help\nindex e1807a8..001ddfb 100755\n--- a/guilt-help\n+++ b/guilt-help\n@@ -7,7 +7,7 @@ DO_NOT_CHECK_BRANCH_EXISTENCE=1\n \n USAGE=\"[<command> | <topic>]\"\n if [ -z \"$GUILT_VERSION\" ]; then\n-\techo \"Invoking `basename $0` directly is no longer supported.\" >&2\n+\techo \"Invoking $GUILT directly is no longer supported.\" >&2\n \texit 1\n fi\n \ndiff --git a/guilt-import b/guilt-import\nindex 72ba7c3..041d20a 100755\n--- a/guilt-import\n+++ b/guilt-import\n@@ -5,7 +5,7 @@\n \n USAGE=\"[-P <patch> ] <patch_file>\"\n if [ -z \"$GUILT_VERSION\" ]; then\n-\techo \"Invoking `basename $0` directly is no longer supported.\" >&2\n+\techo \"Invoking $GUILT directly is no longer supported.\" >&2\n \texit 1\n fi\n \ndiff --git a/guilt-import-commit b/guilt-import-commit\nindex 3045a5f..1784f26 100755\n--- a/guilt-import-commit\n+++ b/guilt-import-commit\n@@ -5,7 +5,7 @@\n \n USAGE=\"[<hash> | <since>..[<until>] | ..<until>]\"\n if [ -z \"$GUILT_VERSION\" ]; then\n-\techo \"Invoking `basename $0` directly is no longer supported.\" >&2\n+\techo \"Invoking $GUILT directly is no longer supported.\" >&2\n \texit 1\n fi\n \ndiff --git a/guilt-init b/guilt-init\nindex 646e24b..148699c 100755\n--- a/guilt-init\n+++ b/guilt-init\n@@ -7,7 +7,7 @@ DO_NOT_CHECK_BRANCH_EXISTENCE=1\n \n USAGE=\"\"\n if [ -z \"$GUILT_VERSION\" ]; then\n-\techo \"Invoking `basename $0` directly is no longer supported.\" >&2\n+\techo \"Invoking $GUILT directly is no longer supported.\" >&2\n \texit 1\n fi\n \ndiff --git a/guilt-new b/guilt-new\nindex 402104e..0803063 100755\n--- a/guilt-new\n+++ b/guilt-new\n@@ -5,7 +5,7 @@\n \n USAGE=\"[-f] [-s] [-e|-m message] <patchname>\"\n if [ -z \"$GUILT_VERSION\" ]; then\n-\techo \"Invoking `basename $0` directly is no longer supported.\" >&2\n+\techo \"Invoking $GUILT directly is no longer supported.\" >&2\n \texit 1\n fi\n \ndiff --git a/guilt-next b/guilt-next\nindex a0941fc..c7263f1 100755\n--- a/guilt-next\n+++ b/guilt-next\n@@ -5,7 +5,7 @@\n \n USAGE=\"[-p|--path]\"\n if [ -z \"$GUILT_VERSION\" ]; then\n-\techo \"Invoking `basename $0` directly is no longer supported.\" >&2\n+\techo \"Invoking $GUILT directly is no longer supported.\" >&2\n \texit 1\n fi\n \ndiff --git a/guilt-patchbomb b/guilt-patchbomb\nindex b72a706..c61cd1b 100755\n--- a/guilt-patchbomb\n+++ b/guilt-patchbomb\n@@ -7,7 +7,7 @@ DO_NOT_CHECK_BRANCH_EXISTENCE=1\n \n USAGE=\"[-n] [-s] [--in-reply-to <msgid>] [--git] [--subject-prefix <prefix>] [<hash> | <since>..[<until>] | ..<until>]\"\n if [ -z \"$GUILT_VERSION\" ]; then\n-\techo \"Invoking `basename $0` directly is no longer supported.\" >&2\n+\techo \"Invoking $GUILT directly is no longer supported.\" >&2\n \texit 1\n fi\n \ndiff --git a/guilt-pop b/guilt-pop\nindex df466c7..1e36f00 100755\n--- a/guilt-pop\n+++ b/guilt-pop\n@@ -5,7 +5,7 @@\n \n USAGE=\"[-f] [-a | --all | -n <num> | <patchname>]\"\n if [ -z \"$GUILT_VERSION\" ]; then\n-\techo \"Invoking `basename $0` directly is no longer supported.\" >&2\n+\techo \"Invoking $GUILT directly is no longer supported.\" >&2\n \texit 1\n fi\n \ndiff --git a/guilt-prev b/guilt-prev\nindex d454030..31c054c 100755\n--- a/guilt-prev\n+++ b/guilt-prev\n@@ -5,7 +5,7 @@\n \n USAGE=\"[-p|--path]\"\n if [ -z \"$GUILT_VERSION\" ]; then\n-\techo \"Invoking `basename $0` directly is no longer supported.\" >&2\n+\techo \"Invoking $GUILT directly is no longer supported.\" >&2\n \texit 1\n fi\n \ndiff --git a/guilt-push b/guilt-push\nindex d9a8590..4a54d07 100755\n--- a/guilt-push\n+++ b/guilt-push\n@@ -5,7 +5,7 @@\n \n USAGE=\"[ -f ] [-a | --all | -n <num> | <patchname>]\"\n if [ -z \"$GUILT_VERSION\" ]; then\n-\techo \"Invoking `basename $0` directly is no longer supported.\" >&2\n+\techo \"Invoking $GUILT directly is no longer supported.\" >&2\n \texit 1\n fi\n \ndiff --git a/guilt-rebase b/guilt-rebase\nindex 614ba22..c33022f 100755\n--- a/guilt-rebase\n+++ b/guilt-rebase\n@@ -7,7 +7,7 @@\n \n USAGE=\"<upstream>\"\n if [ -z \"$GUILT_VERSION\" ]; then\n-\techo \"Invoking `basename $0` directly is no longer supported.\" >&2\n+\techo \"Invoking $GUILT directly is no longer supported.\" >&2\n \texit 1\n fi\n \ndiff --git a/guilt-refresh b/guilt-refresh\nindex f764937..4e22929 100755\n--- a/guilt-refresh\n+++ b/guilt-refresh\n@@ -5,7 +5,7 @@\n \n USAGE=\"[--git] [--diffstat]\"\n if [ -z \"$GUILT_VERSION\" ]; then\n-\techo \"Invoking `basename $0` directly is no longer supported.\" >&2\n+\techo \"Invoking $GUILT directly is no longer supported.\" >&2\n \texit 1\n fi\n \ndiff --git a/guilt-repair b/guilt-repair\nindex 77ad223..99df731 100755\n--- a/guilt-repair\n+++ b/guilt-repair\n@@ -7,7 +7,7 @@ DO_NOT_CHECK_STATUS_FILE_FORMAT=1\n \n USAGE=\"--full | --status\"\n if [ -z \"$GUILT_VERSION\" ]; then\n-\techo \"Invoking `basename $0` directly is no longer supported.\" >&2\n+\techo \"Invoking $GUILT directly is no longer supported.\" >&2\n \texit 1\n fi\n \ndiff --git a/guilt-rm b/guilt-rm\nindex 351ec93..d68622b 100755\n--- a/guilt-rm\n+++ b/guilt-rm\n@@ -5,7 +5,7 @@\n \n USAGE=\"<file>...\"\n if [ -z \"$GUILT_VERSION\" ]; then\n-\techo \"Invoking `basename $0` directly is no longer supported.\" >&2\n+\techo \"Invoking $GUILT directly is no longer supported.\" >&2\n \texit 1\n fi\n \ndiff --git a/guilt-select b/guilt-select\nindex 8b139d4..fb7941b 100755\n--- a/guilt-select\n+++ b/guilt-select\n@@ -5,7 +5,7 @@\n \n USAGE=\"[ -n | --none | -s | --series | [--pop|--reapply] <guards...> ]\"\n if [ -z \"$GUILT_VERSION\" ]; then\n-\techo \"Invoking `basename $0` directly is no longer supported.\" >&2\n+\techo \"Invoking $GUILT directly is no longer supported.\" >&2\n \texit 1\n fi\n \ndiff --git a/guilt-series b/guilt-series\nindex c87b31e..f8cd7c7 100755\n--- a/guilt-series\n+++ b/guilt-series\n@@ -5,7 +5,7 @@\n \n USAGE=\"[-v | -g | -e]\"\n if [ -z \"$GUILT_VERSION\" ]; then\n-\techo \"Invoking `basename $0` directly is no longer supported.\" >&2\n+\techo \"Invoking $GUILT directly is no longer supported.\" >&2\n \texit 1\n fi\n \ndiff --git a/guilt-status b/guilt-status\nindex c701fd1..b4cd1eb 100755\n--- a/guilt-status\n+++ b/guilt-status\n@@ -5,7 +5,7 @@\n \n USAGE=\"[-a|-A] [-c|-C] [-d|-D] [-m|-M] [-r|-R] [-t|-T] [-u|-U] [-x|-X] [-n]\"\n if [ -z \"$GUILT_VERSION\" ]; then\n-\techo \"Invoking `basename $0` directly is no longer supported.\" >&2\n+\techo \"Invoking $GUILT directly is no longer supported.\" >&2\n \texit 1\n fi\n \ndiff --git a/guilt-top b/guilt-top\nindex 3b1d596..6215009 100755\n--- a/guilt-top\n+++ b/guilt-top\n@@ -5,7 +5,7 @@\n \n USAGE=\"[-p|--path]\"\n if [ -z \"$GUILT_VERSION\" ]; then\n-\techo \"Invoking `basename $0` directly is no longer supported.\" >&2\n+\techo \"Invoking $GUILT directly is no longer supported.\" >&2\n \texit 1\n fi\n \ndiff --git a/guilt-unapplied b/guilt-unapplied\nindex e703408..9aec87a 100755\n--- a/guilt-unapplied\n+++ b/guilt-unapplied\n@@ -5,7 +5,7 @@\n \n USAGE=\"\"\n if [ -z \"$GUILT_VERSION\" ]; then\n-\techo \"Invoking `basename $0` directly is no longer supported.\" >&2\n+\techo \"Invoking $GUILT directly is no longer supported.\" >&2\n \texit 1\n fi\n \n-- \n1.7.4.1\n"},{"id":"176412","messageId":"1317219324-10319-6-git-send-email-alan.christopher.jenkins@googlemail.com","threadId":"28519","inReplyTo":"1317219324-10319-1-git-send-email-alan.christopher.jenkins@googlemail.com","subject":"[GUILT 6/6] Allow the regression tests to be run from a directory with spaces in","fromName":"Alan Jenkins","fromEmail":"alan.christopher.jenkins@googlemail.com","sentAt":"2011-09-28T14:15:24Z","receivedAt":"2011-09-28T14:15:24Z","isPatch":false,"sender":{"key":"alan.christopher.jenkins@googlemail.com","avatar":null},"body":"sed -i regression/*.sh 's|source $REG_DIR/scaffold|source \"$REG_DIR/scaffold\"|'\n\nSame as the previous patch: it turned out I don't need this,\nbut you might think it's a good idea anyway.\n\nSigned-off-by: Alan Jenkins <alan.christopher.jenkins@googlemail.com>\n---\n regression/t-010.sh |    2 +-\n regression/t-011.sh |    2 +-\n regression/t-020.sh |    2 +-\n regression/t-021.sh |    2 +-\n regression/t-022.sh |    2 +-\n regression/t-023.sh |    2 +-\n regression/t-024.sh |    2 +-\n regression/t-025.sh |    2 +-\n regression/t-026.sh |    2 +-\n regression/t-027.sh |    2 +-\n regression/t-028.sh |    2 +-\n regression/t-029.sh |    2 +-\n regression/t-030.sh |    2 +-\n regression/t-031.sh |    2 +-\n regression/t-032.sh |    2 +-\n regression/t-050.sh |    2 +-\n regression/t-051.sh |    2 +-\n regression/t-052.sh |    2 +-\n regression/t-060.sh |    2 +-\n 19 files changed, 19 insertions(+), 19 deletions(-)\n\ndiff --git a/regression/t-010.sh b/regression/t-010.sh\nindex 1fc88fa..9bbf32a 100755\n--- a/regression/t-010.sh\n+++ b/regression/t-010.sh\n@@ -3,7 +3,7 @@\n # Test the init code\n #\n \n-source $REG_DIR/scaffold\n+source \"$REG_DIR/scaffold\"\n \n function opts\n {\ndiff --git a/regression/t-011.sh b/regression/t-011.sh\nindex fde7b90..55a72d7 100755\n--- a/regression/t-011.sh\n+++ b/regression/t-011.sh\n@@ -4,7 +4,7 @@\n # not guilt init'ed\n #\n \n-source $REG_DIR/scaffold\n+source \"$REG_DIR/scaffold\"\n \n cmd setup_git_repo\n \ndiff --git a/regression/t-020.sh b/regression/t-020.sh\nindex 6598b02..cdd08ba 100755\n--- a/regression/t-020.sh\n+++ b/regression/t-020.sh\n@@ -3,7 +3,7 @@\n # Test the push code\n #\n \n-source $REG_DIR/scaffold\n+source \"$REG_DIR/scaffold\"\n \n cmd setup_repo\n \ndiff --git a/regression/t-021.sh b/regression/t-021.sh\nindex 035973c..6337d7b 100755\n--- a/regression/t-021.sh\n+++ b/regression/t-021.sh\n@@ -3,7 +3,7 @@\n # Test the pop code\n #\n \n-source $REG_DIR/scaffold\n+source \"$REG_DIR/scaffold\"\n \n cmd setup_repo\n \ndiff --git a/regression/t-022.sh b/regression/t-022.sh\nindex e43dc0a..0fe345b 100755\n--- a/regression/t-022.sh\n+++ b/regression/t-022.sh\n@@ -3,7 +3,7 @@\n # Test the applied code\n #\n \n-source $REG_DIR/scaffold\n+source \"$REG_DIR/scaffold\"\n \n cmd setup_repo\n \ndiff --git a/regression/t-023.sh b/regression/t-023.sh\nindex 1e976fd..c0530d6 100755\n--- a/regression/t-023.sh\n+++ b/regression/t-023.sh\n@@ -3,7 +3,7 @@\n # Test the top code\n #\n \n-source $REG_DIR/scaffold\n+source \"$REG_DIR/scaffold\"\n \n cmd setup_repo\n \ndiff --git a/regression/t-024.sh b/regression/t-024.sh\nindex 9b11286..38f53aa 100755\n--- a/regression/t-024.sh\n+++ b/regression/t-024.sh\n@@ -3,7 +3,7 @@\n # Test the unapplied code\n #\n \n-source $REG_DIR/scaffold\n+source \"$REG_DIR/scaffold\"\n \n cmd setup_repo\n \ndiff --git a/regression/t-025.sh b/regression/t-025.sh\nindex 6aa9bd3..3824608 100755\n--- a/regression/t-025.sh\n+++ b/regression/t-025.sh\n@@ -3,7 +3,7 @@\n # Test the new code\n #\n \n-source $REG_DIR/scaffold\n+source \"$REG_DIR/scaffold\"\n \n cmd setup_repo\n \ndiff --git a/regression/t-026.sh b/regression/t-026.sh\nindex 5f29352..0ccdf85 100755\n--- a/regression/t-026.sh\n+++ b/regression/t-026.sh\n@@ -3,7 +3,7 @@\n # Test the delete code\n #\n \n-source $REG_DIR/scaffold\n+source \"$REG_DIR/scaffold\"\n \n cmd setup_repo\n \ndiff --git a/regression/t-027.sh b/regression/t-027.sh\nindex ee70229..2f5bb9f 100755\n--- a/regression/t-027.sh\n+++ b/regression/t-027.sh\n@@ -3,7 +3,7 @@\n # Test the refresh code\n #\n \n-source $REG_DIR/scaffold\n+source \"$REG_DIR/scaffold\"\n \n cmd setup_repo\n \ndiff --git a/regression/t-028.sh b/regression/t-028.sh\nindex 83fa879..8480100 100755\n--- a/regression/t-028.sh\n+++ b/regression/t-028.sh\n@@ -3,7 +3,7 @@\n # Test the header code\n #\n \n-source $REG_DIR/scaffold\n+source \"$REG_DIR/scaffold\"\n \n cmd setup_repo\n \ndiff --git a/regression/t-029.sh b/regression/t-029.sh\nindex 83e1d2b..e4036bf 100755\n--- a/regression/t-029.sh\n+++ b/regression/t-029.sh\n@@ -5,7 +5,7 @@\n \n # FIXME: test status file format upgrade code\n \n-source $REG_DIR/scaffold\n+source \"$REG_DIR/scaffold\"\n \n cmd setup_repo\n \ndiff --git a/regression/t-030.sh b/regression/t-030.sh\nindex 0352948..06bd58f 100755\n--- a/regression/t-030.sh\n+++ b/regression/t-030.sh\n@@ -3,7 +3,7 @@\n # Test the commit code\n #\n \n-source $REG_DIR/scaffold\n+source \"$REG_DIR/scaffold\"\n \n cmd setup_repo\n \ndiff --git a/regression/t-031.sh b/regression/t-031.sh\nindex 9b5db6f..20c2a6b 100755\n--- a/regression/t-031.sh\n+++ b/regression/t-031.sh\n@@ -3,7 +3,7 @@\n # Test the fork code\n #\n \n-source $REG_DIR/scaffold\n+source \"$REG_DIR/scaffold\"\n \n cmd setup_repo\n \ndiff --git a/regression/t-032.sh b/regression/t-032.sh\nindex 3b32da5..b1d5f19 100755\n--- a/regression/t-032.sh\n+++ b/regression/t-032.sh\n@@ -3,7 +3,7 @@\n # Test the import code\n #\n \n-source $REG_DIR/scaffold\n+source \"$REG_DIR/scaffold\"\n \n cmd setup_repo\n \ndiff --git a/regression/t-050.sh b/regression/t-050.sh\nindex 82ac412..88be546 100755\n--- a/regression/t-050.sh\n+++ b/regression/t-050.sh\n@@ -3,7 +3,7 @@\n # Test the series code\n #\n \n-source $REG_DIR/scaffold\n+source \"$REG_DIR/scaffold\"\n \n cmd setup_repo\n \ndiff --git a/regression/t-051.sh b/regression/t-051.sh\nindex a05fcca..293459c 100755\n--- a/regression/t-051.sh\n+++ b/regression/t-051.sh\n@@ -3,7 +3,7 @@\n # Test the commands that use get_*_series, while applying guards\n #\n \n-source $REG_DIR/scaffold\n+source \"$REG_DIR/scaffold\"\n \n cmd setup_repo\n \ndiff --git a/regression/t-052.sh b/regression/t-052.sh\nindex e9c1a59..f8c60ab 100755\n--- a/regression/t-052.sh\n+++ b/regression/t-052.sh\n@@ -3,7 +3,7 @@\n # Test the commands that use get_*_series, while applying guards\n #\n \n-source $REG_DIR/scaffold\n+source \"$REG_DIR/scaffold\"\n \n cmd setup_repo\n \ndiff --git a/regression/t-060.sh b/regression/t-060.sh\nindex ec33d80..ebe93bd 100755\n--- a/regression/t-060.sh\n+++ b/regression/t-060.sh\n@@ -3,7 +3,7 @@\n # Test the guilt files code\n #\n \n-source $REG_DIR/scaffold\n+source \"$REG_DIR/scaffold\"\n \n cmd setup_repo\n \n-- \n1.7.4.1\n"},{"id":"176581","messageId":"20110930171502.GE18364@poseidon.cudanet.local","threadId":"28519","inReplyTo":"1317219324-10319-1-git-send-email-alan.christopher.jenkins@googlemail.com","subject":"Re: [GUILT 1/6] Refuse to push corrupt patches","fromName":"Josef 'Jeff' Sipek","fromEmail":"jeffpc@josefsipek.net","sentAt":"2011-09-30T17:15:02Z","receivedAt":"2011-09-30T17:15:02Z","isPatch":false,"sender":{"key":"jeffpc@josefsipek.net","avatar":null},"body":"Thanks for the patches.  I looked them over and they look good.  I'll give\nthem another thorough reading once I have a bit of time to apply them.\n\nJeff.\n\nOn Wed, Sep 28, 2011 at 03:15:19PM +0100, Alan Jenkins wrote:\n> \"guilt push\" would treat corrupt patches as empty,\n> because \"git apply --numstat\" prints nothing on stdout.\n> \n> (You do get an error message on stderr,\n>  but then guilt says \"Patch applied\" etc,\n>  and I didn't notice the earlier error message\n>  for quite some time.)\n> \n> Signed-off-by: Alan Jenkins <alan.christopher.jenkins@googlemail.com>\n> ---\n>  guilt |    2 +-\n>  1 files changed, 1 insertions(+), 1 deletions(-)\n> \n> diff --git a/guilt b/guilt\n> index d1e17d4..51532f9 100755\n> --- a/guilt\n> +++ b/guilt\n> @@ -611,7 +611,7 @@ push_patch()\n>  \t\tcd_to_toplevel\n>  \n>  \t\t# apply the patch if and only if there is something to apply\n> -\t\tif [ `git apply --numstat \"$p\" | wc -l` -gt 0 ]; then\n> +\t\tif [ `do_get_patch \"$p\" | wc -l` -gt 0 ]; then\n>  \t\t\tif [ \"$bail_action\" = abort ]; then\n>  \t\t\t\treject=\"\"\n>  \t\t\tfi\n> -- \n> 1.7.4.1\n> \n\n-- \nHegh QaQ law'\nquvHa'ghach QaQ puS\n"}]}