{"thread":{"id":"36262","subject":"[GUILT 00/28] Teach guilt import-commit how create legal patch names, and more","startedAt":"2014-03-21T07:31:38Z","lastAt":"2014-05-13T21:35:05Z","messageCount":61,"participants":["Per Cederqvist","Eric Sunshine","Jeff Sipek"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"237268","messageId":"1395387126-13681-1-git-send-email-cederp@opera.com","threadId":"36262","inReplyTo":null,"subject":"[GUILT 00/28] Teach guilt import-commit how create legal patch names, and more","fromName":"Per Cederqvist","fromEmail":"cederp@opera.com","sentAt":"2014-03-21T07:31:38Z","receivedAt":"2014-03-21T07:31:38Z","isPatch":false,"sender":{"key":"cederp@opera.com","avatar":"https://gravatar.com/avatar/008fe28caedea0ba34042cd5157705267934f4ba7a9b29fb248ae18ec5b3055e?d=mp&s=160"},"body":"I recently found myself sitting on a train with a computer in front of\nme.  I tried to use \"guilt import-commit\", which seemed to work, but\nwhen I tried to \"guilt push\" the commits I had just imported I got\nsome errors.  It turned out that \"guilt import-commit\" had generated\ninvalid patch names.\n\nI decided to fix the issue, and write a test case that demonstrated\nthe problem.\n\nOne thing led to another, and here I am, a few late nights at a hotel\nand a return trip on the train later, submitting a patch series in 28\nparts.  Sorry about the number of patches, but this is what happens\nwhen you uncover a bug while writing a test case for the bug you\nuncovered while writing a test case for your original problem.\n\nThe patch series consists of:\n\n - A number of fixes to the test suite.\n\n - A number of bug fixes which I hope are non-controversial.  Most of\n   the fixes have test cases.\n\n - Changed behavior: \"guilt push\" when there is nothing more to push\n   now uses exit status 1.  This makes it possible to write shell\n   loops such as \"while guilt push; do make test||break; done\".  Also,\n   \"guilt pop\" when no patches are applied also uses exit status 1.\n   (This aligns \"guilt push\" and \"guilt pop\" with how \"hg qpush\" and\n   \"hg qpop\" has worked for several years.)\n\n - Changed behavior: by default, guilt no longer changes branch when\n   you push a patch.  You need to do \"git config guilt.reusebranch\n   false\" to re-enable that.  This patch sets the default value of\n   guilt.reusebranch to true; it should in my opinion change to false\n   a year or two after the next release.\n\nA more detailed overview of the patches:\n\n1. Some tests fail if \"git config guilt.diffstat true\" is in effect.\n\n2-4. Some commands fail if run from a directory with spaces in its\n     name.\n\n5. \"guilt new\" had an overly restrictive argument parser.\n\n6-8. guilt.diffstat could break \"guilt fold\" and \"guilt new\".\n\n9-10. The test suite did not test exit status properly.\n\n11. Remove pointless redirections in the test suite.\n\n12-13. \"guilt header\" tried to check if a patch existed, but the check\n        was broken.\n\n14-16. Various parts of guilt tried to ensure that patch names were\n       legal git branch names, but failed.\n\n17-20. \"guilt graph\" failed when no patch was applied, and when a\n       branch name contained a comma or a quote.\n\n21-23. \"git config log.decorate short\" caused \"guilt import-commit\",\n       \"guilt patchbomb\" and \"guilt rebase\" to fail in various ways.\n\n24. Patches may contain backslashes, but various informative messages\n    from guilt did backslash processing.\n\n25-26. \"guilt push\" and \"guilt pop\" should fail when there is nothing\n       to do.\n\n27-28. These two commits were things I intended to contribute a while\n       back, when contributing the \"Change git branch when patches are\n       applied\" change (commit 67d3af63f422).  These commits makes\n       that behavior optional, and it defaults to being disabled, so\n       that you can use both Guilt v0.35 (and earlier) and the current\n       Guilt code against the same repo.  These commits add some code\n       complexity, and you might want to skip them if you think the\n       current behavior is better.\n\nThis patch series is also available on\nhttp://repo.or.cz/w/guilt/ceder.git in the \"oslo-2014\" branch.  If you\nalready have a copy of guilt, you should be able to fetch that branch\nwith something like:\n\n    git remote add ceder http://repo.or.cz/r/guilt/ceder.git\n    git fetch ceder refs/heads/oslo-2014:refs/remotes/ceder/oslo-2014\n\nA few of the regression/t-*.out files contain non-ASCII characters.  I\nhope they survive the mail transfer; if not, please use the repo above\nto fetch the commits.\n\n\nPer Cederqvist (28):\n  The tests should not fail if guilt.diffstat is set.\n  Allow \"guilt delete -f\" to run from a dir which contains spaces.\n  Added test case for \"guilt delete -f\".\n  Allow \"guilt import-commit\" to run from a dir which contains spaces.\n  \"guilt new\": Accept more than 4 arguments.\n  Fix and simplify the do_get_patch function.\n  Added test cases for \"guilt fold\".\n  Added more test cases for \"guilt new\": empty patches.\n  Test suite: properly check the exit status of commands.\n  Run test_failed if the exit status of a test script is bad.\n  test suite: remove pointless redirection.\n  \"guilt header\": more robust header selection.\n  Check that \"guilt header '.*'\" fails.\n  Use \"git check-ref-format\" to validate patch names.\n  Produce legal patch names in guilt-import-commit.\n  Fix backslash handling when creating names of imported patches.\n  \"guilt graph\" no longer loops when no patches are applied.\n  guilt-graph: Handle commas in branch names.\n  Check that \"guilt graph\" works when working on a branch with a comma.\n  \"guilt graph\": Handle patch names containing quotes.\n  The log.decorate setting should not influence import-commit.\n  The log.decorate setting should not influence patchbomb.\n  The log.decorate setting should not influence guilt rebase.\n  disp no longer processes backslashes.\n  \"guilt push\" now fails when there are no more patches to push.\n  \"guilt pop\" now fails when there are no more patches to pop.\n  Minor testsuite fix.\n  Added guilt.reusebranch configuration option.\n\n guilt                |  76 ++++--\n guilt-delete         |   2 +-\n guilt-fork           |   2 +-\n guilt-graph          |  14 +-\n guilt-header         |  33 ++-\n guilt-import         |   2 +-\n guilt-import-commit  |  32 ++-\n guilt-new            |   9 +-\n guilt-patchbomb      |   2 +-\n guilt-pop            |  13 +-\n guilt-push           |  14 +-\n guilt-rebase         |   2 +-\n regression/run-tests |  11 +-\n regression/scaffold  |  19 +-\n regression/t-020.out | 339 ++++++++++++++++++++++++++\n regression/t-020.sh  |  73 +++++-\n regression/t-021.out |   2 +\n regression/t-021.sh  |   8 +-\n regression/t-025.out | 426 ++++++++++++++++++++++++++++++++-\n regression/t-025.sh  |  14 +-\n regression/t-026.out |  15 ++\n regression/t-026.sh  |   5 +-\n regression/t-028.out |   7 +\n regression/t-028.sh  |   6 +-\n regression/t-032.out |   4 +-\n regression/t-032.sh  |   2 +-\n regression/t-033.out |  87 +++++++\n regression/t-033.sh  |  57 +++++\n regression/t-034.out | 569 ++++++++++++++++++++++++++++++++++++++++++++\n regression/t-034.sh  |  74 ++++++\n regression/t-035.out | 659 +++++++++++++++++++++++++++++++++++++++++++++++++++\n regression/t-035.sh  |  88 +++++++\n regression/t-061.out |   1 -\n regression/t-061.sh  |   9 +-\n regression/t-062.out | 441 ++++++++++++++++++++++++++++++++++\n regression/t-062.sh  | 140 +++++++++++\n 36 files changed, 3168 insertions(+), 89 deletions(-)\n create mode 100644 regression/t-033.out\n create mode 100755 regression/t-033.sh\n create mode 100644 regression/t-034.out\n create mode 100755 regression/t-034.sh\n create mode 100644 regression/t-035.out\n create mode 100755 regression/t-035.sh\n create mode 100644 regression/t-062.out\n create mode 100755 regression/t-062.sh\n\nYours,\n    /ceder\n\n-- \n1.8.3.1\n"},{"id":"237295","messageId":"1395387126-13681-2-git-send-email-cederp@opera.com","threadId":"36262","inReplyTo":"1395387126-13681-1-git-send-email-cederp@opera.com","subject":"[GUILT 01/28] The tests should not fail if guilt.diffstat is set.","fromName":"Per Cederqvist","fromEmail":"cederp@opera.com","sentAt":"2014-03-21T07:31:39Z","receivedAt":"2014-03-21T07:31:39Z","isPatch":false,"sender":{"key":"cederp@opera.com","avatar":"https://gravatar.com/avatar/008fe28caedea0ba34042cd5157705267934f4ba7a9b29fb248ae18ec5b3055e?d=mp&s=160"},"body":"Explicitly set guilt.diffstat to its default value.  Without this, the\n027 test (and possibly others) fail if guilt.diffstat is set to true\nin ~/.gitconfig.\n\nSigned-off-by: Per Cederqvist <cederp@opera.com>\n---\n regression/scaffold | 1 +\n 1 file changed, 1 insertion(+)\n\ndiff --git a/regression/scaffold b/regression/scaffold\nindex 546d8c6..5c8b73e 100644\n--- a/regression/scaffold\n+++ b/regression/scaffold\n@@ -87,6 +87,7 @@ function setup_git_repo\n \t# Explicitly set config that the tests rely on.\n \tgit config log.date default\n \tgit config log.decorate no\n+\tgit config guilt.diffstat false\n }\n \n function setup_guilt_repo\n-- \n1.8.3.1\n"},{"id":"237269","messageId":"1395387126-13681-3-git-send-email-cederp@opera.com","threadId":"36262","inReplyTo":"1395387126-13681-1-git-send-email-cederp@opera.com","subject":"[GUILT 02/28] Allow \"guilt delete -f\" to run from a dir which contains spaces.","fromName":"Per Cederqvist","fromEmail":"cederp@opera.com","sentAt":"2014-03-21T07:31:40Z","receivedAt":"2014-03-21T07:31:40Z","isPatch":false,"sender":{"key":"cederp@opera.com","avatar":"https://gravatar.com/avatar/008fe28caedea0ba34042cd5157705267934f4ba7a9b29fb248ae18ec5b3055e?d=mp&s=160"},"body":"Signed-off-by: Per Cederqvist <cederp@opera.com>\n---\n guilt-delete | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/guilt-delete b/guilt-delete\nindex 3e394f8..967ac10 100755\n--- a/guilt-delete\n+++ b/guilt-delete\n@@ -49,7 +49,7 @@ series_remove_patch \"$patch\"\n \n guilt_hook \"delete\" \"$patch\"\n \n-[ ! -z \"$force\" ] && rm -f $GUILT_DIR/$branch/$patch\n+[ ! -z \"$force\" ] && rm -f \"$GUILT_DIR/$branch/$patch\"\n \n exit 0\n \n-- \n1.8.3.1\n"},{"id":"237271","messageId":"1395387126-13681-4-git-send-email-cederp@opera.com","threadId":"36262","inReplyTo":"1395387126-13681-1-git-send-email-cederp@opera.com","subject":"[GUILT 03/28] Added test case for \"guilt delete -f\".","fromName":"Per Cederqvist","fromEmail":"cederp@opera.com","sentAt":"2014-03-21T07:31:41Z","receivedAt":"2014-03-21T07:31:41Z","isPatch":false,"sender":{"key":"cederp@opera.com","avatar":"https://gravatar.com/avatar/008fe28caedea0ba34042cd5157705267934f4ba7a9b29fb248ae18ec5b3055e?d=mp&s=160"},"body":"Ensure that the file really is deleted.\n\nSigned-off-by: Per Cederqvist <cederp@opera.com>\n---\n regression/t-026.out | 15 +++++++++++++++\n regression/t-026.sh  |  5 ++++-\n 2 files changed, 19 insertions(+), 1 deletion(-)\n\ndiff --git a/regression/t-026.out b/regression/t-026.out\nindex 3b9fb14..be50b48 100644\n--- a/regression/t-026.out\n+++ b/regression/t-026.out\n@@ -29,3 +29,18 @@ f 7848194fd2e9ee0eb6589482900687d799d60a12  .git/patches/master/series\n f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add\n f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify\n f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/status\n+% guilt new delete-me\n+% guilt pop\n+All patches popped.\n+% guilt delete -f delete-me\n+% list_files\n+d .git/patches\n+d .git/patches/master\n+d .git/refs/patches\n+d .git/refs/patches/master\n+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode\n+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove\n+f 7848194fd2e9ee0eb6589482900687d799d60a12  .git/patches/master/series\n+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add\n+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/status\ndiff --git a/regression/t-026.sh b/regression/t-026.sh\nindex 0ccdf85..e25d0df 100755\n--- a/regression/t-026.sh\n+++ b/regression/t-026.sh\n@@ -20,4 +20,7 @@ cmd guilt delete add\n \n cmd list_files\n \n-# FIXME: test delete -f\n+cmd guilt new delete-me\n+cmd guilt pop\n+cmd guilt delete -f delete-me\n+cmd list_files\n-- \n1.8.3.1\n"},{"id":"237293","messageId":"1395387126-13681-5-git-send-email-cederp@opera.com","threadId":"36262","inReplyTo":"1395387126-13681-1-git-send-email-cederp@opera.com","subject":"[GUILT 04/28] Allow \"guilt import-commit\" to run from a dir which contains spaces.","fromName":"Per Cederqvist","fromEmail":"cederp@opera.com","sentAt":"2014-03-21T07:31:42Z","receivedAt":"2014-03-21T07:31:42Z","isPatch":false,"sender":{"key":"cederp@opera.com","avatar":"https://gravatar.com/avatar/008fe28caedea0ba34042cd5157705267934f4ba7a9b29fb248ae18ec5b3055e?d=mp&s=160"},"body":"Signed-off-by: Per Cederqvist <cederp@opera.com>\n---\n guilt-import-commit | 6 +++---\n 1 file changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/guilt-import-commit b/guilt-import-commit\nindex 20dcee2..9488ded 100755\n--- a/guilt-import-commit\n+++ b/guilt-import-commit\n@@ -23,7 +23,7 @@ if ! must_commit_first; then\n fi\n \n disp \"About to begin conversion...\" >&2\n-disp \"Current head: `cat $GIT_DIR/refs/heads/\\`git_branch\\``\" >&2\n+disp \"Current head: `cat \\\"$GIT_DIR\\\"/refs/heads/\\`git_branch\\``\" >&2\n \n for rev in `git rev-list $rhash`; do\n \ts=`git log --pretty=oneline -1 $rev | cut -c 42-`\n@@ -46,7 +46,7 @@ for rev in `git rev-list $rhash`; do\n \t\tdo_make_header $rev\n \t\techo \"\"\n \t\tgit diff --binary $rev^..$rev\n-\t) > $GUILT_DIR/$branch/$fname\n+\t) > \"$GUILT_DIR/$branch/$fname\"\n \n \t# FIXME: grab the GIT_AUTHOR_DATE from the commit object and set the\n \t# timestamp on the patch\n@@ -68,6 +68,6 @@ for rev in `git rev-list $rhash`; do\n done\n \n disp \"Done.\" >&2\n-disp \"Current head: `cat $GIT_DIR/refs/heads/\\`git_branch\\``\" >&2\n+disp \"Current head: `cat \\\"$GIT_DIR\\\"/refs/heads/\\`git_branch\\``\" >&2\n \n }\n-- \n1.8.3.1\n"},{"id":"237290","messageId":"1395387126-13681-6-git-send-email-cederp@opera.com","threadId":"36262","inReplyTo":"1395387126-13681-1-git-send-email-cederp@opera.com","subject":"[GUILT 05/28] \"guilt new\": Accept more than 4 arguments.","fromName":"Per Cederqvist","fromEmail":"cederp@opera.com","sentAt":"2014-03-21T07:31:43Z","receivedAt":"2014-03-21T07:31:43Z","isPatch":false,"sender":{"key":"cederp@opera.com","avatar":"https://gravatar.com/avatar/008fe28caedea0ba34042cd5157705267934f4ba7a9b29fb248ae18ec5b3055e?d=mp&s=160"},"body":"The argument parser arbitrarily refused to accept more than 4\narguments.  That made it impossible to run \"guilt new -f -s -m msg\npatch\".  Removed the checks for the number of arguments from the\n\"guilt new\" parser -- the other checks that are already there are\nenough to catch all errors.\n\nGive a better error message if \"-m\" isn't followed by a message\nargument.\n\nSigned-off-by: Per Cederqvist <cederp@opera.com>\n---\n guilt-new | 7 +++----\n 1 file changed, 3 insertions(+), 4 deletions(-)\n\ndiff --git a/guilt-new b/guilt-new\nindex bb68924..9528438 100755\n--- a/guilt-new\n+++ b/guilt-new\n@@ -11,10 +11,6 @@ fi\n \n _main() {\n \n-if [ $# -lt 1 ] || [ $# -gt 4 ]; then\n-\tusage\n-fi\n-\n while [ $# -gt 0 ] ; do\n \tcase \"$1\" in\n \t\t-f)\n@@ -31,6 +27,9 @@ while [ $# -gt 0 ] ; do\n \t\t\tfi\n \t\t\t;;\n \t\t-m)\n+\t\t\tif [ $# -eq 1 ]; then\n+\t\t\t\tusage\n+\t\t\tfi\n \t\t\tmsg=\"$2\"\n \t\t\tshift\n \n-- \n1.8.3.1\n"},{"id":"237272","messageId":"1395387126-13681-7-git-send-email-cederp@opera.com","threadId":"36262","inReplyTo":"1395387126-13681-1-git-send-email-cederp@opera.com","subject":"[GUILT 06/28] Fix and simplify the do_get_patch function.","fromName":"Per Cederqvist","fromEmail":"cederp@opera.com","sentAt":"2014-03-21T07:31:44Z","receivedAt":"2014-03-21T07:31:44Z","isPatch":false,"sender":{"key":"cederp@opera.com","avatar":"https://gravatar.com/avatar/008fe28caedea0ba34042cd5157705267934f4ba7a9b29fb248ae18ec5b3055e?d=mp&s=160"},"body":"When extracting the patch, we only want the actual patches.  We don't\nwant the \"---\" delimiter.  Simplify the extraction by simply deleting\neverything before the first \"diff \" line.  (Use sed instead of awk to\nsimplify the code.)\n\nWithout this patch, \"guilt fold\" and \"guilt push\" sometimes fails if\nguilt.diffstat is true.\n\nSigned-off-by: Per Cederqvist <cederp@opera.com>\n---\n guilt | 7 +------\n 1 file changed, 1 insertion(+), 6 deletions(-)\n\ndiff --git a/guilt b/guilt\nindex 8701481..c59cd0f 100755\n--- a/guilt\n+++ b/guilt\n@@ -332,12 +332,7 @@ do_make_header()\n # usage: do_get_patch patchfile\n do_get_patch()\n {\n-\tawk '\n-BEGIN{}\n-/^(diff |---$|--- )/ {patch = 1}\n-patch == 1 {print $0}\n-END{}\n-' < \"$1\"\n+\tsed -n '/^diff /,$p' < \"$1\"\n }\n \n # usage: do_get_header patchfile\n-- \n1.8.3.1\n"},{"id":"237270","messageId":"1395387126-13681-8-git-send-email-cederp@opera.com","threadId":"36262","inReplyTo":"1395387126-13681-1-git-send-email-cederp@opera.com","subject":"[GUILT 07/28] Added test cases for \"guilt fold\".","fromName":"Per Cederqvist","fromEmail":"cederp@opera.com","sentAt":"2014-03-21T07:31:45Z","receivedAt":"2014-03-21T07:31:45Z","isPatch":false,"sender":{"key":"cederp@opera.com","avatar":"https://gravatar.com/avatar/008fe28caedea0ba34042cd5157705267934f4ba7a9b29fb248ae18ec5b3055e?d=mp&s=160"},"body":"Test that we can combine any combination of patches with empty and\nnon-empty messages, both with and without guilt.diffstat.  (All\npatches are empty.)\n\nSigned-off-by: Per Cederqvist <cederp@opera.com>\n---\n regression/t-035.out | 659 +++++++++++++++++++++++++++++++++++++++++++++++++++\n regression/t-035.sh  |  88 +++++++\n 2 files changed, 747 insertions(+)\n create mode 100644 regression/t-035.out\n create mode 100755 regression/t-035.sh\n\ndiff --git a/regression/t-035.out b/regression/t-035.out\nnew file mode 100644\nindex 0000000..04af146\n--- /dev/null\n+++ b/regression/t-035.out\n@@ -0,0 +1,659 @@\n+% setup_repo\n+% git config guilt.diffstat true\n+%% empty + empty (diffstat=true)\n+% guilt new empty-1\n+% guilt pop\n+All patches popped.\n+% guilt push\n+Applying patch..empty-1\n+Patch applied.\n+% guilt new empty-2\n+% guilt pop\n+Now at empty-1.\n+% guilt push\n+Applying patch..empty-2\n+Patch applied.\n+% guilt pop\n+Now at empty-1.\n+% guilt fold empty-2\n+% guilt pop\n+All patches popped.\n+% guilt push\n+Applying patch..empty-1\n+Patch applied.\n+% list_files\n+d .git/patches\n+d .git/patches/master\n+d .git/refs/patches\n+d .git/refs/patches/master\n+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode\n+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove\n+f 4ea806e306f0228a8ef41f186035e7b04097f1f2  .git/patches/master/status\n+f 7d261b8caad0f161c21daf5de65eeb521ff8c067  .git/patches/master/empty-1\n+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add\n+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify\n+f d28d87b88c1e24d637e390dc3603cfa7c1715711  .git/patches/master/series\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty-1~\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty-2~\n+r bde3d337af70f36836ad606c800d194006f883b3  .git/refs/patches/master/empty-1\n+% git log -p\n+commit bde3d337af70f36836ad606c800d194006f883b3\n+Author: Author Name <author@email>\n+Date:   Mon Jan 1 00:00:00 2007 +0000\n+\n+    patch empty-1\n+\n+commit d4850419ccc1146c7169f500725ce504b9774ed0\n+Author: Author Name <author@email>\n+Date:   Mon Jan 1 00:00:00 2007 +0000\n+\n+    initial\n+    \n+    Signed-off-by: Commiter Name <commiter@email>\n+\n+diff --git a/def b/def\n+new file mode 100644\n+index 0000000..8baef1b\n+--- /dev/null\n++++ b/def\n+@@ -0,0 +1 @@\n++abc\n+% guilt pop\n+All patches popped.\n+% guilt delete -f empty-1\n+% list_files\n+d .git/patches\n+d .git/patches/master\n+d .git/refs/patches\n+d .git/refs/patches/master\n+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode\n+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove\n+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add\n+f bacb4aad8a55fe4e7aa58a9ae169990bb764069f  .git/patches/master/series\n+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty-1~\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty-2~\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/status\n+%% empty + non-empty (diffstat=true)\n+% guilt new empty\n+% guilt pop\n+All patches popped.\n+% guilt push\n+Applying patch..empty\n+Patch applied.\n+% guilt new -f -s -m A commit message. non-empty\n+% guilt pop\n+Now at empty.\n+% guilt push\n+Applying patch..non-empty\n+Patch applied.\n+% guilt pop\n+Now at empty.\n+% guilt fold non-empty\n+% guilt pop\n+All patches popped.\n+% guilt push\n+Applying patch..empty\n+Patch applied.\n+% list_files\n+d .git/patches\n+d .git/patches/master\n+d .git/refs/patches\n+d .git/refs/patches/master\n+f 15aab0fd8b937eb3bb01841693f35dcb75da2faf  .git/patches/master/status\n+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode\n+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove\n+f 51fcfcf16db2903f19ab4a4a3caacd297ea9f6cd  .git/patches/master/empty~\n+f 51fcfcf16db2903f19ab4a4a3caacd297ea9f6cd  .git/patches/master/non-empty~\n+f 683678040eef9334d6329e00d5b9babda3e65b57  .git/patches/master/empty\n+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add\n+f a26a22287b500a2a372e42c2bab03599bbe37cdf  .git/patches/master/series\n+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty-1~\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty-2~\n+r 4eedaa32894fc07af3298d8c1178052942a3ca6a  .git/refs/patches/master/empty\n+% git log -p\n+commit 4eedaa32894fc07af3298d8c1178052942a3ca6a\n+Author: Author Name <author@email>\n+Date:   Mon Jan 1 00:00:00 2007 +0000\n+\n+    A commit message.\n+    \n+    Signed-off-by: Commiter Name <commiter@email>\n+\n+commit d4850419ccc1146c7169f500725ce504b9774ed0\n+Author: Author Name <author@email>\n+Date:   Mon Jan 1 00:00:00 2007 +0000\n+\n+    initial\n+    \n+    Signed-off-by: Commiter Name <commiter@email>\n+\n+diff --git a/def b/def\n+new file mode 100644\n+index 0000000..8baef1b\n+--- /dev/null\n++++ b/def\n+@@ -0,0 +1 @@\n++abc\n+% guilt pop\n+All patches popped.\n+% guilt delete -f empty\n+% list_files\n+d .git/patches\n+d .git/patches/master\n+d .git/refs/patches\n+d .git/refs/patches/master\n+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode\n+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove\n+f 51fcfcf16db2903f19ab4a4a3caacd297ea9f6cd  .git/patches/master/empty~\n+f 51fcfcf16db2903f19ab4a4a3caacd297ea9f6cd  .git/patches/master/non-empty~\n+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add\n+f bacb4aad8a55fe4e7aa58a9ae169990bb764069f  .git/patches/master/series\n+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty-1~\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty-2~\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/status\n+%% non-empty + empty (diffstat=true)\n+% guilt new -f -s -m A commit message. non-empty\n+% guilt pop\n+All patches popped.\n+% guilt push\n+Applying patch..non-empty\n+Patch applied.\n+% guilt new empty\n+% guilt pop\n+Now at non-empty.\n+% guilt fold empty\n+% guilt pop\n+All patches popped.\n+% guilt push\n+Applying patch..non-empty\n+Patch applied.\n+% list_files\n+d .git/patches\n+d .git/patches/master\n+d .git/refs/patches\n+d .git/refs/patches/master\n+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode\n+f 3be33467b8bcaa0b423634f9fb0d56e7963b512c  .git/patches/master/status\n+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove\n+f 51fcfcf16db2903f19ab4a4a3caacd297ea9f6cd  .git/patches/master/non-empty~\n+f 5b7e155be4d6d4ae570eb6a0ec3422bbe4089665  .git/patches/master/series\n+f 683678040eef9334d6329e00d5b9babda3e65b57  .git/patches/master/non-empty\n+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add\n+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty-1~\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty-2~\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty~\n+r 4eedaa32894fc07af3298d8c1178052942a3ca6a  .git/refs/patches/master/non-empty\n+% git log -p\n+commit 4eedaa32894fc07af3298d8c1178052942a3ca6a\n+Author: Author Name <author@email>\n+Date:   Mon Jan 1 00:00:00 2007 +0000\n+\n+    A commit message.\n+    \n+    Signed-off-by: Commiter Name <commiter@email>\n+\n+commit d4850419ccc1146c7169f500725ce504b9774ed0\n+Author: Author Name <author@email>\n+Date:   Mon Jan 1 00:00:00 2007 +0000\n+\n+    initial\n+    \n+    Signed-off-by: Commiter Name <commiter@email>\n+\n+diff --git a/def b/def\n+new file mode 100644\n+index 0000000..8baef1b\n+--- /dev/null\n++++ b/def\n+@@ -0,0 +1 @@\n++abc\n+% guilt pop\n+All patches popped.\n+% guilt delete -f non-empty\n+% list_files\n+d .git/patches\n+d .git/patches/master\n+d .git/refs/patches\n+d .git/refs/patches/master\n+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode\n+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove\n+f 51fcfcf16db2903f19ab4a4a3caacd297ea9f6cd  .git/patches/master/non-empty~\n+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add\n+f bacb4aad8a55fe4e7aa58a9ae169990bb764069f  .git/patches/master/series\n+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty-1~\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty-2~\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty~\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/status\n+%% non-empty + non-empty (diffstat=true)\n+% guilt new -f -s -m A commit message. non-empty-1\n+% guilt pop\n+All patches popped.\n+% guilt push\n+Applying patch..non-empty-1\n+Patch applied.\n+% guilt new -f -s -m Another commit message. non-empty-2\n+% guilt pop\n+Now at non-empty-1.\n+% guilt push\n+Applying patch..non-empty-2\n+Patch applied.\n+% guilt pop\n+Now at non-empty-1.\n+% guilt fold non-empty-2\n+% guilt pop\n+All patches popped.\n+% guilt push\n+Applying patch..non-empty-1\n+Patch applied.\n+% list_files\n+d .git/patches\n+d .git/patches/master\n+d .git/refs/patches\n+d .git/refs/patches/master\n+f 0c6b7357ea1ccc9cbf872bc3abf53cf059c55152  .git/patches/master/series\n+f 2267d12f90557b360ac5a5ce8b39e17b4a2b91c3  .git/patches/master/status\n+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode\n+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove\n+f 51fcfcf16db2903f19ab4a4a3caacd297ea9f6cd  .git/patches/master/non-empty~\n+f 5f0c43c5c062b1d9615fcd41a84ed6c1bc040e69  .git/patches/master/non-empty-1~\n+f 8884157b59a3a1d90c0192dba642c9db047bb39d  .git/patches/master/non-empty-1\n+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add\n+f bbdc17918ad7ba268ea90ebf0fb71e32e0f09a02  .git/patches/master/non-empty-2~\n+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty-1~\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty-2~\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty~\n+r 871e6754840a705017381948d77225c8de7b24dd  .git/refs/patches/master/non-empty-1\n+% git log -p\n+commit 871e6754840a705017381948d77225c8de7b24dd\n+Author: Author Name <author@email>\n+Date:   Mon Jan 1 00:00:00 2007 +0000\n+\n+    A commit message.\n+    \n+    Signed-off-by: Commiter Name <commiter@email>\n+    \n+    \n+    Header from folded patch 'non-empty-2':\n+    \n+    Another commit message.\n+    \n+    Signed-off-by: Commiter Name <commiter@email>\n+\n+commit d4850419ccc1146c7169f500725ce504b9774ed0\n+Author: Author Name <author@email>\n+Date:   Mon Jan 1 00:00:00 2007 +0000\n+\n+    initial\n+    \n+    Signed-off-by: Commiter Name <commiter@email>\n+\n+diff --git a/def b/def\n+new file mode 100644\n+index 0000000..8baef1b\n+--- /dev/null\n++++ b/def\n+@@ -0,0 +1 @@\n++abc\n+% guilt pop\n+All patches popped.\n+% guilt delete -f non-empty-1\n+% list_files\n+d .git/patches\n+d .git/patches/master\n+d .git/refs/patches\n+d .git/refs/patches/master\n+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode\n+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove\n+f 51fcfcf16db2903f19ab4a4a3caacd297ea9f6cd  .git/patches/master/non-empty~\n+f 5f0c43c5c062b1d9615fcd41a84ed6c1bc040e69  .git/patches/master/non-empty-1~\n+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add\n+f bacb4aad8a55fe4e7aa58a9ae169990bb764069f  .git/patches/master/series\n+f bbdc17918ad7ba268ea90ebf0fb71e32e0f09a02  .git/patches/master/non-empty-2~\n+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty-1~\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty-2~\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty~\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/status\n+% git config guilt.diffstat false\n+%% empty + empty (diffstat=false)\n+% guilt new empty-1\n+% guilt pop\n+All patches popped.\n+% guilt push\n+Applying patch..empty-1\n+Patch applied.\n+% guilt new empty-2\n+% guilt pop\n+Now at empty-1.\n+% guilt push\n+Applying patch..empty-2\n+Patch applied.\n+% guilt pop\n+Now at empty-1.\n+% guilt fold empty-2\n+% guilt pop\n+All patches popped.\n+% guilt push\n+Applying patch..empty-1\n+Patch applied.\n+% list_files\n+d .git/patches\n+d .git/patches/master\n+d .git/refs/patches\n+d .git/refs/patches/master\n+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode\n+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove\n+f 4ea806e306f0228a8ef41f186035e7b04097f1f2  .git/patches/master/status\n+f 51fcfcf16db2903f19ab4a4a3caacd297ea9f6cd  .git/patches/master/non-empty~\n+f 5f0c43c5c062b1d9615fcd41a84ed6c1bc040e69  .git/patches/master/non-empty-1~\n+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add\n+f bbdc17918ad7ba268ea90ebf0fb71e32e0f09a02  .git/patches/master/non-empty-2~\n+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify\n+f d28d87b88c1e24d637e390dc3603cfa7c1715711  .git/patches/master/series\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty-1\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty-1~\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty-2~\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty~\n+r bde3d337af70f36836ad606c800d194006f883b3  .git/refs/patches/master/empty-1\n+% git log -p\n+commit bde3d337af70f36836ad606c800d194006f883b3\n+Author: Author Name <author@email>\n+Date:   Mon Jan 1 00:00:00 2007 +0000\n+\n+    patch empty-1\n+\n+commit d4850419ccc1146c7169f500725ce504b9774ed0\n+Author: Author Name <author@email>\n+Date:   Mon Jan 1 00:00:00 2007 +0000\n+\n+    initial\n+    \n+    Signed-off-by: Commiter Name <commiter@email>\n+\n+diff --git a/def b/def\n+new file mode 100644\n+index 0000000..8baef1b\n+--- /dev/null\n++++ b/def\n+@@ -0,0 +1 @@\n++abc\n+% guilt pop\n+All patches popped.\n+% guilt delete -f empty-1\n+% list_files\n+d .git/patches\n+d .git/patches/master\n+d .git/refs/patches\n+d .git/refs/patches/master\n+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode\n+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove\n+f 51fcfcf16db2903f19ab4a4a3caacd297ea9f6cd  .git/patches/master/non-empty~\n+f 5f0c43c5c062b1d9615fcd41a84ed6c1bc040e69  .git/patches/master/non-empty-1~\n+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add\n+f bacb4aad8a55fe4e7aa58a9ae169990bb764069f  .git/patches/master/series\n+f bbdc17918ad7ba268ea90ebf0fb71e32e0f09a02  .git/patches/master/non-empty-2~\n+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty-1~\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty-2~\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty~\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/status\n+%% empty + non-empty (diffstat=false)\n+% guilt new empty\n+% guilt pop\n+All patches popped.\n+% guilt push\n+Applying patch..empty\n+Patch applied.\n+% guilt new -f -s -m A commit message. non-empty\n+% guilt pop\n+Now at empty.\n+% guilt push\n+Applying patch..non-empty\n+Patch applied.\n+% guilt pop\n+Now at empty.\n+% guilt fold non-empty\n+% guilt pop\n+All patches popped.\n+% guilt push\n+Applying patch..empty\n+Patch applied.\n+% list_files\n+d .git/patches\n+d .git/patches/master\n+d .git/refs/patches\n+d .git/refs/patches/master\n+f 15aab0fd8b937eb3bb01841693f35dcb75da2faf  .git/patches/master/status\n+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode\n+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove\n+f 51fcfcf16db2903f19ab4a4a3caacd297ea9f6cd  .git/patches/master/empty\n+f 51fcfcf16db2903f19ab4a4a3caacd297ea9f6cd  .git/patches/master/empty~\n+f 51fcfcf16db2903f19ab4a4a3caacd297ea9f6cd  .git/patches/master/non-empty~\n+f 5f0c43c5c062b1d9615fcd41a84ed6c1bc040e69  .git/patches/master/non-empty-1~\n+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add\n+f a26a22287b500a2a372e42c2bab03599bbe37cdf  .git/patches/master/series\n+f bbdc17918ad7ba268ea90ebf0fb71e32e0f09a02  .git/patches/master/non-empty-2~\n+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty-1~\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty-2~\n+r 4eedaa32894fc07af3298d8c1178052942a3ca6a  .git/refs/patches/master/empty\n+% git log -p\n+commit 4eedaa32894fc07af3298d8c1178052942a3ca6a\n+Author: Author Name <author@email>\n+Date:   Mon Jan 1 00:00:00 2007 +0000\n+\n+    A commit message.\n+    \n+    Signed-off-by: Commiter Name <commiter@email>\n+\n+commit d4850419ccc1146c7169f500725ce504b9774ed0\n+Author: Author Name <author@email>\n+Date:   Mon Jan 1 00:00:00 2007 +0000\n+\n+    initial\n+    \n+    Signed-off-by: Commiter Name <commiter@email>\n+\n+diff --git a/def b/def\n+new file mode 100644\n+index 0000000..8baef1b\n+--- /dev/null\n++++ b/def\n+@@ -0,0 +1 @@\n++abc\n+% guilt pop\n+All patches popped.\n+% guilt delete -f empty\n+% list_files\n+d .git/patches\n+d .git/patches/master\n+d .git/refs/patches\n+d .git/refs/patches/master\n+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode\n+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove\n+f 51fcfcf16db2903f19ab4a4a3caacd297ea9f6cd  .git/patches/master/empty~\n+f 51fcfcf16db2903f19ab4a4a3caacd297ea9f6cd  .git/patches/master/non-empty~\n+f 5f0c43c5c062b1d9615fcd41a84ed6c1bc040e69  .git/patches/master/non-empty-1~\n+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add\n+f bacb4aad8a55fe4e7aa58a9ae169990bb764069f  .git/patches/master/series\n+f bbdc17918ad7ba268ea90ebf0fb71e32e0f09a02  .git/patches/master/non-empty-2~\n+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty-1~\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty-2~\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/status\n+%% non-empty + empty (diffstat=false)\n+% guilt new -f -s -m A commit message. non-empty\n+% guilt pop\n+All patches popped.\n+% guilt push\n+Applying patch..non-empty\n+Patch applied.\n+% guilt new empty\n+% guilt pop\n+Now at non-empty.\n+% guilt fold empty\n+% guilt pop\n+All patches popped.\n+% guilt push\n+Applying patch..non-empty\n+Patch applied.\n+% list_files\n+d .git/patches\n+d .git/patches/master\n+d .git/refs/patches\n+d .git/refs/patches/master\n+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode\n+f 3be33467b8bcaa0b423634f9fb0d56e7963b512c  .git/patches/master/status\n+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove\n+f 51fcfcf16db2903f19ab4a4a3caacd297ea9f6cd  .git/patches/master/non-empty\n+f 51fcfcf16db2903f19ab4a4a3caacd297ea9f6cd  .git/patches/master/non-empty~\n+f 5b7e155be4d6d4ae570eb6a0ec3422bbe4089665  .git/patches/master/series\n+f 5f0c43c5c062b1d9615fcd41a84ed6c1bc040e69  .git/patches/master/non-empty-1~\n+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add\n+f bbdc17918ad7ba268ea90ebf0fb71e32e0f09a02  .git/patches/master/non-empty-2~\n+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty-1~\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty-2~\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty~\n+r 4eedaa32894fc07af3298d8c1178052942a3ca6a  .git/refs/patches/master/non-empty\n+% git log -p\n+commit 4eedaa32894fc07af3298d8c1178052942a3ca6a\n+Author: Author Name <author@email>\n+Date:   Mon Jan 1 00:00:00 2007 +0000\n+\n+    A commit message.\n+    \n+    Signed-off-by: Commiter Name <commiter@email>\n+\n+commit d4850419ccc1146c7169f500725ce504b9774ed0\n+Author: Author Name <author@email>\n+Date:   Mon Jan 1 00:00:00 2007 +0000\n+\n+    initial\n+    \n+    Signed-off-by: Commiter Name <commiter@email>\n+\n+diff --git a/def b/def\n+new file mode 100644\n+index 0000000..8baef1b\n+--- /dev/null\n++++ b/def\n+@@ -0,0 +1 @@\n++abc\n+% guilt pop\n+All patches popped.\n+% guilt delete -f non-empty\n+% list_files\n+d .git/patches\n+d .git/patches/master\n+d .git/refs/patches\n+d .git/refs/patches/master\n+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode\n+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove\n+f 51fcfcf16db2903f19ab4a4a3caacd297ea9f6cd  .git/patches/master/non-empty~\n+f 5f0c43c5c062b1d9615fcd41a84ed6c1bc040e69  .git/patches/master/non-empty-1~\n+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add\n+f bacb4aad8a55fe4e7aa58a9ae169990bb764069f  .git/patches/master/series\n+f bbdc17918ad7ba268ea90ebf0fb71e32e0f09a02  .git/patches/master/non-empty-2~\n+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty-1~\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty-2~\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty~\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/status\n+%% non-empty + non-empty (diffstat=false)\n+% guilt new -f -s -m A commit message. non-empty-1\n+% guilt pop\n+All patches popped.\n+% guilt push\n+Applying patch..non-empty-1\n+Patch applied.\n+% guilt new -f -s -m Another commit message. non-empty-2\n+% guilt pop\n+Now at non-empty-1.\n+% guilt push\n+Applying patch..non-empty-2\n+Patch applied.\n+% guilt pop\n+Now at non-empty-1.\n+% guilt fold non-empty-2\n+% guilt pop\n+All patches popped.\n+% guilt push\n+Applying patch..non-empty-1\n+Patch applied.\n+% list_files\n+d .git/patches\n+d .git/patches/master\n+d .git/refs/patches\n+d .git/refs/patches/master\n+f 0c6b7357ea1ccc9cbf872bc3abf53cf059c55152  .git/patches/master/series\n+f 2267d12f90557b360ac5a5ce8b39e17b4a2b91c3  .git/patches/master/status\n+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode\n+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove\n+f 51fcfcf16db2903f19ab4a4a3caacd297ea9f6cd  .git/patches/master/non-empty~\n+f 5f0c43c5c062b1d9615fcd41a84ed6c1bc040e69  .git/patches/master/non-empty-1\n+f 5f0c43c5c062b1d9615fcd41a84ed6c1bc040e69  .git/patches/master/non-empty-1~\n+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add\n+f bbdc17918ad7ba268ea90ebf0fb71e32e0f09a02  .git/patches/master/non-empty-2~\n+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty-1~\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty-2~\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty~\n+r 871e6754840a705017381948d77225c8de7b24dd  .git/refs/patches/master/non-empty-1\n+% git log -p\n+commit 871e6754840a705017381948d77225c8de7b24dd\n+Author: Author Name <author@email>\n+Date:   Mon Jan 1 00:00:00 2007 +0000\n+\n+    A commit message.\n+    \n+    Signed-off-by: Commiter Name <commiter@email>\n+    \n+    \n+    Header from folded patch 'non-empty-2':\n+    \n+    Another commit message.\n+    \n+    Signed-off-by: Commiter Name <commiter@email>\n+\n+commit d4850419ccc1146c7169f500725ce504b9774ed0\n+Author: Author Name <author@email>\n+Date:   Mon Jan 1 00:00:00 2007 +0000\n+\n+    initial\n+    \n+    Signed-off-by: Commiter Name <commiter@email>\n+\n+diff --git a/def b/def\n+new file mode 100644\n+index 0000000..8baef1b\n+--- /dev/null\n++++ b/def\n+@@ -0,0 +1 @@\n++abc\n+% guilt pop\n+All patches popped.\n+% guilt delete -f non-empty-1\n+% list_files\n+d .git/patches\n+d .git/patches/master\n+d .git/refs/patches\n+d .git/refs/patches/master\n+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode\n+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove\n+f 51fcfcf16db2903f19ab4a4a3caacd297ea9f6cd  .git/patches/master/non-empty~\n+f 5f0c43c5c062b1d9615fcd41a84ed6c1bc040e69  .git/patches/master/non-empty-1~\n+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add\n+f bacb4aad8a55fe4e7aa58a9ae169990bb764069f  .git/patches/master/series\n+f bbdc17918ad7ba268ea90ebf0fb71e32e0f09a02  .git/patches/master/non-empty-2~\n+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty-1~\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty-2~\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty~\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/status\ndiff --git a/regression/t-035.sh b/regression/t-035.sh\nnew file mode 100755\nindex 0000000..aed3ef2\n--- /dev/null\n+++ b/regression/t-035.sh\n@@ -0,0 +1,88 @@\n+#!/bin/bash\n+#\n+# Test the fold code\n+#\n+\n+source \"$REG_DIR/scaffold\"\n+\n+cmd setup_repo\n+\n+function fixup_time_info\n+{\n+\tcmd guilt pop\n+\ttouch -a -m -t \"$TOUCH_DATE\" \".git/patches/master/$1\"\n+\tcmd guilt push\n+}\n+\n+function test_fold\n+{\n+    using_diffstat=$1\n+\n+    cmd git config guilt.diffstat $using_diffstat\n+\n+    # Empty message + empty message = empty message.\n+    echo \"%% empty + empty (diffstat=$using_diffstat)\"\n+    cmd guilt new empty-1\n+    fixup_time_info empty-1\n+    cmd guilt new empty-2\n+    fixup_time_info empty-2\n+    cmd guilt pop\n+    cmd guilt fold empty-2\n+    fixup_time_info empty-1\n+    cmd list_files\n+    cmd git log -p\n+    cmd guilt pop\n+    cmd guilt delete -f empty-1\n+    cmd list_files\n+\n+    # Empty message + non-empty message\n+    echo \"%% empty + non-empty (diffstat=$using_diffstat)\"\n+    cmd guilt new empty\n+    fixup_time_info empty\n+    cmd echo test > a\n+    cmd guilt new -f -s -m \"A commit message.\" non-empty\n+    fixup_time_info non-empty\n+    cmd guilt pop\n+    cmd guilt fold non-empty\n+    fixup_time_info empty\n+    cmd list_files\n+    cmd git log -p\n+    cmd guilt pop\n+    cmd guilt delete -f empty\n+    cmd list_files\n+\n+    # Non-empty message + empty message\n+    echo \"%% non-empty + empty (diffstat=$using_diffstat)\"\n+    cmd echo test > a\n+    cmd guilt new -f -s -m \"A commit message.\" non-empty\n+    fixup_time_info non-empty\n+    cmd guilt new empty\n+    cmd guilt pop\n+    cmd guilt fold empty\n+    fixup_time_info non-empty\n+    cmd list_files\n+    cmd git log -p\n+    cmd guilt pop\n+    cmd guilt delete -f non-empty\n+    cmd list_files\n+\n+    # Non-empty message + non-empty message\n+    echo \"%% non-empty + non-empty (diffstat=$using_diffstat)\"\n+    cmd echo test > a\n+    cmd guilt new -f -s -m \"A commit message.\" non-empty-1\n+    fixup_time_info non-empty-1\n+    cmd echo test > b\n+    cmd guilt new -f -s -m \"Another commit message.\" non-empty-2\n+    fixup_time_info non-empty-2\n+    cmd guilt pop\n+    cmd guilt fold non-empty-2\n+    fixup_time_info non-empty-1\n+    cmd list_files\n+    cmd git log -p\n+    cmd guilt pop\n+    cmd guilt delete -f non-empty-1\n+    cmd list_files\n+}\n+\n+test_fold true\n+test_fold false\n-- \n1.8.3.1\n"},{"id":"237288","messageId":"1395387126-13681-9-git-send-email-cederp@opera.com","threadId":"36262","inReplyTo":"1395387126-13681-1-git-send-email-cederp@opera.com","subject":"[GUILT 08/28] Added more test cases for \"guilt new\": empty patches.","fromName":"Per Cederqvist","fromEmail":"cederp@opera.com","sentAt":"2014-03-21T07:31:46Z","receivedAt":"2014-03-21T07:31:46Z","isPatch":false,"sender":{"key":"cederp@opera.com","avatar":"https://gravatar.com/avatar/008fe28caedea0ba34042cd5157705267934f4ba7a9b29fb248ae18ec5b3055e?d=mp&s=160"},"body":"Test that empty patches are handled correctly, both with and without\nthe guilt.diffstat configuration option.\n\nSigned-off-by: Per Cederqvist <cederp@opera.com>\n---\n regression/t-020.out | 250 +++++++++++++++++++++++++++++++++++++++++++++++++++\n regression/t-020.sh  |  60 +++++++++++++\n 2 files changed, 310 insertions(+)\n\ndiff --git a/regression/t-020.out b/regression/t-020.out\nindex af45734..7e07efa 100644\n--- a/regression/t-020.out\n+++ b/regression/t-020.out\n@@ -1128,3 +1128,253 @@ f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add\n f bacb4aad8a55fe4e7aa58a9ae169990bb764069f  .git/patches/master/series\n f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify\n f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/status\n+% guilt new empty.patch\n+% guilt pop\n+All patches popped.\n+% guilt push\n+Applying patch..empty.patch\n+Patch applied.\n+% list_files\n+d .git/patches\n+d .git/patches/master\n+d .git/refs/patches\n+d .git/refs/patches/master\n+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode\n+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove\n+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add\n+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify\n+f d15a1d2d34493f790c78ddacb8815b0b9536ee2b  .git/patches/master/series\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty.patch\n+f e90b964f01cbef60bbe00c38c55d9ea86618a66a  .git/patches/master/status\n+r c7a139f532a43c3c8b0e068cac04f8f6af0f94e1  .git/refs/patches/master/empty.patch\n+% git log -p\n+commit c7a139f532a43c3c8b0e068cac04f8f6af0f94e1\n+Author: Author Name <author@email>\n+Date:   Mon Jan 1 00:00:00 2007 +0000\n+\n+    patch empty.patch\n+\n+commit d4850419ccc1146c7169f500725ce504b9774ed0\n+Author: Author Name <author@email>\n+Date:   Mon Jan 1 00:00:00 2007 +0000\n+\n+    initial\n+    \n+    Signed-off-by: Commiter Name <commiter@email>\n+\n+diff --git a/def b/def\n+new file mode 100644\n+index 0000000..8baef1b\n+--- /dev/null\n++++ b/def\n+@@ -0,0 +1 @@\n++abc\n+% git config guilt.diffstat true\n+% guilt refresh\n+Patch empty.patch refreshed\n+% guilt pop\n+All patches popped.\n+% guilt push\n+Applying patch..empty.patch\n+Patch applied.\n+% list_files\n+d .git/patches\n+d .git/patches/master\n+d .git/refs/patches\n+d .git/refs/patches/master\n+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode\n+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove\n+f 7d261b8caad0f161c21daf5de65eeb521ff8c067  .git/patches/master/empty.patch\n+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add\n+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify\n+f d15a1d2d34493f790c78ddacb8815b0b9536ee2b  .git/patches/master/series\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty.patch~\n+f e90b964f01cbef60bbe00c38c55d9ea86618a66a  .git/patches/master/status\n+r c7a139f532a43c3c8b0e068cac04f8f6af0f94e1  .git/refs/patches/master/empty.patch\n+% git log -p\n+commit c7a139f532a43c3c8b0e068cac04f8f6af0f94e1\n+Author: Author Name <author@email>\n+Date:   Mon Jan 1 00:00:00 2007 +0000\n+\n+    patch empty.patch\n+\n+commit d4850419ccc1146c7169f500725ce504b9774ed0\n+Author: Author Name <author@email>\n+Date:   Mon Jan 1 00:00:00 2007 +0000\n+\n+    initial\n+    \n+    Signed-off-by: Commiter Name <commiter@email>\n+\n+diff --git a/def b/def\n+new file mode 100644\n+index 0000000..8baef1b\n+--- /dev/null\n++++ b/def\n+@@ -0,0 +1 @@\n++abc\n+% git config guilt.diffstat false\n+---\n+\n+% guilt pop\n+All patches popped.\n+% guilt push\n+Applying patch..empty.patch\n+Patch applied.\n+% list_files\n+d .git/patches\n+d .git/patches/master\n+d .git/refs/patches\n+d .git/refs/patches/master\n+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode\n+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove\n+f 7d261b8caad0f161c21daf5de65eeb521ff8c067  .git/patches/master/empty.patch\n+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add\n+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify\n+f d15a1d2d34493f790c78ddacb8815b0b9536ee2b  .git/patches/master/series\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty.patch~\n+f e90b964f01cbef60bbe00c38c55d9ea86618a66a  .git/patches/master/status\n+r c7a139f532a43c3c8b0e068cac04f8f6af0f94e1  .git/refs/patches/master/empty.patch\n+% git log -p\n+commit c7a139f532a43c3c8b0e068cac04f8f6af0f94e1\n+Author: Author Name <author@email>\n+Date:   Mon Jan 1 00:00:00 2007 +0000\n+\n+    patch empty.patch\n+\n+commit d4850419ccc1146c7169f500725ce504b9774ed0\n+Author: Author Name <author@email>\n+Date:   Mon Jan 1 00:00:00 2007 +0000\n+\n+    initial\n+    \n+    Signed-off-by: Commiter Name <commiter@email>\n+\n+diff --git a/def b/def\n+new file mode 100644\n+index 0000000..8baef1b\n+--- /dev/null\n++++ b/def\n+@@ -0,0 +1 @@\n++abc\n+% git config guilt.diffstat true\n+% guilt refresh\n+Patch empty.patch refreshed\n+% guilt pop\n+All patches popped.\n+% guilt push\n+Applying patch..empty.patch\n+Patch applied.\n+% list_files\n+d .git/patches\n+d .git/patches/master\n+d .git/refs/patches\n+d .git/refs/patches/master\n+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode\n+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove\n+f 7d261b8caad0f161c21daf5de65eeb521ff8c067  .git/patches/master/empty.patch\n+f 7d261b8caad0f161c21daf5de65eeb521ff8c067  .git/patches/master/empty.patch~\n+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add\n+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify\n+f d15a1d2d34493f790c78ddacb8815b0b9536ee2b  .git/patches/master/series\n+f e90b964f01cbef60bbe00c38c55d9ea86618a66a  .git/patches/master/status\n+r c7a139f532a43c3c8b0e068cac04f8f6af0f94e1  .git/refs/patches/master/empty.patch\n+% git log -p\n+commit c7a139f532a43c3c8b0e068cac04f8f6af0f94e1\n+Author: Author Name <author@email>\n+Date:   Mon Jan 1 00:00:00 2007 +0000\n+\n+    patch empty.patch\n+\n+commit d4850419ccc1146c7169f500725ce504b9774ed0\n+Author: Author Name <author@email>\n+Date:   Mon Jan 1 00:00:00 2007 +0000\n+\n+    initial\n+    \n+    Signed-off-by: Commiter Name <commiter@email>\n+\n+diff --git a/def b/def\n+new file mode 100644\n+index 0000000..8baef1b\n+--- /dev/null\n++++ b/def\n+@@ -0,0 +1 @@\n++abc\n+% git config guilt.diffstat false\n+% guilt refresh\n+Patch empty.patch refreshed\n+% guilt pop\n+All patches popped.\n+% guilt push\n+Applying patch..empty.patch\n+Patch applied.\n+% list_files\n+d .git/patches\n+d .git/patches/master\n+d .git/refs/patches\n+d .git/refs/patches/master\n+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode\n+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove\n+f 7d261b8caad0f161c21daf5de65eeb521ff8c067  .git/patches/master/empty.patch~\n+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add\n+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify\n+f d15a1d2d34493f790c78ddacb8815b0b9536ee2b  .git/patches/master/series\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty.patch\n+f e90b964f01cbef60bbe00c38c55d9ea86618a66a  .git/patches/master/status\n+r c7a139f532a43c3c8b0e068cac04f8f6af0f94e1  .git/refs/patches/master/empty.patch\n+% git log -p\n+commit c7a139f532a43c3c8b0e068cac04f8f6af0f94e1\n+Author: Author Name <author@email>\n+Date:   Mon Jan 1 00:00:00 2007 +0000\n+\n+    patch empty.patch\n+\n+commit d4850419ccc1146c7169f500725ce504b9774ed0\n+Author: Author Name <author@email>\n+Date:   Mon Jan 1 00:00:00 2007 +0000\n+\n+    initial\n+    \n+    Signed-off-by: Commiter Name <commiter@email>\n+\n+diff --git a/def b/def\n+new file mode 100644\n+index 0000000..8baef1b\n+--- /dev/null\n++++ b/def\n+@@ -0,0 +1 @@\n++abc\n+% guilt delete empty.patch\n+Cannot delete an applied patch\n+% guilt pop -a\n+All patches popped.\n+% guilt delete -f empty.patch\n+% list_files\n+d .git/patches\n+d .git/patches/master\n+d .git/refs/patches\n+d .git/refs/patches/master\n+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode\n+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove\n+f 7d261b8caad0f161c21daf5de65eeb521ff8c067  .git/patches/master/empty.patch~\n+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add\n+f bacb4aad8a55fe4e7aa58a9ae169990bb764069f  .git/patches/master/series\n+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/status\n+% git log -p\n+commit d4850419ccc1146c7169f500725ce504b9774ed0\n+Author: Author Name <author@email>\n+Date:   Mon Jan 1 00:00:00 2007 +0000\n+\n+    initial\n+    \n+    Signed-off-by: Commiter Name <commiter@email>\n+\n+diff --git a/def b/def\n+new file mode 100644\n+index 0000000..8baef1b\n+--- /dev/null\n++++ b/def\n+@@ -0,0 +1 @@\n++abc\ndiff --git a/regression/t-020.sh b/regression/t-020.sh\nindex cdd08ba..906aec6 100755\n--- a/regression/t-020.sh\n+++ b/regression/t-020.sh\n@@ -5,6 +5,13 @@\n \n source \"$REG_DIR/scaffold\"\n \n+function fixup_time_info\n+{\n+\tcmd guilt pop\n+\ttouch -a -m -t \"$TOUCH_DATE\" \".git/patches/master/$1\"\n+\tcmd guilt push\n+}\n+\n cmd setup_repo\n \n #\n@@ -69,6 +76,59 @@ done\n \n cmd list_files\n \n+# push an empty patch with no commit message\n+cmd guilt new empty.patch\n+fixup_time_info empty.patch\n+cmd list_files\n+cmd git log -p\n+\n+# Ensure we can push the empty patch even when guilt.diffstat is true.\n+cmd git config guilt.diffstat true\n+cmd guilt refresh\n+fixup_time_info empty.patch\n+cmd list_files\n+cmd git log -p\n+cmd git config guilt.diffstat false\n+\n+# Let the patch have a commit message, but no data.\n+cat .git/patches/master/empty.patch <<EOF\n+Fix a bug.\n+\n+From: Per Cederqvist <ceder@lysator.liu.se>\n+\n+This commit fixes a serious bug.\n+\n+FIXME:\n+    - add a test case\n+    - track down the bug\n+    - actually fix it\n+EOF\n+\n+fixup_time_info empty.patch\n+cmd list_files\n+cmd git log -p\n+\n+# And once more, with an empty diffstat.\n+\n+cmd git config guilt.diffstat true\n+cmd guilt refresh\n+fixup_time_info empty.patch\n+cmd list_files\n+cmd git log -p\n+\n+# Restore the diffstat setting and remove the empty patch.\n+cmd git config guilt.diffstat false\n+cmd guilt refresh\n+fixup_time_info empty.patch\n+cmd list_files\n+cmd git log -p\n+# (Cannot delete an applied patch)\n+shouldfail guilt delete empty.patch\n+cmd guilt pop -a\n+cmd guilt delete -f empty.patch\n+cmd list_files\n+cmd git log -p\n+\n # FIXME:\n #   --all\n #   -a\n-- \n1.8.3.1\n"},{"id":"237286","messageId":"1395387126-13681-10-git-send-email-cederp@opera.com","threadId":"36262","inReplyTo":"1395387126-13681-1-git-send-email-cederp@opera.com","subject":"[GUILT 09/28] Test suite: properly check the exit status of commands.","fromName":"Per Cederqvist","fromEmail":"cederp@opera.com","sentAt":"2014-03-21T07:31:47Z","receivedAt":"2014-03-21T07:31:47Z","isPatch":false,"sender":{"key":"cederp@opera.com","avatar":"https://gravatar.com/avatar/008fe28caedea0ba34042cd5157705267934f4ba7a9b29fb248ae18ec5b3055e?d=mp&s=160"},"body":"The \"cmd\" and \"shouldfail\" functions checked the exit status of the\nreplace_path function instead of the actual command that was running.\n(The $? construct checks the exit status of the last command in a\npipeline, not the first command.)\n\nUpdated t-032.sh, which used \"shouldfail\" instead of \"cmd\" in one\nplace.  (The comment in the script makes it clear that the command is\nexpected to succeed.)\n\nSigned-off-by: Per Cederqvist <cederp@opera.com>\n---\n regression/scaffold | 17 +++++++++++------\n regression/t-032.sh |  2 +-\n 2 files changed, 12 insertions(+), 7 deletions(-)\n\ndiff --git a/regression/scaffold b/regression/scaffold\nindex 5c8b73e..e4d7487 100644\n--- a/regression/scaffold\n+++ b/regression/scaffold\n@@ -51,18 +51,23 @@ function filter_dd\n function cmd\n {\n \techo \"% $@\"\n-\t\"$@\" 2>&1 | replace_path && return 0\n-\treturn 1\n+\t(\n+\t\texec 3>&1\n+\t\trv=`((\"$@\" 2>&1; echo $? >&4) | replace_path >&3 ) 4>&1`\n+\t\texit $rv\n+\t)\n+\treturn $?\n }\n \n # usage: shouldfail <cmd>..\n function shouldfail\n {\n \techo \"% $@\"\n-\t(\n-\t\t\"$@\" 2>&1 || return 0\n-\t\treturn 1\n-\t) | replace_path\n+\t! (\n+\t\texec 3>&1\n+\t\trv=`((\"$@\" 2>&1; echo $? >&4) | replace_path >&3 ) 4>&1`\n+\t\texit $rv\n+\t)\n \treturn $?\n }\n \ndiff --git a/regression/t-032.sh b/regression/t-032.sh\nindex b1d5f19..bba401e 100755\n--- a/regression/t-032.sh\n+++ b/regression/t-032.sh\n@@ -28,7 +28,7 @@ shouldfail guilt import -P foo3 foo\n cmd guilt import -P foo2 foo\n \n # ok\n-shouldfail guilt import foo\n+cmd guilt import foo\n \n # duplicate patch name (implicit)\n shouldfail guilt import foo\n-- \n1.8.3.1\n"},{"id":"237285","messageId":"1395387126-13681-11-git-send-email-cederp@opera.com","threadId":"36262","inReplyTo":"1395387126-13681-1-git-send-email-cederp@opera.com","subject":"[GUILT 10/28] Run test_failed if the exit status of a test script is bad.","fromName":"Per Cederqvist","fromEmail":"cederp@opera.com","sentAt":"2014-03-21T07:31:48Z","receivedAt":"2014-03-21T07:31:48Z","isPatch":false,"sender":{"key":"cederp@opera.com","avatar":"https://gravatar.com/avatar/008fe28caedea0ba34042cd5157705267934f4ba7a9b29fb248ae18ec5b3055e?d=mp&s=160"},"body":"There were two problems with the old code:\n\n - Since \"set -e\" is in effect (that is set in scaffold) the run-test\n   script exited immediately if a t-*.sh script failed.  This is not\n   nice, as we want the error report that test_failed prints.\n\n - The code ran \"cd -\" between running the t-*.sh script and checking\n   the exit status, so the exit status was lost.  (Actually, the exit\n   status was saved in $ERR, but nothing ever looked at $ERR.)\n\nSigned-off-by: Per Cederqvist <cederp@opera.com>\n---\n regression/run-tests | 11 ++++++++---\n 1 file changed, 8 insertions(+), 3 deletions(-)\n\ndiff --git a/regression/run-tests b/regression/run-tests\nindex a10e796..d39f9ef 100755\n--- a/regression/run-tests\n+++ b/regression/run-tests\n@@ -55,11 +55,16 @@ function run_test\n \n \t# run the test\n \tcd \"$REPODIR\" > /dev/null\n-\t\"$REG_DIR/t-$1.sh\" 2>&1 > \"$LOGFILE\"\n-\tERR=$?\n+\tif \"$REG_DIR/t-$1.sh\" 2>&1 > \"$LOGFILE\"\n+\tthen\n+\t    ERR=false\n+\telse\n+\t    ERR=true\n+\tfi\n+\n \tcd - > /dev/null\n \n-\t[ $? -ne 0 ] && test_failed\n+\t$ERR && test_failed\n \tdiff -u \"t-$1.out\" \"$LOGFILE\" || test_failed\n \n \techo \"done.\"\n-- \n1.8.3.1\n"},{"id":"237281","messageId":"1395387126-13681-12-git-send-email-cederp@opera.com","threadId":"36262","inReplyTo":"1395387126-13681-1-git-send-email-cederp@opera.com","subject":"[GUILT 11/28] test suite: remove pointless redirection.","fromName":"Per Cederqvist","fromEmail":"cederp@opera.com","sentAt":"2014-03-21T07:31:49Z","receivedAt":"2014-03-21T07:31:49Z","isPatch":false,"sender":{"key":"cederp@opera.com","avatar":"https://gravatar.com/avatar/008fe28caedea0ba34042cd5157705267934f4ba7a9b29fb248ae18ec5b3055e?d=mp&s=160"},"body":"The shouldfail function already redirects stderr to stdout, so there\nis no need to do the same in t-028.sh and t-021.sh.\n\nSigned-off-by: Per Cederqvist <cederp@opera.com>\n---\n regression/t-021.sh | 2 +-\n regression/t-025.sh | 2 +-\n regression/t-028.sh | 2 +-\n 3 files changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/regression/t-021.sh b/regression/t-021.sh\nindex 6337d7b..614e870 100755\n--- a/regression/t-021.sh\n+++ b/regression/t-021.sh\n@@ -61,7 +61,7 @@ for n in `_seq -2 $npatches`; do\n \tif [ $n -gt 0 ]; then\n \t\tcmd guilt pop -n $n\n \telse\n-\t\tshouldfail guilt pop -n $n 2>&1\n+\t\tshouldfail guilt pop -n $n\n \tfi\n \n \tcmd list_files\ndiff --git a/regression/t-025.sh b/regression/t-025.sh\nindex 3824608..985fed4 100755\n--- a/regression/t-025.sh\n+++ b/regression/t-025.sh\n@@ -44,7 +44,7 @@ shouldfail guilt new \"white space\"\n cmd list_files\n \n for pname in prepend mode /abc ./blah ../blah abc/./blah abc/../blah abc/. abc/.. abc/ ; do\n-\tshouldfail guilt new \"$pname\" 2>&1\n+\tshouldfail guilt new \"$pname\"\n \n \tcmd list_files\n done\ndiff --git a/regression/t-028.sh b/regression/t-028.sh\nindex 8480100..88e9adb 100755\n--- a/regression/t-028.sh\n+++ b/regression/t-028.sh\n@@ -29,6 +29,6 @@ guilt series | while read n; do\n \tcmd guilt header $n\n done\n \n-shouldfail guilt header non-existant 2>&1\n+shouldfail guilt header non-existant\n \n # FIXME: how do we check that -e works?\n-- \n1.8.3.1\n"},{"id":"237296","messageId":"1395387126-13681-13-git-send-email-cederp@opera.com","threadId":"36262","inReplyTo":"1395387126-13681-1-git-send-email-cederp@opera.com","subject":"[GUILT 12/28] \"guilt header\": more robust header selection.","fromName":"Per Cederqvist","fromEmail":"cederp@opera.com","sentAt":"2014-03-21T07:31:50Z","receivedAt":"2014-03-21T07:31:50Z","isPatch":false,"sender":{"key":"cederp@opera.com","avatar":"https://gravatar.com/avatar/008fe28caedea0ba34042cd5157705267934f4ba7a9b29fb248ae18ec5b3055e?d=mp&s=160"},"body":"If you run something like \"guilt header '.*'\" the command would crash,\nbecause the grep comand that tries to ensure that the patch exist\nwould detect a match, but the later code expected the match to be\nexact.\n\nFixed by comparing exact strings.\n\nAnd as a creeping feature \"guilt header\" will now try to use the\nsupplied patch name as an unachored regexp if no exact match was\nfound.  If the regexp yields a unique match, it is used; if more than\none patch matches, the names of all patches are listed and the command\nfails.  (Exercise left to the reader: generalized this so that \"guilt\npush\" also accepts a unique regular expression.)\n\nSigned-off-by: Per Cederqvist <cederp@opera.com>\n---\n guilt-header | 33 ++++++++++++++++++++++++++++++---\n 1 file changed, 30 insertions(+), 3 deletions(-)\n\ndiff --git a/guilt-header b/guilt-header\nindex 41e00cc..2e96406 100755\n--- a/guilt-header\n+++ b/guilt-header\n@@ -45,10 +45,37 @@ esac\n [ -z \"$patch\" ] && die \"No patches applied.\"\n \n # check that patch exists in the series\n-ret=`get_full_series | grep -e \"^$patch\\$\" | wc -l`\n-if [ $ret -eq 0 ]; then\n-\tdie \"Patch $patch is not in the series\"\n+full_series=`get_tmp_file series`\n+get_full_series > \"$full_series\"\n+found_patch=\n+while read x\n+do\n+\tif [ \"$x\" = \"$patch\" ]\n+\tthen\n+\t\tfound_patch=\"$patch\"\n+\t\tbreak\n+\tfi\n+done < \"$full_series\"\n+if [ -z \"$found_patch\" ]\n+then\n+\tTMP_MATCHES=`get_tmp_file series`\n+\tgrep \"$patch\" < \"$full_series\" > \"$TMP_MATCHES\"\n+\tnr=`wc -l < $TMP_MATCHES`\n+\tif [ $nr -gt 1 ]\n+\tthen\n+\t\techo \"$patch does not uniquely identify a patch. Did you mean any of these?\" >&2\n+\t\tsed 's/^/  /' \"$TMP_MATCHES\" >&2\n+\t\trm -f \"$TMP_MATCHES\"\n+\t\texit 1\n+\telif [ $nr -eq 0 ]\n+\tthen\n+\t\trm -f \"$TMP_MATCHES\"\n+\t\tdie \"Patch $patch is not in the series\"\n+\tfi\n+\tfound_patch=`cat $TMP_MATCHES`\n+\trm -f \"$TMP_MATCHES\"\n fi\n+patch=\"$found_patch\"\n \n # FIXME: warn if we're editing an applied patch\n \n-- \n1.8.3.1\n"},{"id":"237291","messageId":"1395387126-13681-14-git-send-email-cederp@opera.com","threadId":"36262","inReplyTo":"1395387126-13681-1-git-send-email-cederp@opera.com","subject":"[GUILT 13/28] Check that \"guilt header '.*'\" fails.","fromName":"Per Cederqvist","fromEmail":"cederp@opera.com","sentAt":"2014-03-21T07:31:51Z","receivedAt":"2014-03-21T07:31:51Z","isPatch":false,"sender":{"key":"cederp@opera.com","avatar":"https://gravatar.com/avatar/008fe28caedea0ba34042cd5157705267934f4ba7a9b29fb248ae18ec5b3055e?d=mp&s=160"},"body":"Signed-off-by: Per Cederqvist <cederp@opera.com>\n---\n regression/t-028.out | 7 +++++++\n regression/t-028.sh  | 4 ++++\n 2 files changed, 11 insertions(+)\n\ndiff --git a/regression/t-028.out b/regression/t-028.out\nindex 1564c09..ea72a3a 100644\n--- a/regression/t-028.out\n+++ b/regression/t-028.out\n@@ -49,3 +49,10 @@ Signed-off-by: Commiter Name <commiter@email>\n \n % guilt header non-existant\n Patch non-existant is not in the series\n+% guilt header .*\n+.* does not uniquely identify a patch. Did you mean any of these?\n+  modify\n+  add\n+  remove\n+  mode\n+  patch-with-some-desc\ndiff --git a/regression/t-028.sh b/regression/t-028.sh\nindex 88e9adb..2ce0378 100755\n--- a/regression/t-028.sh\n+++ b/regression/t-028.sh\n@@ -31,4 +31,8 @@ done\n \n shouldfail guilt header non-existant\n \n+# This is an evil variant of a non-existant patch.  However, this\n+# patch name is a regexp that just happens to match an existing patch.\n+shouldfail guilt header '.*'\n+\n # FIXME: how do we check that -e works?\n-- \n1.8.3.1\n"},{"id":"237292","messageId":"1395387126-13681-15-git-send-email-cederp@opera.com","threadId":"36262","inReplyTo":"1395387126-13681-1-git-send-email-cederp@opera.com","subject":"[GUILT 14/28] Use \"git check-ref-format\" to validate patch names.","fromName":"Per Cederqvist","fromEmail":"cederp@opera.com","sentAt":"2014-03-21T07:31:52Z","receivedAt":"2014-03-21T07:31:52Z","isPatch":false,"sender":{"key":"cederp@opera.com","avatar":"https://gravatar.com/avatar/008fe28caedea0ba34042cd5157705267934f4ba7a9b29fb248ae18ec5b3055e?d=mp&s=160"},"body":"The valid_patchname now lets \"git check-ref-format\" do its job instead\nof trying (and failing) to implement the same rules.  See\ngit-check-ref-format(1) for a list of the rules.\n\nRefer to the git-check-ref-format(1) man page in the error messages\nproduced when valid_patchname indicates that the name is bad.\n\nAdded testcases that breaks most of the rules in that man-page.\n\nGit version 1.8.5 no longer allows the single character \"@\" as a\nbranch name.  Guilt always rejects that name, for increased\ncompatibility.\n\nSigned-off-by: Per Cederqvist <cederp@opera.com>\n---\n guilt                |  23 ++-\n guilt-fork           |   2 +-\n guilt-import         |   2 +-\n guilt-new            |   2 +-\n regression/t-025.out | 426 +++++++++++++++++++++++++++++++++++++++++++++++++--\n regression/t-025.sh  |  12 +-\n regression/t-032.out |   4 +-\n 7 files changed, 448 insertions(+), 23 deletions(-)\n\ndiff --git a/guilt b/guilt\nindex c59cd0f..ca922aa 100755\n--- a/guilt\n+++ b/guilt\n@@ -132,14 +132,21 @@ fi\n # usage: valid_patchname <patchname>\n valid_patchname()\n {\n-\tcase \"$1\" in\n-\t\t/*|./*|../*|*/./*|*/../*|*/.|*/..|*/|*\\ *|*\\\t*)\n-\t\t\treturn 1;;\n-\t\t*:*)\n-\t\t\treturn 1;;\n-\t\t*)\n-\t\t\treturn 0;;\n-\tesac\n+\tif git check-ref-format --allow-onelevel \"$1\"\n+\tthen\n+\t\t# Starting with Git version 1.8.5, a branch cannot be\n+\t\t# the single character \"@\".  Make sure guilt rejects\n+\t\t# that name even if we are currently using an older\n+\t\t# version of Git.  This ensures that the test suite\n+\t\t# runs fine using any version of Git.\n+\t\tif [ \"$1\" = \"@\" ]\n+\t\tthen\n+\t\t\treturn 1\n+\t\tfi\n+\t\treturn 0\n+\telse\n+\t\treturn 1\n+\tfi\n }\n \n get_branch()\ndiff --git a/guilt-fork b/guilt-fork\nindex a85d391..6447e55 100755\n--- a/guilt-fork\n+++ b/guilt-fork\n@@ -37,7 +37,7 @@ else\n fi\n \n if ! valid_patchname \"$newpatch\"; then\n-\tdie \"The specified patch name contains invalid characters (:).\"\n+\tdie \"The specified patch name is invalid according to git-check-ref-format(1).\"\n fi\n \n if [ -e \"$GUILT_DIR/$branch/$newpatch\" ]; then\ndiff --git a/guilt-import b/guilt-import\nindex 3e9b3bb..928e325 100755\n--- a/guilt-import\n+++ b/guilt-import\n@@ -40,7 +40,7 @@ if [ -e \"$GUILT_DIR/$branch/$newname\" ]; then\n fi\n \n if ! valid_patchname \"$newname\"; then\n-\tdie \"The specified patch name contains invalid characters (:).\"\n+\tdie \"The specified patch name is invalid according to git-check-ref-format(1).\"\n fi\n \n # create any directories as needed\ndiff --git a/guilt-new b/guilt-new\nindex 9528438..9f7fa44 100755\n--- a/guilt-new\n+++ b/guilt-new\n@@ -64,7 +64,7 @@ fi\n \n if ! valid_patchname \"$patch\"; then\n \tdisp \"Patchname is invalid.\" >&2\n-\tdie \"it cannot begin with '/', './' or '../', or contain /./, /../, or whitespace\"\n+\tdie \"It must follow the rules in git-check-ref-format(1).\"\n fi\n \n # create any directories as needed\ndiff --git a/regression/t-025.out b/regression/t-025.out\nindex 7811ab1..01bc406 100644\n--- a/regression/t-025.out\n+++ b/regression/t-025.out\n@@ -141,7 +141,7 @@ f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend\n r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend\n % guilt new white space\n Patchname is invalid.\n-it cannot begin with '/', './' or '../', or contain /./, /../, or whitespace\n+It must follow the rules in git-check-ref-format(1).\n % list_files\n d .git/patches\n d .git/patches/master\n@@ -211,7 +211,7 @@ f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend\n r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend\n % guilt new /abc\n Patchname is invalid.\n-it cannot begin with '/', './' or '../', or contain /./, /../, or whitespace\n+It must follow the rules in git-check-ref-format(1).\n % list_files\n d .git/patches\n d .git/patches/master\n@@ -235,7 +235,7 @@ f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend\n r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend\n % guilt new ./blah\n Patchname is invalid.\n-it cannot begin with '/', './' or '../', or contain /./, /../, or whitespace\n+It must follow the rules in git-check-ref-format(1).\n % list_files\n d .git/patches\n d .git/patches/master\n@@ -259,7 +259,7 @@ f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend\n r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend\n % guilt new ../blah\n Patchname is invalid.\n-it cannot begin with '/', './' or '../', or contain /./, /../, or whitespace\n+It must follow the rules in git-check-ref-format(1).\n % list_files\n d .git/patches\n d .git/patches/master\n@@ -283,7 +283,7 @@ f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend\n r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend\n % guilt new abc/./blah\n Patchname is invalid.\n-it cannot begin with '/', './' or '../', or contain /./, /../, or whitespace\n+It must follow the rules in git-check-ref-format(1).\n % list_files\n d .git/patches\n d .git/patches/master\n@@ -307,7 +307,7 @@ f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend\n r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend\n % guilt new abc/../blah\n Patchname is invalid.\n-it cannot begin with '/', './' or '../', or contain /./, /../, or whitespace\n+It must follow the rules in git-check-ref-format(1).\n % list_files\n d .git/patches\n d .git/patches/master\n@@ -331,7 +331,7 @@ f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend\n r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend\n % guilt new abc/.\n Patchname is invalid.\n-it cannot begin with '/', './' or '../', or contain /./, /../, or whitespace\n+It must follow the rules in git-check-ref-format(1).\n % list_files\n d .git/patches\n d .git/patches/master\n@@ -355,7 +355,7 @@ f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend\n r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend\n % guilt new abc/..\n Patchname is invalid.\n-it cannot begin with '/', './' or '../', or contain /./, /../, or whitespace\n+It must follow the rules in git-check-ref-format(1).\n % list_files\n d .git/patches\n d .git/patches/master\n@@ -379,7 +379,415 @@ f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend\n r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend\n % guilt new abc/\n Patchname is invalid.\n-it cannot begin with '/', './' or '../', or contain /./, /../, or whitespace\n+It must follow the rules in git-check-ref-format(1).\n+% list_files\n+d .git/patches\n+d .git/patches/master\n+d .git/patches/master/dir\n+d .git/patches/master/dir/subdir\n+d .git/refs/patches\n+d .git/refs/patches/master\n+d .git/refs/patches/master/dir\n+d .git/refs/patches/master/dir/subdir\n+f 1ef04b4f4149870b3f06b5f99b9d9fc260cebc67  .git/patches/master/series\n+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode\n+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove\n+f 7ce0ecd062afe46bf743d0d63dbe79e18774fe03  .git/patches/master/status\n+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add\n+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/append\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/file\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/subdir/file\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/file\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend\n+r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend\n+% guilt new abc.lock\n+Patchname is invalid.\n+It must follow the rules in git-check-ref-format(1).\n+% list_files\n+d .git/patches\n+d .git/patches/master\n+d .git/patches/master/dir\n+d .git/patches/master/dir/subdir\n+d .git/refs/patches\n+d .git/refs/patches/master\n+d .git/refs/patches/master/dir\n+d .git/refs/patches/master/dir/subdir\n+f 1ef04b4f4149870b3f06b5f99b9d9fc260cebc67  .git/patches/master/series\n+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode\n+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove\n+f 7ce0ecd062afe46bf743d0d63dbe79e18774fe03  .git/patches/master/status\n+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add\n+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/append\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/file\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/subdir/file\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/file\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend\n+r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend\n+% guilt new a/b.lock/c\n+Patchname is invalid.\n+It must follow the rules in git-check-ref-format(1).\n+% list_files\n+d .git/patches\n+d .git/patches/master\n+d .git/patches/master/dir\n+d .git/patches/master/dir/subdir\n+d .git/refs/patches\n+d .git/refs/patches/master\n+d .git/refs/patches/master/dir\n+d .git/refs/patches/master/dir/subdir\n+f 1ef04b4f4149870b3f06b5f99b9d9fc260cebc67  .git/patches/master/series\n+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode\n+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove\n+f 7ce0ecd062afe46bf743d0d63dbe79e18774fe03  .git/patches/master/status\n+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add\n+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/append\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/file\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/subdir/file\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/file\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend\n+r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend\n+% guilt new cr\n+Patchname is invalid.\n+It must follow the rules in git-check-ref-format(1).\n+% list_files\n+d .git/patches\n+d .git/patches/master\n+d .git/patches/master/dir\n+d .git/patches/master/dir/subdir\n+d .git/refs/patches\n+d .git/refs/patches/master\n+d .git/refs/patches/master/dir\n+d .git/refs/patches/master/dir/subdir\n+f 1ef04b4f4149870b3f06b5f99b9d9fc260cebc67  .git/patches/master/series\n+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode\n+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove\n+f 7ce0ecd062afe46bf743d0d63dbe79e18774fe03  .git/patches/master/status\n+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add\n+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/append\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/file\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/subdir/file\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/file\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend\n+r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend\n+% guilt new ctrl-a\u0001\n+Patchname is invalid.\n+It must follow the rules in git-check-ref-format(1).\n+% list_files\n+d .git/patches\n+d .git/patches/master\n+d .git/patches/master/dir\n+d .git/patches/master/dir/subdir\n+d .git/refs/patches\n+d .git/refs/patches/master\n+d .git/refs/patches/master/dir\n+d .git/refs/patches/master/dir/subdir\n+f 1ef04b4f4149870b3f06b5f99b9d9fc260cebc67  .git/patches/master/series\n+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode\n+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove\n+f 7ce0ecd062afe46bf743d0d63dbe79e18774fe03  .git/patches/master/status\n+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add\n+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/append\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/file\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/subdir/file\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/file\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend\n+r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend\n+% guilt new formfeed\f\n+Patchname is invalid.\n+It must follow the rules in git-check-ref-format(1).\n+% list_files\n+d .git/patches\n+d .git/patches/master\n+d .git/patches/master/dir\n+d .git/patches/master/dir/subdir\n+d .git/refs/patches\n+d .git/refs/patches/master\n+d .git/refs/patches/master/dir\n+d .git/refs/patches/master/dir/subdir\n+f 1ef04b4f4149870b3f06b5f99b9d9fc260cebc67  .git/patches/master/series\n+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode\n+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove\n+f 7ce0ecd062afe46bf743d0d63dbe79e18774fe03  .git/patches/master/status\n+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add\n+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/append\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/file\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/subdir/file\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/file\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend\n+r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend\n+% guilt new del\n+Patchname is invalid.\n+It must follow the rules in git-check-ref-format(1).\n+% list_files\n+d .git/patches\n+d .git/patches/master\n+d .git/patches/master/dir\n+d .git/patches/master/dir/subdir\n+d .git/refs/patches\n+d .git/refs/patches/master\n+d .git/refs/patches/master/dir\n+d .git/refs/patches/master/dir/subdir\n+f 1ef04b4f4149870b3f06b5f99b9d9fc260cebc67  .git/patches/master/series\n+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode\n+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove\n+f 7ce0ecd062afe46bf743d0d63dbe79e18774fe03  .git/patches/master/status\n+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add\n+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/append\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/file\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/subdir/file\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/file\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend\n+r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend\n+% guilt new tilde~\n+Patchname is invalid.\n+It must follow the rules in git-check-ref-format(1).\n+% list_files\n+d .git/patches\n+d .git/patches/master\n+d .git/patches/master/dir\n+d .git/patches/master/dir/subdir\n+d .git/refs/patches\n+d .git/refs/patches/master\n+d .git/refs/patches/master/dir\n+d .git/refs/patches/master/dir/subdir\n+f 1ef04b4f4149870b3f06b5f99b9d9fc260cebc67  .git/patches/master/series\n+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode\n+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove\n+f 7ce0ecd062afe46bf743d0d63dbe79e18774fe03  .git/patches/master/status\n+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add\n+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/append\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/file\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/subdir/file\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/file\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend\n+r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend\n+% guilt new caret^\n+Patchname is invalid.\n+It must follow the rules in git-check-ref-format(1).\n+% list_files\n+d .git/patches\n+d .git/patches/master\n+d .git/patches/master/dir\n+d .git/patches/master/dir/subdir\n+d .git/refs/patches\n+d .git/refs/patches/master\n+d .git/refs/patches/master/dir\n+d .git/refs/patches/master/dir/subdir\n+f 1ef04b4f4149870b3f06b5f99b9d9fc260cebc67  .git/patches/master/series\n+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode\n+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove\n+f 7ce0ecd062afe46bf743d0d63dbe79e18774fe03  .git/patches/master/status\n+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add\n+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/append\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/file\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/subdir/file\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/file\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend\n+r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend\n+% guilt new colon:\n+Patchname is invalid.\n+It must follow the rules in git-check-ref-format(1).\n+% list_files\n+d .git/patches\n+d .git/patches/master\n+d .git/patches/master/dir\n+d .git/patches/master/dir/subdir\n+d .git/refs/patches\n+d .git/refs/patches/master\n+d .git/refs/patches/master/dir\n+d .git/refs/patches/master/dir/subdir\n+f 1ef04b4f4149870b3f06b5f99b9d9fc260cebc67  .git/patches/master/series\n+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode\n+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove\n+f 7ce0ecd062afe46bf743d0d63dbe79e18774fe03  .git/patches/master/status\n+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add\n+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/append\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/file\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/subdir/file\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/file\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend\n+r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend\n+% guilt new questionmark?\n+Patchname is invalid.\n+It must follow the rules in git-check-ref-format(1).\n+% list_files\n+d .git/patches\n+d .git/patches/master\n+d .git/patches/master/dir\n+d .git/patches/master/dir/subdir\n+d .git/refs/patches\n+d .git/refs/patches/master\n+d .git/refs/patches/master/dir\n+d .git/refs/patches/master/dir/subdir\n+f 1ef04b4f4149870b3f06b5f99b9d9fc260cebc67  .git/patches/master/series\n+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode\n+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove\n+f 7ce0ecd062afe46bf743d0d63dbe79e18774fe03  .git/patches/master/status\n+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add\n+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/append\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/file\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/subdir/file\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/file\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend\n+r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend\n+% guilt new asterisk*\n+Patchname is invalid.\n+It must follow the rules in git-check-ref-format(1).\n+% list_files\n+d .git/patches\n+d .git/patches/master\n+d .git/patches/master/dir\n+d .git/patches/master/dir/subdir\n+d .git/refs/patches\n+d .git/refs/patches/master\n+d .git/refs/patches/master/dir\n+d .git/refs/patches/master/dir/subdir\n+f 1ef04b4f4149870b3f06b5f99b9d9fc260cebc67  .git/patches/master/series\n+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode\n+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove\n+f 7ce0ecd062afe46bf743d0d63dbe79e18774fe03  .git/patches/master/status\n+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add\n+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/append\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/file\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/subdir/file\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/file\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend\n+r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend\n+% guilt new open[bracket\n+Patchname is invalid.\n+It must follow the rules in git-check-ref-format(1).\n+% list_files\n+d .git/patches\n+d .git/patches/master\n+d .git/patches/master/dir\n+d .git/patches/master/dir/subdir\n+d .git/refs/patches\n+d .git/refs/patches/master\n+d .git/refs/patches/master/dir\n+d .git/refs/patches/master/dir/subdir\n+f 1ef04b4f4149870b3f06b5f99b9d9fc260cebc67  .git/patches/master/series\n+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode\n+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove\n+f 7ce0ecd062afe46bf743d0d63dbe79e18774fe03  .git/patches/master/status\n+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add\n+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/append\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/file\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/subdir/file\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/file\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend\n+r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend\n+% guilt new consecutive//slashes\n+Patchname is invalid.\n+It must follow the rules in git-check-ref-format(1).\n+% list_files\n+d .git/patches\n+d .git/patches/master\n+d .git/patches/master/dir\n+d .git/patches/master/dir/subdir\n+d .git/refs/patches\n+d .git/refs/patches/master\n+d .git/refs/patches/master/dir\n+d .git/refs/patches/master/dir/subdir\n+f 1ef04b4f4149870b3f06b5f99b9d9fc260cebc67  .git/patches/master/series\n+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode\n+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove\n+f 7ce0ecd062afe46bf743d0d63dbe79e18774fe03  .git/patches/master/status\n+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add\n+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/append\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/file\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/subdir/file\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/file\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend\n+r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend\n+% guilt new trailing-dot.\n+Patchname is invalid.\n+It must follow the rules in git-check-ref-format(1).\n+% list_files\n+d .git/patches\n+d .git/patches/master\n+d .git/patches/master/dir\n+d .git/patches/master/dir/subdir\n+d .git/refs/patches\n+d .git/refs/patches/master\n+d .git/refs/patches/master/dir\n+d .git/refs/patches/master/dir/subdir\n+f 1ef04b4f4149870b3f06b5f99b9d9fc260cebc67  .git/patches/master/series\n+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode\n+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove\n+f 7ce0ecd062afe46bf743d0d63dbe79e18774fe03  .git/patches/master/status\n+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add\n+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/append\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/file\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/subdir/file\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/file\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend\n+r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend\n+% guilt new bad@{seq\n+Patchname is invalid.\n+It must follow the rules in git-check-ref-format(1).\n+% list_files\n+d .git/patches\n+d .git/patches/master\n+d .git/patches/master/dir\n+d .git/patches/master/dir/subdir\n+d .git/refs/patches\n+d .git/refs/patches/master\n+d .git/refs/patches/master/dir\n+d .git/refs/patches/master/dir/subdir\n+f 1ef04b4f4149870b3f06b5f99b9d9fc260cebc67  .git/patches/master/series\n+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode\n+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove\n+f 7ce0ecd062afe46bf743d0d63dbe79e18774fe03  .git/patches/master/status\n+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add\n+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/append\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/file\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/subdir/file\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/file\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend\n+r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend\n+% guilt new @\n+Patchname is invalid.\n+It must follow the rules in git-check-ref-format(1).\n+% list_files\n+d .git/patches\n+d .git/patches/master\n+d .git/patches/master/dir\n+d .git/patches/master/dir/subdir\n+d .git/refs/patches\n+d .git/refs/patches/master\n+d .git/refs/patches/master/dir\n+d .git/refs/patches/master/dir/subdir\n+f 1ef04b4f4149870b3f06b5f99b9d9fc260cebc67  .git/patches/master/series\n+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode\n+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove\n+f 7ce0ecd062afe46bf743d0d63dbe79e18774fe03  .git/patches/master/status\n+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add\n+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/append\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/file\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/subdir/file\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/file\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend\n+r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend\n+% guilt new backslash\\\n+Patchname is invalid.\n+It must follow the rules in git-check-ref-format(1).\n % list_files\n d .git/patches\n d .git/patches/master\ndiff --git a/regression/t-025.sh b/regression/t-025.sh\nindex 985fed4..8c439fc 100755\n--- a/regression/t-025.sh\n+++ b/regression/t-025.sh\n@@ -43,7 +43,17 @@ shouldfail guilt new \"white space\"\n \n cmd list_files\n \n-for pname in prepend mode /abc ./blah ../blah abc/./blah abc/../blah abc/. abc/.. abc/ ; do\n+b()\n+{\n+    printf \"%b\" \"$1\"\n+}\n+\n+for pname in prepend mode /abc ./blah ../blah abc/./blah abc/../blah abc/. \\\n+\tabc/.. abc/ abc.lock a/b.lock/c `b 'cr\\r'` `b 'ctrl-a\\001'` \\\n+\t`b 'formfeed\\f'` `b 'del\\177'` \"tilde~\" \"caret^\" \"colon:\" \\\n+\t\"questionmark?\" \"asterisk*\" \"open[bracket\" \"consecutive//slashes\" \\\n+\t\"trailing-dot.\" \"bad@{seq\" \"@\" \"backslash\\\\\"\n+do\n \tshouldfail guilt new \"$pname\"\n \n \tcmd list_files\ndiff --git a/regression/t-032.out b/regression/t-032.out\nindex 53f0370..4e65db0 100644\n--- a/regression/t-032.out\n+++ b/regression/t-032.out\n@@ -1,7 +1,7 @@\n % setup_repo\n % touch foo foo:baz\n % guilt import -P foo:bar foo\n-The specified patch name contains invalid characters (:).\n+The specified patch name is invalid according to git-check-ref-format(1).\n % guilt import -P foo:bar foo2\n Specified file does not exist.\n % guilt import -P foo foo2\n@@ -15,4 +15,4 @@ Already tracking a patch under that name.\n Already tracking a patch under that name.\n % guilt import -P foo,bar foo\n % guilt import foo:baz\n-The specified patch name contains invalid characters (:).\n+The specified patch name is invalid according to git-check-ref-format(1).\n-- \n1.8.3.1\n"},{"id":"237283","messageId":"1395387126-13681-16-git-send-email-cederp@opera.com","threadId":"36262","inReplyTo":"1395387126-13681-1-git-send-email-cederp@opera.com","subject":"[GUILT 15/28] Produce legal patch names in guilt-import-commit.","fromName":"Per Cederqvist","fromEmail":"cederp@opera.com","sentAt":"2014-03-21T07:31:53Z","receivedAt":"2014-03-21T07:31:53Z","isPatch":false,"sender":{"key":"cederp@opera.com","avatar":"https://gravatar.com/avatar/008fe28caedea0ba34042cd5157705267934f4ba7a9b29fb248ae18ec5b3055e?d=mp&s=160"},"body":"Try harder to create patch names that adhere to the rules in\ngit-check-ref-format(1) when deriving a patch name from the commit\nmessage.  Verify that the derived name using \"git check-ref-format\",\nand as a final fallback simply use the patch name \"x\" (to ensure that\nthe code is future-proof in case new rules are added in the future).\n\nAlways append a \".patch\" suffix to the patch name.\n\nAdded test cases.\n\nSigned-off-by: Per Cederqvist <cederp@opera.com>\n---\n guilt-import-commit  |  22 +-\n regression/t-034.out | 567 +++++++++++++++++++++++++++++++++++++++++++++++++++\n regression/t-034.sh  |  72 +++++++\n 3 files changed, 659 insertions(+), 2 deletions(-)\n create mode 100644 regression/t-034.out\n create mode 100755 regression/t-034.sh\n\ndiff --git a/guilt-import-commit b/guilt-import-commit\nindex 9488ded..a4119d6 100755\n--- a/guilt-import-commit\n+++ b/guilt-import-commit\n@@ -28,19 +28,37 @@ disp \"Current head: `cat \\\"$GIT_DIR\\\"/refs/heads/\\`git_branch\\``\" >&2\n for rev in `git rev-list $rhash`; do\n \ts=`git log --pretty=oneline -1 $rev | cut -c 42-`\n \n+\t# Try to convert the first line of the commit message to a\n+\t# valid patch name.\n \tfname=`echo $s | sed -e \"s/&/and/g\" -e \"s/[ :]/_/g\" -e \"s,[/\\\\],-,g\" \\\n \t\t\t-e \"s/['\\\\[{}]//g\" -e 's/]//g' -e 's/\\*/-/g' \\\n-\t\t\t-e 's/\\?/-/g' | tr A-Z a-z`\n+\t\t\t-e 's/\\?/-/g' -e 's/\\.\\.\\.*/./g' -e 's/^\\.//' \\\n+\t\t\t-e 's/\\.patch$//' -e 's/\\.$//' | tr A-Z a-z`\n+\n+\tif ! valid_patchname \"$fname\"\n+\tthen\n+\t\t# Try harder to make it a legal commit name by\n+\t\t# removing all but a few safe characters.\n+\t\tfname=`echo $fname|tr -d -c _a-zA-Z0-9---/\\\\n`\n+\tfi\n+\tif ! valid_patchname \"$fname\"\n+\tthen\n+\t\t# If we failed to derive a legal patch name, use the\n+\t\t# name \"x\".  (If this happens, we likely have to\n+\t\t# append a suffix to make the name unique.)\n+\t\tfname=x\n+\tfi\n \n \tdisp \"Converting `echo $rev | cut -c 1-8` as $fname\"\n \n \tmangle_prefix=1\n \tfname_base=$fname\n-\twhile [ -f \"$GUILT_DIR/$branch/$fname\" ]; do\n+\twhile [ -f \"$GUILT_DIR/$branch/$fname.patch\" ]; do\n \t\tfname=\"$fname_base-$mangle_prefix\"\n \t        mangle_prefix=`expr $mangle_prefix + 1`\n \t\tdisp \"Patch under that name exists...trying '$fname'\"\n \tdone\n+\tfname=\"$fname\".patch\n \n \t(\n \t\tdo_make_header $rev\ndiff --git a/regression/t-034.out b/regression/t-034.out\nnew file mode 100644\nindex 0000000..7bc9459\n--- /dev/null\n+++ b/regression/t-034.out\n@@ -0,0 +1,567 @@\n+% setup_git_repo\n+% git tag base\n+% create_commit a The sequence /. is forbidden.\n+[master eebb76e] The sequence /. is forbidden.\n+ Author: Author Name <author@email>\n+ 1 file changed, 1 insertion(+)\n+ create mode 100644 a\n+% create_commit a The sequence .lock/ is forbidden.\n+[master 45e81b5] The sequence .lock/ is forbidden.\n+ Author: Author Name <author@email>\n+ 1 file changed, 1 insertion(+)\n+% create_commit a A/component/may/not/end/in/foo.lock\n+[master bbf3f59] A/component/may/not/end/in/foo.lock\n+ Author: Author Name <author@email>\n+ 1 file changed, 1 insertion(+)\n+% create_commit a Two consecutive dots (..) is forbidden.\n+[master 1535e67] Two consecutive dots (..) is forbidden.\n+ Author: Author Name <author@email>\n+ 1 file changed, 1 insertion(+)\n+% create_commit a Check/multiple/../dots/...../foo..patch\n+[master 48eb60c] Check/multiple/../dots/...../foo..patch\n+ Author: Author Name <author@email>\n+ 1 file changed, 1 insertion(+)\n+% create_commit a Space is forbidden.\n+[master 10dea83] Space is forbidden.\n+ Author: Author Name <author@email>\n+ 1 file changed, 1 insertion(+)\n+% create_commit a Tilde~is~forbidden.\n+[master 70a83b7] Tilde~is~forbidden.\n+ Author: Author Name <author@email>\n+ 1 file changed, 1 insertion(+)\n+% create_commit a Caret^is^forbidden.\n+[master ee6ef2c] Caret^is^forbidden.\n+ Author: Author Name <author@email>\n+ 1 file changed, 1 insertion(+)\n+% create_commit a Colon:is:forbidden.\n+[master c077fe2] Colon:is:forbidden.\n+ Author: Author Name <author@email>\n+ 1 file changed, 1 insertion(+)\n+% create_commit a Delisforbidden.\n+[master 589ee30] Delisforbidden.\n+ Author: Author Name <author@email>\n+ 1 file changed, 1 insertion(+)\n+% git branch some-branch\n+% git tag some-tag\n+% create_commit a Ctrl\u0001is\u0002forbidden.\n+[master e63cdde] Ctrl\u0001is\u0002forbidden.\n+ Author: Author Name <author@email>\n+ 1 file changed, 1 insertion(+)\n+% create_commit a CR\nis\nalso\nforbidden.\n+[master 21ad093] CR\nis\nalso\nforbidden.\n+ Author: Author Name <author@email>\n+ 1 file changed, 1 insertion(+)\n+% create_commit a Question-mark?is?forbidden.\n+[master be2fa9b] Question-mark?is?forbidden.\n+ Author: Author Name <author@email>\n+ 1 file changed, 1 insertion(+)\n+% create_commit a Asterisk*is*forbidden.\n+[master af7b50f] Asterisk*is*forbidden.\n+ Author: Author Name <author@email>\n+ 1 file changed, 1 insertion(+)\n+% create_commit a Open[bracket[is[forbidden.\n+[master 689f618] Open[bracket[is[forbidden.\n+ Author: Author Name <author@email>\n+ 1 file changed, 1 insertion(+)\n+% create_commit a Multiple/slashes//are//forbidden.\n+[master 6e7d52a] Multiple/slashes//are//forbidden.\n+ Author: Author Name <author@email>\n+ 1 file changed, 1 insertion(+)\n+% create_commit a Cannot/end/in/slash/\n+[master 95bb6cd] Cannot/end/in/slash/\n+ Author: Author Name <author@email>\n+ 1 file changed, 1 insertion(+)\n+% create_commit a Cannot end in ..\n+[master 106e8e5] Cannot end in ..\n+ Author: Author Name <author@email>\n+ 1 file changed, 1 insertion(+)\n+% create_commit a Cannot@{have@{the@{sequence@{at-brace.\n+[master 30187ed] Cannot@{have@{the@{sequence@{at-brace.\n+ Author: Author Name <author@email>\n+ 1 file changed, 1 insertion(+)\n+% create_commit a @\n+[master aedb74f] @\n+ Author: Author Name <author@email>\n+ 1 file changed, 1 insertion(+)\n+% create_commit a Backslash\\is\\forbidden.\n+[master 0a46f8f] Backslash\\is\\forbidden.\n+ Author: Author Name <author@email>\n+ 1 file changed, 1 insertion(+)\n+% create_commit a Can/have/embedded/single/slashes\n+[master 2a8b188] Can/have/embedded/single/slashes\n+ Author: Author Name <author@email>\n+ 1 file changed, 1 insertion(+)\n+% git log\n+commit 2a8b1889aa5066193bac978e6bf5073ffcfa6541\n+Author: Author Name <author@email>\n+Date:   Mon Jan 1 00:00:00 2007 +0000\n+\n+    Can/have/embedded/single/slashes\n+\n+commit 0a46f8fa7c8c5a6f1039f842fe5cbd21d3a2a2a6\n+Author: Author Name <author@email>\n+Date:   Mon Jan 1 00:00:00 2007 +0000\n+\n+    Backslash\\is\\forbidden.\n+\n+commit aedb74fd8388282fd7af50cb191a7f62bfc45eb5\n+Author: Author Name <author@email>\n+Date:   Mon Jan 1 00:00:00 2007 +0000\n+\n+    @\n+\n+commit 30187ed0f47d12df9cedcbb846647d0d52130c12\n+Author: Author Name <author@email>\n+Date:   Mon Jan 1 00:00:00 2007 +0000\n+\n+    Cannot@{have@{the@{sequence@{at-brace.\n+\n+commit 106e8e5a8cceec7297af97376ca5f93506643d0b\n+Author: Author Name <author@email>\n+Date:   Mon Jan 1 00:00:00 2007 +0000\n+\n+    Cannot end in ..\n+\n+commit 95bb6cd7edf7b1e634a1e7d02c8faa99e39cbbf2\n+Author: Author Name <author@email>\n+Date:   Mon Jan 1 00:00:00 2007 +0000\n+\n+    Cannot/end/in/slash/\n+\n+commit 6e7d52a7dacc684225c11b4edd2bac25fb52bd9b\n+Author: Author Name <author@email>\n+Date:   Mon Jan 1 00:00:00 2007 +0000\n+\n+    Multiple/slashes//are//forbidden.\n+\n+commit 689f618085195775d204898254154b8bb50897a5\n+Author: Author Name <author@email>\n+Date:   Mon Jan 1 00:00:00 2007 +0000\n+\n+    Open[bracket[is[forbidden.\n+\n+commit af7b50f93854bc5f46de5a389c1f3dea081eae2f\n+Author: Author Name <author@email>\n+Date:   Mon Jan 1 00:00:00 2007 +0000\n+\n+    Asterisk*is*forbidden.\n+\n+commit be2fa9b5c5788dc05c4036f1b8197a1d33169610\n+Author: Author Name <author@email>\n+Date:   Mon Jan 1 00:00:00 2007 +0000\n+\n+    Question-mark?is?forbidden.\n+\n+commit 21ad093a0c1b4a96285180a3d7b99a4045ef9202\n+Author: Author Name <author@email>\n+Date:   Mon Jan 1 00:00:00 2007 +0000\n+\n+    CR\nis\nalso\nforbidden.\n+\n+commit e63cdde7a1c90b66d7d411683528200f3f067d5f\n+Author: Author Name <author@email>\n+Date:   Mon Jan 1 00:00:00 2007 +0000\n+\n+    Ctrl\u0001is\u0002forbidden.\n+\n+commit 589ee305a82aacf155529e75cbc84e661c37c83d\n+Author: Author Name <author@email>\n+Date:   Mon Jan 1 00:00:00 2007 +0000\n+\n+    Delisforbidden.\n+\n+commit c077fe203fd18036fb00b56eec1763673d1769c6\n+Author: Author Name <author@email>\n+Date:   Mon Jan 1 00:00:00 2007 +0000\n+\n+    Colon:is:forbidden.\n+\n+commit ee6ef2cc9dd5525409300377b013c0d9734bd931\n+Author: Author Name <author@email>\n+Date:   Mon Jan 1 00:00:00 2007 +0000\n+\n+    Caret^is^forbidden.\n+\n+commit 70a83b705a2602a9493aba7f8f22e7abd13adc63\n+Author: Author Name <author@email>\n+Date:   Mon Jan 1 00:00:00 2007 +0000\n+\n+    Tilde~is~forbidden.\n+\n+commit 10dea8380135f4d10cd10324e13da659261ceda3\n+Author: Author Name <author@email>\n+Date:   Mon Jan 1 00:00:00 2007 +0000\n+\n+    Space is forbidden.\n+\n+commit 48eb60cddaefdaac5f78655f9028a9da741a18d1\n+Author: Author Name <author@email>\n+Date:   Mon Jan 1 00:00:00 2007 +0000\n+\n+    Check/multiple/../dots/...../foo..patch\n+\n+commit 1535e67718949abf72f843685a1672ebfe4bd21f\n+Author: Author Name <author@email>\n+Date:   Mon Jan 1 00:00:00 2007 +0000\n+\n+    Two consecutive dots (..) is forbidden.\n+\n+commit bbf3f5926e11d97b08cdb6e833c9deb603453d1b\n+Author: Author Name <author@email>\n+Date:   Mon Jan 1 00:00:00 2007 +0000\n+\n+    A/component/may/not/end/in/foo.lock\n+\n+commit 45e81b5163ec3ed656b058ac3fd95b8986824e0f\n+Author: Author Name <author@email>\n+Date:   Mon Jan 1 00:00:00 2007 +0000\n+\n+    The sequence .lock/ is forbidden.\n+\n+commit eebb76e96913d2dc78aef5f233fadc74af770b3b\n+Author: Author Name <author@email>\n+Date:   Mon Jan 1 00:00:00 2007 +0000\n+\n+    The sequence /. is forbidden.\n+\n+commit d4850419ccc1146c7169f500725ce504b9774ed0\n+Author: Author Name <author@email>\n+Date:   Mon Jan 1 00:00:00 2007 +0000\n+\n+    initial\n+    \n+    Signed-off-by: Commiter Name <commiter@email>\n+% guilt init\n+% guilt import-commit base..HEAD\n+About to begin conversion...\n+Current head: 2a8b1889aa5066193bac978e6bf5073ffcfa6541\n+Converting 2a8b1889 as can-have-embedded-single-slashes\n+Converting 0a46f8fa as backslash-isorbidden\n+Converting aedb74fd as x\n+Converting 30187ed0 as cannot@have@the@sequence@at-brace\n+Converting 106e8e5a as cannot_end_in_\n+Converting 95bb6cd7 as cannot-end-in-slash-\n+Converting 6e7d52a7 as multiple-slashes--are--forbidden\n+Converting 689f6180 as openbracketisforbidden\n+Converting af7b50f9 as asterisk-is-forbidden\n+Converting be2fa9b5 as question-mark-is-forbidden\n+Converting 21ad093a as crisalsoforbidden\n+Converting e63cdde7 as ctrlisforbidden\n+Converting 589ee305 as delisforbidden\n+Converting c077fe20 as colon_is_forbidden\n+Converting ee6ef2cc as caretisforbidden\n+Converting 70a83b70 as tildeisforbidden\n+Converting 10dea838 as space_is_forbidden\n+Converting 48eb60cd as check-multiple-.-dots-.-foo\n+Converting 1535e677 as two_consecutive_dots_(.)_is_forbidden\n+Converting bbf3f592 as a-component-may-not-end-in-foolock\n+Converting 45e81b51 as the_sequence_.lock-_is_forbidden\n+Converting eebb76e9 as the_sequence_-._is_forbidden\n+Done.\n+Current head: d4850419ccc1146c7169f500725ce504b9774ed0\n+% guilt push -a\n+Applying patch..the_sequence_-._is_forbidden.patch\n+Patch applied.\n+Applying patch..the_sequence_.lock-_is_forbidden.patch\n+Patch applied.\n+Applying patch..a-component-may-not-end-in-foolock.patch\n+Patch applied.\n+Applying patch..two_consecutive_dots_(.)_is_forbidden.patch\n+Patch applied.\n+Applying patch..check-multiple-.-dots-.-foo.patch\n+Patch applied.\n+Applying patch..space_is_forbidden.patch\n+Patch applied.\n+Applying patch..tildeisforbidden.patch\n+Patch applied.\n+Applying patch..caretisforbidden.patch\n+Patch applied.\n+Applying patch..colon_is_forbidden.patch\n+Patch applied.\n+Applying patch..delisforbidden.patch\n+Patch applied.\n+Applying patch..ctrlisforbidden.patch\n+Patch applied.\n+Applying patch..crisalsoforbidden.patch\n+Patch applied.\n+Applying patch..question-mark-is-forbidden.patch\n+Patch applied.\n+Applying patch..asterisk-is-forbidden.patch\n+Patch applied.\n+Applying patch..openbracketisforbidden.patch\n+Patch applied.\n+Applying patch..multiple-slashes--are--forbidden.patch\n+Patch applied.\n+Applying patch..cannot-end-in-slash-.patch\n+Patch applied.\n+Applying patch..cannot_end_in_.patch\n+Patch applied.\n+Applying patch..cannot@have@the@sequence@at-brace.patch\n+Patch applied.\n+Applying patch..x.patch\n+Patch applied.\n+Applying patch..backslash-isorbidden.patch\n+Patch applied.\n+Applying patch..can-have-embedded-single-slashes.patch\n+Patch applied.\n+% git log --decorate\n+commit 434e07cacdd8e7eb4723e67cb2d100b3a4121a3a (HEAD, refs/patches/master/can-have-embedded-single-slashes.patch, guilt/master)\n+Author: Author Name <author@email>\n+Date:   Mon Jan 1 00:00:00 2007 +0000\n+\n+    Can/have/embedded/single/slashes\n+\n+commit 7c3ffa4f940c862e9f11f5d4a5ae421f7a8d3141 (refs/patches/master/backslash-isorbidden.patch)\n+Author: Author Name <author@email>\n+Date:   Mon Jan 1 00:00:00 2007 +0000\n+\n+    Backslash\\is\\forbidden.\n+\n+commit ea46f435d4d8f3c5349dce1aabc1a39fbf7ef803 (refs/patches/master/x.patch)\n+Author: Author Name <author@email>\n+Date:   Mon Jan 1 00:00:00 2007 +0000\n+\n+    @\n+\n+commit a275ed5d7f10ea88c986852ee95a7d5a61663b5f (refs/patches/master/cannot@have@the@sequence@at-brace.patch)\n+Author: Author Name <author@email>\n+Date:   Mon Jan 1 00:00:00 2007 +0000\n+\n+    Cannot@{have@{the@{sequence@{at-brace.\n+\n+commit f091fee39457e64ebd35410c1cf95e6613816a54 (refs/patches/master/cannot_end_in_.patch)\n+Author: Author Name <author@email>\n+Date:   Mon Jan 1 00:00:00 2007 +0000\n+\n+    Cannot end in ..\n+\n+commit 025672497aff5c910c8ff86aaedc662f14c2f4ad (refs/patches/master/cannot-end-in-slash-.patch)\n+Author: Author Name <author@email>\n+Date:   Mon Jan 1 00:00:00 2007 +0000\n+\n+    Cannot/end/in/slash/\n+\n+commit f13e243c7c56f39422567a431bccceec8b789596 (refs/patches/master/multiple-slashes--are--forbidden.patch)\n+Author: Author Name <author@email>\n+Date:   Mon Jan 1 00:00:00 2007 +0000\n+\n+    Multiple/slashes//are//forbidden.\n+\n+commit edef5e925083d445f71c170d3293fac9619bc7a2 (refs/patches/master/openbracketisforbidden.patch)\n+Author: Author Name <author@email>\n+Date:   Mon Jan 1 00:00:00 2007 +0000\n+\n+    Open[bracket[is[forbidden.\n+\n+commit 1626a11d979a1e9e775c766484172212277153df (refs/patches/master/asterisk-is-forbidden.patch)\n+Author: Author Name <author@email>\n+Date:   Mon Jan 1 00:00:00 2007 +0000\n+\n+    Asterisk*is*forbidden.\n+\n+commit 74df14ab3a0ec9a0382998fbf167ebb1b0a36c6a (refs/patches/master/question-mark-is-forbidden.patch)\n+Author: Author Name <author@email>\n+Date:   Mon Jan 1 00:00:00 2007 +0000\n+\n+    Question-mark?is?forbidden.\n+\n+commit ec46429125abdb0c5ac2b46cc399bdcd7cfc73fd (refs/patches/master/crisalsoforbidden.patch)\n+Author: Author Name <author@email>\n+Date:   Mon Jan 1 00:00:00 2007 +0000\n+\n+    CR\nis\nalso\nforbidden.\n+\n+commit 01524f9921af2a041cc88c068f76baa39e436cb2 (refs/patches/master/ctrlisforbidden.patch)\n+Author: Author Name <author@email>\n+Date:   Mon Jan 1 00:00:00 2007 +0000\n+\n+    Ctrl\u0001is\u0002forbidden.\n+\n+commit 9fc9677b61880f9159838e89f714893e0a2fcafb (refs/patches/master/delisforbidden.patch)\n+Author: Author Name <author@email>\n+Date:   Mon Jan 1 00:00:00 2007 +0000\n+\n+    Delisforbidden.\n+\n+commit 10433fd7206b7f79aabb4da514710d93c8deed4a (refs/patches/master/colon_is_forbidden.patch)\n+Author: Author Name <author@email>\n+Date:   Mon Jan 1 00:00:00 2007 +0000\n+\n+    Colon:is:forbidden.\n+\n+commit fb1edb753c97ec865ceea316420b1df586caaa2b (refs/patches/master/caretisforbidden.patch)\n+Author: Author Name <author@email>\n+Date:   Mon Jan 1 00:00:00 2007 +0000\n+\n+    Caret^is^forbidden.\n+\n+commit 3a0d5ccef0359004fcaa9cee98fbd6a2c4432e74 (refs/patches/master/tildeisforbidden.patch)\n+Author: Author Name <author@email>\n+Date:   Mon Jan 1 00:00:00 2007 +0000\n+\n+    Tilde~is~forbidden.\n+\n+commit ea22c3b49c448dba8d7eaa6b805f9f1bc83fbedc (refs/patches/master/space_is_forbidden.patch)\n+Author: Author Name <author@email>\n+Date:   Mon Jan 1 00:00:00 2007 +0000\n+\n+    Space is forbidden.\n+\n+commit db6ea8252440b04811344336f510a5469b2ddab0 (refs/patches/master/check-multiple-.-dots-.-foo.patch)\n+Author: Author Name <author@email>\n+Date:   Mon Jan 1 00:00:00 2007 +0000\n+\n+    Check/multiple/../dots/...../foo..patch\n+\n+commit fe07105cd62660f4440ad24b9fc7dfdd9e71d764 (refs/patches/master/two_consecutive_dots_(.)_is_forbidden.patch)\n+Author: Author Name <author@email>\n+Date:   Mon Jan 1 00:00:00 2007 +0000\n+\n+    Two consecutive dots (..) is forbidden.\n+\n+commit 96a3e92c4df85f52362ce4f6d31983c462db9ae9 (refs/patches/master/a-component-may-not-end-in-foolock.patch)\n+Author: Author Name <author@email>\n+Date:   Mon Jan 1 00:00:00 2007 +0000\n+\n+    A/component/may/not/end/in/foo.lock\n+\n+commit ee4f0f96dfc9c94f5410c1e6414f9004325a37fc (refs/patches/master/the_sequence_.lock-_is_forbidden.patch)\n+Author: Author Name <author@email>\n+Date:   Mon Jan 1 00:00:00 2007 +0000\n+\n+    The sequence .lock/ is forbidden.\n+\n+commit fdcb23c3072209bea3d9e0a2594132b936c5347e (refs/patches/master/the_sequence_-._is_forbidden.patch)\n+Author: Author Name <author@email>\n+Date:   Mon Jan 1 00:00:00 2007 +0000\n+\n+    The sequence /. is forbidden.\n+\n+commit d4850419ccc1146c7169f500725ce504b9774ed0 (tag: base, master)\n+Author: Author Name <author@email>\n+Date:   Mon Jan 1 00:00:00 2007 +0000\n+\n+    initial\n+    \n+    Signed-off-by: Commiter Name <commiter@email>\n+% git log --decorate some-branch\n+commit 589ee305a82aacf155529e75cbc84e661c37c83d (tag: some-tag, some-branch)\n+Author: Author Name <author@email>\n+Date:   Mon Jan 1 00:00:00 2007 +0000\n+\n+    Delisforbidden.\n+\n+commit c077fe203fd18036fb00b56eec1763673d1769c6\n+Author: Author Name <author@email>\n+Date:   Mon Jan 1 00:00:00 2007 +0000\n+\n+    Colon:is:forbidden.\n+\n+commit ee6ef2cc9dd5525409300377b013c0d9734bd931\n+Author: Author Name <author@email>\n+Date:   Mon Jan 1 00:00:00 2007 +0000\n+\n+    Caret^is^forbidden.\n+\n+commit 70a83b705a2602a9493aba7f8f22e7abd13adc63\n+Author: Author Name <author@email>\n+Date:   Mon Jan 1 00:00:00 2007 +0000\n+\n+    Tilde~is~forbidden.\n+\n+commit 10dea8380135f4d10cd10324e13da659261ceda3\n+Author: Author Name <author@email>\n+Date:   Mon Jan 1 00:00:00 2007 +0000\n+\n+    Space is forbidden.\n+\n+commit 48eb60cddaefdaac5f78655f9028a9da741a18d1\n+Author: Author Name <author@email>\n+Date:   Mon Jan 1 00:00:00 2007 +0000\n+\n+    Check/multiple/../dots/...../foo..patch\n+\n+commit 1535e67718949abf72f843685a1672ebfe4bd21f\n+Author: Author Name <author@email>\n+Date:   Mon Jan 1 00:00:00 2007 +0000\n+\n+    Two consecutive dots (..) is forbidden.\n+\n+commit bbf3f5926e11d97b08cdb6e833c9deb603453d1b\n+Author: Author Name <author@email>\n+Date:   Mon Jan 1 00:00:00 2007 +0000\n+\n+    A/component/may/not/end/in/foo.lock\n+\n+commit 45e81b5163ec3ed656b058ac3fd95b8986824e0f\n+Author: Author Name <author@email>\n+Date:   Mon Jan 1 00:00:00 2007 +0000\n+\n+    The sequence .lock/ is forbidden.\n+\n+commit eebb76e96913d2dc78aef5f233fadc74af770b3b\n+Author: Author Name <author@email>\n+Date:   Mon Jan 1 00:00:00 2007 +0000\n+\n+    The sequence /. is forbidden.\n+\n+commit d4850419ccc1146c7169f500725ce504b9774ed0 (tag: base, master)\n+Author: Author Name <author@email>\n+Date:   Mon Jan 1 00:00:00 2007 +0000\n+\n+    initial\n+    \n+    Signed-off-by: Commiter Name <commiter@email>\n+% list_files\n+d .git/patches\n+d .git/patches/master\n+d .git/refs/patches\n+d .git/refs/patches/master\n+f 06beca7069b9e576bd431f65d13862ed5d3e2a0f  .git/patches/master/ctrlisforbidden.patch\n+f 08267ec6783ea9d1adae55b275198f7594764ed0  .git/patches/master/series\n+f 08267ec6783ea9d1adae55b275198f7594764ed0  .git/patches/master/status\n+f 09b7e9be44ae5ec3a4bb30f5ee9d4ebc2c042f64  .git/patches/master/two_consecutive_dots_(.)_is_forbidden.patch\n+f 0b971c9a17aeca2319c93d700ffd98acc2a93451  .git/patches/master/question-mark-is-forbidden.patch\n+f 2b8392f63d61efc12add554555adae30883993cc  .git/patches/master/cannot-end-in-slash-.patch\n+f 2cd7c9ad392e071be03c051c6793e9b1e31d33c4  .git/patches/master/can-have-embedded-single-slashes.patch\n+f 3136e448a4c820f6d2642f9d894c4087d3d109ab  .git/patches/master/cannot_end_in_.patch\n+f 34e07c584032df137f19bdb66d93f316f00a5ac8  .git/patches/master/tildeisforbidden.patch\n+f 49bab499826b63deb2bd704629d60c7268c57aee  .git/patches/master/the_sequence_-._is_forbidden.patch\n+f 5bcddb8ccb6e6e5e8a61e9e56cb2e0f70cbab2f5  .git/patches/master/cannot@have@the@sequence@at-brace.patch\n+f 637b982fe14a240de181ae63226b27e0c406b3dc  .git/patches/master/asterisk-is-forbidden.patch\n+f 698f8a7d41a64e3b6be1a3eba86574078b22a5f3  .git/patches/master/backslash-isorbidden.patch\n+f 7b103c3c7ae298cd2334f6f49da48bae1424f77b  .git/patches/master/crisalsoforbidden.patch\n+f 9b810b8c63779c51d2e7f61ab59cd49835041563  .git/patches/master/x.patch\n+f a22958d9ae9976fd7b2b5a9d0bcd44bf7ad9b08a  .git/patches/master/caretisforbidden.patch\n+f ab325bf5a432937fc6f231d3e8a773a62d53952b  .git/patches/master/multiple-slashes--are--forbidden.patch\n+f cb9cffbd4465bddee266c20ccebd14eb687eaa89  .git/patches/master/delisforbidden.patch\n+f d0885a1a1fdee0fd1e4fedce3f7acd3100540bc4  .git/patches/master/openbracketisforbidden.patch\n+f d2903523fb66a346596eabbdd1bda4e52b266440  .git/patches/master/check-multiple-.-dots-.-foo.patch\n+f dfc11f76394059909671af036598c5fbe33001ba  .git/patches/master/space_is_forbidden.patch\n+f e47474c52d6c893f36d0457f885a6dd1267742bb  .git/patches/master/colon_is_forbidden.patch\n+f e7a5f8912592d9891e6159f5827c8b4f372cc406  .git/patches/master/the_sequence_.lock-_is_forbidden.patch\n+f edfaa5e06bd662ae1f6a642834324fd9b849bbd9  .git/patches/master/a-component-may-not-end-in-foolock.patch\n+r 01524f9921af2a041cc88c068f76baa39e436cb2  .git/refs/patches/master/ctrlisforbidden.patch\n+r 025672497aff5c910c8ff86aaedc662f14c2f4ad  .git/refs/patches/master/cannot-end-in-slash-.patch\n+r 10433fd7206b7f79aabb4da514710d93c8deed4a  .git/refs/patches/master/colon_is_forbidden.patch\n+r 1626a11d979a1e9e775c766484172212277153df  .git/refs/patches/master/asterisk-is-forbidden.patch\n+r 3a0d5ccef0359004fcaa9cee98fbd6a2c4432e74  .git/refs/patches/master/tildeisforbidden.patch\n+r 434e07cacdd8e7eb4723e67cb2d100b3a4121a3a  .git/refs/patches/master/can-have-embedded-single-slashes.patch\n+r 74df14ab3a0ec9a0382998fbf167ebb1b0a36c6a  .git/refs/patches/master/question-mark-is-forbidden.patch\n+r 7c3ffa4f940c862e9f11f5d4a5ae421f7a8d3141  .git/refs/patches/master/backslash-isorbidden.patch\n+r 96a3e92c4df85f52362ce4f6d31983c462db9ae9  .git/refs/patches/master/a-component-may-not-end-in-foolock.patch\n+r 9fc9677b61880f9159838e89f714893e0a2fcafb  .git/refs/patches/master/delisforbidden.patch\n+r a275ed5d7f10ea88c986852ee95a7d5a61663b5f  .git/refs/patches/master/cannot@have@the@sequence@at-brace.patch\n+r db6ea8252440b04811344336f510a5469b2ddab0  .git/refs/patches/master/check-multiple-.-dots-.-foo.patch\n+r ea22c3b49c448dba8d7eaa6b805f9f1bc83fbedc  .git/refs/patches/master/space_is_forbidden.patch\n+r ea46f435d4d8f3c5349dce1aabc1a39fbf7ef803  .git/refs/patches/master/x.patch\n+r ec46429125abdb0c5ac2b46cc399bdcd7cfc73fd  .git/refs/patches/master/crisalsoforbidden.patch\n+r edef5e925083d445f71c170d3293fac9619bc7a2  .git/refs/patches/master/openbracketisforbidden.patch\n+r ee4f0f96dfc9c94f5410c1e6414f9004325a37fc  .git/refs/patches/master/the_sequence_.lock-_is_forbidden.patch\n+r f091fee39457e64ebd35410c1cf95e6613816a54  .git/refs/patches/master/cannot_end_in_.patch\n+r f13e243c7c56f39422567a431bccceec8b789596  .git/refs/patches/master/multiple-slashes--are--forbidden.patch\n+r fb1edb753c97ec865ceea316420b1df586caaa2b  .git/refs/patches/master/caretisforbidden.patch\n+r fdcb23c3072209bea3d9e0a2594132b936c5347e  .git/refs/patches/master/the_sequence_-._is_forbidden.patch\n+r fe07105cd62660f4440ad24b9fc7dfdd9e71d764  .git/refs/patches/master/two_consecutive_dots_(.)_is_forbidden.patch\n+% guilt pop -a\n+All patches popped.\ndiff --git a/regression/t-034.sh b/regression/t-034.sh\nnew file mode 100755\nindex 0000000..1055ddb\n--- /dev/null\n+++ b/regression/t-034.sh\n@@ -0,0 +1,72 @@\n+#!/bin/bash\n+#\n+# Test import-commit\n+#\n+\n+function create_commit\n+{\n+\techo $1 >> $1 &&\n+\t\tgit add $1 &&\n+\t\tgit commit -m\"$2\"\n+}\n+\n+source \"$REG_DIR/scaffold\"\n+\n+b()\n+{\n+    printf \"%b\" \"$1\"\n+}\n+\n+cmd setup_git_repo\n+\n+cmd git tag base\n+\n+# Create a series of commits whose first line of the commit message\n+# each violates one of the rules in get-check-ref-format(1).\n+\n+cmd create_commit a \"The sequence /. is forbidden.\"\n+cmd create_commit a \"The sequence .lock/ is forbidden.\"\n+cmd create_commit a \"A/component/may/not/end/in/foo.lock\"\n+cmd create_commit a \"Two consecutive dots (..) is forbidden.\"\n+cmd create_commit a \"Check/multiple/../dots/...../foo..patch\"\n+cmd create_commit a \"Space is forbidden.\"\n+cmd create_commit a \"Tilde~is~forbidden.\"\n+cmd create_commit a \"Caret^is^forbidden.\"\n+cmd create_commit a \"Colon:is:forbidden.\"\n+cmd create_commit a `b 'Del\\177is\\177forbidden.'`\n+# Create a branch and a tag from the current commit, to ensure that\n+# doing so does not affect how the commit is imported.\n+cmd git branch some-branch\n+cmd git tag some-tag\n+cmd create_commit a `b 'Ctrl\\001is\\002forbidden.'`\n+cmd create_commit a `b 'CR\\ris\\ralso\\rforbidden.'`\n+cmd create_commit a \"Question-mark?is?forbidden.\"\n+cmd create_commit a \"Asterisk*is*forbidden.\"\n+cmd create_commit a \"Open[bracket[is[forbidden.\"\n+cmd create_commit a \"Multiple/slashes//are//forbidden.\"\n+cmd create_commit a \"Cannot/end/in/slash/\"\n+cmd create_commit a \"Cannot end in ..\"\n+cmd create_commit a \"Cannot@{have@{the@{sequence@{at-brace.\"\n+cmd create_commit a \"@\"\n+cmd create_commit a \"Backslash\\\\is\\\\forbidden.\"\n+\n+# Slash is sometimes allowed; this is not problematic.\n+cmd create_commit a \"Can/have/embedded/single/slashes\"\n+\n+cmd git log\n+\n+# Import all the commits to guilt.\n+cmd guilt init\n+cmd guilt import-commit base..HEAD\n+\n+for patch in .git/patches/master/*.patch\n+do\n+\ttouch -a -m -t \"$TOUCH_DATE\" \"$patch\"\n+done\n+\n+# If push and pop works, the names we created are good.\n+cmd guilt push -a\n+cmd git log --decorate\n+cmd git log --decorate some-branch\n+cmd list_files\n+cmd guilt pop -a\n-- \n1.8.3.1\n"},{"id":"237294","messageId":"1395387126-13681-17-git-send-email-cederp@opera.com","threadId":"36262","inReplyTo":"1395387126-13681-1-git-send-email-cederp@opera.com","subject":"[GUILT 16/28] Fix backslash handling when creating names of imported patches.","fromName":"Per Cederqvist","fromEmail":"cederp@opera.com","sentAt":"2014-03-21T07:31:54Z","receivedAt":"2014-03-21T07:31:54Z","isPatch":false,"sender":{"key":"cederp@opera.com","avatar":"https://gravatar.com/avatar/008fe28caedea0ba34042cd5157705267934f4ba7a9b29fb248ae18ec5b3055e?d=mp&s=160"},"body":"The 'echo %s' construct sometimes processes escape sequences.  (This\nhappens, for instance, under Ubuntu 14.04 when /bin/sh is actually\ndash.)  We don't want that to happen when we are importing commits, so\nuse 'printf %s \"$s\"' instead.\n\n(The -E option of bash that explicitly disables backslash expansion is\nnot portable; it is not supported by dash.)\n\nSigned-off-by: Per Cederqvist <cederp@opera.com>\n---\n guilt-import-commit  |  2 +-\n regression/t-034.out | 14 +++++++-------\n 2 files changed, 8 insertions(+), 8 deletions(-)\n\ndiff --git a/guilt-import-commit b/guilt-import-commit\nindex a4119d6..6eb2f4e 100755\n--- a/guilt-import-commit\n+++ b/guilt-import-commit\n@@ -30,7 +30,7 @@ for rev in `git rev-list $rhash`; do\n \n \t# Try to convert the first line of the commit message to a\n \t# valid patch name.\n-\tfname=`echo $s | sed -e \"s/&/and/g\" -e \"s/[ :]/_/g\" -e \"s,[/\\\\],-,g\" \\\n+\tfname=`printf %s \"$s\" | sed -e \"s/&/and/g\" -e \"s/[ :]/_/g\" -e \"s,[/\\\\],-,g\" \\\n \t\t\t-e \"s/['\\\\[{}]//g\" -e 's/]//g' -e 's/\\*/-/g' \\\n \t\t\t-e 's/\\?/-/g' -e 's/\\.\\.\\.*/./g' -e 's/^\\.//' \\\n \t\t\t-e 's/\\.patch$//' -e 's/\\.$//' | tr A-Z a-z`\ndiff --git a/regression/t-034.out b/regression/t-034.out\nindex 7bc9459..bda4399 100644\n--- a/regression/t-034.out\n+++ b/regression/t-034.out\n@@ -236,7 +236,7 @@ Date:   Mon Jan 1 00:00:00 2007 +0000\n About to begin conversion...\n Current head: 2a8b1889aa5066193bac978e6bf5073ffcfa6541\n Converting 2a8b1889 as can-have-embedded-single-slashes\n-Converting 0a46f8fa as backslash-isorbidden\n+Converting 0a46f8fa as backslash-is-forbidden\n Converting aedb74fd as x\n Converting 30187ed0 as cannot@have@the@sequence@at-brace\n Converting 106e8e5a as cannot_end_in_\n@@ -300,7 +300,7 @@ Applying patch..cannot@have@the@sequence@at-brace.patch\n Patch applied.\n Applying patch..x.patch\n Patch applied.\n-Applying patch..backslash-isorbidden.patch\n+Applying patch..backslash-is-forbidden.patch\n Patch applied.\n Applying patch..can-have-embedded-single-slashes.patch\n Patch applied.\n@@ -311,7 +311,7 @@ Date:   Mon Jan 1 00:00:00 2007 +0000\n \n     Can/have/embedded/single/slashes\n \n-commit 7c3ffa4f940c862e9f11f5d4a5ae421f7a8d3141 (refs/patches/master/backslash-isorbidden.patch)\n+commit 7c3ffa4f940c862e9f11f5d4a5ae421f7a8d3141 (refs/patches/master/backslash-is-forbidden.patch)\n Author: Author Name <author@email>\n Date:   Mon Jan 1 00:00:00 2007 +0000\n \n@@ -518,8 +518,6 @@ d .git/patches/master\n d .git/refs/patches\n d .git/refs/patches/master\n f 06beca7069b9e576bd431f65d13862ed5d3e2a0f  .git/patches/master/ctrlisforbidden.patch\n-f 08267ec6783ea9d1adae55b275198f7594764ed0  .git/patches/master/series\n-f 08267ec6783ea9d1adae55b275198f7594764ed0  .git/patches/master/status\n f 09b7e9be44ae5ec3a4bb30f5ee9d4ebc2c042f64  .git/patches/master/two_consecutive_dots_(.)_is_forbidden.patch\n f 0b971c9a17aeca2319c93d700ffd98acc2a93451  .git/patches/master/question-mark-is-forbidden.patch\n f 2b8392f63d61efc12add554555adae30883993cc  .git/patches/master/cannot-end-in-slash-.patch\n@@ -529,7 +527,7 @@ f 34e07c584032df137f19bdb66d93f316f00a5ac8  .git/patches/master/tildeisforbidden\n f 49bab499826b63deb2bd704629d60c7268c57aee  .git/patches/master/the_sequence_-._is_forbidden.patch\n f 5bcddb8ccb6e6e5e8a61e9e56cb2e0f70cbab2f5  .git/patches/master/cannot@have@the@sequence@at-brace.patch\n f 637b982fe14a240de181ae63226b27e0c406b3dc  .git/patches/master/asterisk-is-forbidden.patch\n-f 698f8a7d41a64e3b6be1a3eba86574078b22a5f3  .git/patches/master/backslash-isorbidden.patch\n+f 698f8a7d41a64e3b6be1a3eba86574078b22a5f3  .git/patches/master/backslash-is-forbidden.patch\n f 7b103c3c7ae298cd2334f6f49da48bae1424f77b  .git/patches/master/crisalsoforbidden.patch\n f 9b810b8c63779c51d2e7f61ab59cd49835041563  .git/patches/master/x.patch\n f a22958d9ae9976fd7b2b5a9d0bcd44bf7ad9b08a  .git/patches/master/caretisforbidden.patch\n@@ -537,6 +535,8 @@ f ab325bf5a432937fc6f231d3e8a773a62d53952b  .git/patches/master/multiple-slashes\n f cb9cffbd4465bddee266c20ccebd14eb687eaa89  .git/patches/master/delisforbidden.patch\n f d0885a1a1fdee0fd1e4fedce3f7acd3100540bc4  .git/patches/master/openbracketisforbidden.patch\n f d2903523fb66a346596eabbdd1bda4e52b266440  .git/patches/master/check-multiple-.-dots-.-foo.patch\n+f da90de1c84138194524994e0bc3bc4ca8189c999  .git/patches/master/series\n+f da90de1c84138194524994e0bc3bc4ca8189c999  .git/patches/master/status\n f dfc11f76394059909671af036598c5fbe33001ba  .git/patches/master/space_is_forbidden.patch\n f e47474c52d6c893f36d0457f885a6dd1267742bb  .git/patches/master/colon_is_forbidden.patch\n f e7a5f8912592d9891e6159f5827c8b4f372cc406  .git/patches/master/the_sequence_.lock-_is_forbidden.patch\n@@ -548,7 +548,7 @@ r 1626a11d979a1e9e775c766484172212277153df  .git/refs/patches/master/asterisk-is\n r 3a0d5ccef0359004fcaa9cee98fbd6a2c4432e74  .git/refs/patches/master/tildeisforbidden.patch\n r 434e07cacdd8e7eb4723e67cb2d100b3a4121a3a  .git/refs/patches/master/can-have-embedded-single-slashes.patch\n r 74df14ab3a0ec9a0382998fbf167ebb1b0a36c6a  .git/refs/patches/master/question-mark-is-forbidden.patch\n-r 7c3ffa4f940c862e9f11f5d4a5ae421f7a8d3141  .git/refs/patches/master/backslash-isorbidden.patch\n+r 7c3ffa4f940c862e9f11f5d4a5ae421f7a8d3141  .git/refs/patches/master/backslash-is-forbidden.patch\n r 96a3e92c4df85f52362ce4f6d31983c462db9ae9  .git/refs/patches/master/a-component-may-not-end-in-foolock.patch\n r 9fc9677b61880f9159838e89f714893e0a2fcafb  .git/refs/patches/master/delisforbidden.patch\n r a275ed5d7f10ea88c986852ee95a7d5a61663b5f  .git/refs/patches/master/cannot@have@the@sequence@at-brace.patch\n-- \n1.8.3.1\n"},{"id":"237289","messageId":"1395387126-13681-18-git-send-email-cederp@opera.com","threadId":"36262","inReplyTo":"1395387126-13681-1-git-send-email-cederp@opera.com","subject":"[GUILT 17/28] \"guilt graph\" no longer loops when no patches are applied.","fromName":"Per Cederqvist","fromEmail":"cederp@opera.com","sentAt":"2014-03-21T07:31:55Z","receivedAt":"2014-03-21T07:31:55Z","isPatch":false,"sender":{"key":"cederp@opera.com","avatar":"https://gravatar.com/avatar/008fe28caedea0ba34042cd5157705267934f4ba7a9b29fb248ae18ec5b3055e?d=mp&s=160"},"body":"Give an error message if no patches are applied.  Added a test case\nthat never terminates unless this fix is applied.\n\nSigned-off-by: Per Cederqvist <cederp@opera.com>\n---\n guilt-graph          | 10 ++++++++--\n regression/t-033.out |  3 +++\n regression/t-033.sh  | 11 +++++++++++\n 3 files changed, 22 insertions(+), 2 deletions(-)\n create mode 100644 regression/t-033.out\n create mode 100755 regression/t-033.sh\n\ndiff --git a/guilt-graph b/guilt-graph\nindex b3469dc..00301d5 100755\n--- a/guilt-graph\n+++ b/guilt-graph\n@@ -17,8 +17,14 @@ fi\n \n patchname=\"$1\"\n \n-bottom=`git rev-parse refs/patches/$branch/$(head_n 1 < \"$applied\")`\n-base=`git rev-parse $bottom^`\n+bottompatch=$(head_n 1 < \"$applied\")\n+if [ -z \"$bottompatch\" ]\n+then\n+\techo \"No patch applied.\" >&2\n+\texit 1\n+fi\n+\n+base=`git rev-parse \"refs/patches/${branch}/${bottompatch}^\"`\n \n if [ -z \"$patchname\" ]; then\n \ttop=`git rev-parse HEAD`\ndiff --git a/regression/t-033.out b/regression/t-033.out\nnew file mode 100644\nindex 0000000..76613f9\n--- /dev/null\n+++ b/regression/t-033.out\n@@ -0,0 +1,3 @@\n+% setup_repo\n+% guilt graph\n+No patch applied.\ndiff --git a/regression/t-033.sh b/regression/t-033.sh\nnew file mode 100755\nindex 0000000..ae40577\n--- /dev/null\n+++ b/regression/t-033.sh\n@@ -0,0 +1,11 @@\n+#!/bin/bash\n+#\n+# Test the graph code\n+#\n+\n+source \"$REG_DIR/scaffold\"\n+\n+cmd setup_repo\n+\n+shouldfail guilt graph\n+\n-- \n1.8.3.1\n"},{"id":"237273","messageId":"1395387126-13681-19-git-send-email-cederp@opera.com","threadId":"36262","inReplyTo":"1395387126-13681-1-git-send-email-cederp@opera.com","subject":"[GUILT 18/28] guilt-graph: Handle commas in branch names.","fromName":"Per Cederqvist","fromEmail":"cederp@opera.com","sentAt":"2014-03-21T07:31:56Z","receivedAt":"2014-03-21T07:31:56Z","isPatch":false,"sender":{"key":"cederp@opera.com","avatar":"https://gravatar.com/avatar/008fe28caedea0ba34042cd5157705267934f4ba7a9b29fb248ae18ec5b3055e?d=mp&s=160"},"body":"This fix relies on the fact that git branch names can not contain \":\".\n\nSigned-off-by: Per Cederqvist <cederp@opera.com>\n---\n guilt-graph | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/guilt-graph b/guilt-graph\nindex 00301d5..575f03b 100755\n--- a/guilt-graph\n+++ b/guilt-graph\n@@ -52,7 +52,7 @@ safebranch=`echo \"$branch\"|sed 's%/%\\\\\\\\/%g'`\n while [ \"$current\" != \"$base\" ]; do\n \tpname=`git show-ref | sed -n -e \"\n /^$current refs\\/patches\\/$safebranch/ {\n-\ts,^$current refs/patches/$branch/,,\n+\ts:^$current refs/patches/$branch/::\n \tp\n \tq\n }\"`\n-- \n1.8.3.1\n"},{"id":"237287","messageId":"1395387126-13681-20-git-send-email-cederp@opera.com","threadId":"36262","inReplyTo":"1395387126-13681-1-git-send-email-cederp@opera.com","subject":"[GUILT 19/28] Check that \"guilt graph\" works when working on a branch with a comma.","fromName":"Per Cederqvist","fromEmail":"cederp@opera.com","sentAt":"2014-03-21T07:31:57Z","receivedAt":"2014-03-21T07:31:57Z","isPatch":false,"sender":{"key":"cederp@opera.com","avatar":"https://gravatar.com/avatar/008fe28caedea0ba34042cd5157705267934f4ba7a9b29fb248ae18ec5b3055e?d=mp&s=160"},"body":"git branch names can contain commas.  Check that \"guilt graph\" works\neven in that case.\n\nSigned-off-by: Per Cederqvist <cederp@opera.com>\n---\n regression/t-033.out | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++\n regression/t-033.sh  | 37 +++++++++++++++++++++++++++++++\n 2 files changed, 99 insertions(+)\n\ndiff --git a/regression/t-033.out b/regression/t-033.out\nindex 76613f9..e638d7b 100644\n--- a/regression/t-033.out\n+++ b/regression/t-033.out\n@@ -1,3 +1,65 @@\n % setup_repo\n % guilt graph\n No patch applied.\n+% git checkout -b a,graph master\n+Switched to a new branch 'a,graph'\n+% guilt init\n+% guilt new a.patch\n+% guilt pop\n+All patches popped.\n+% guilt push\n+Applying patch..a.patch\n+Patch applied.\n+% guilt graph\n+digraph G {\n+# checking rev 95275d7c05c6a6176d3941374115b91272877f6c\n+\t\"95275d7c05c6a6176d3941374115b91272877f6c\" [label=\"a.patch\"]\n+}\n+% git add file.txt\n+% guilt refresh\n+Patch a.patch refreshed\n+% guilt pop\n+All patches popped.\n+% guilt push\n+Applying patch..a.patch\n+Patch applied.\n+% guilt graph\n+digraph G {\n+# checking rev ff2775f8d1dc753f635830adcc3a067e0b681e2d\n+\t\"ff2775f8d1dc753f635830adcc3a067e0b681e2d\" [label=\"a.patch\"]\n+}\n+% guilt new b.patch\n+% git add file2.txt\n+% guilt refresh\n+Patch b.patch refreshed\n+% guilt pop\n+Now at a.patch.\n+% guilt push\n+Applying patch..b.patch\n+Patch applied.\n+% guilt graph\n+digraph G {\n+# checking rev c7014443c33d2b0237293687ceb9cbd38313df65\n+\t\"c7014443c33d2b0237293687ceb9cbd38313df65\" [label=\"b.patch\"]\n+# checking rev ff2775f8d1dc753f635830adcc3a067e0b681e2d\n+\t\"ff2775f8d1dc753f635830adcc3a067e0b681e2d\" [label=\"a.patch\"]\n+}\n+% guilt new c.patch\n+% git add file.txt\n+% guilt refresh\n+Patch c.patch refreshed\n+% guilt pop\n+Now at b.patch.\n+% guilt push\n+Applying patch..c.patch\n+Patch applied.\n+% guilt graph\n+digraph G {\n+# checking rev 891bc14b5603474c9743fd04f3da888644413dc5\n+\t\"891bc14b5603474c9743fd04f3da888644413dc5\" [label=\"c.patch\"]\n+# checking rev c7014443c33d2b0237293687ceb9cbd38313df65\n+\t\"c7014443c33d2b0237293687ceb9cbd38313df65\" [label=\"b.patch\"]\n+# checking rev ff2775f8d1dc753f635830adcc3a067e0b681e2d\n+\t\"ff2775f8d1dc753f635830adcc3a067e0b681e2d\" [label=\"a.patch\"]\n+\t\"891bc14b5603474c9743fd04f3da888644413dc5\" -> \"ff2775f8d1dc753f635830adcc3a067e0b681e2d\"; // ?\n+}\ndiff --git a/regression/t-033.sh b/regression/t-033.sh\nindex ae40577..57dce78 100755\n--- a/regression/t-033.sh\n+++ b/regression/t-033.sh\n@@ -3,9 +3,46 @@\n # Test the graph code\n #\n \n+function fixup_time_info\n+{\n+\tcmd guilt pop\n+\ttouch -a -m -t \"$TOUCH_DATE\" \".git/patches/a,graph/$1\"\n+\tcmd guilt push\n+}\n+\n source \"$REG_DIR/scaffold\"\n \n cmd setup_repo\n \n shouldfail guilt graph\n \n+cmd git checkout -b a,graph master\n+\n+cmd guilt init\n+\n+cmd guilt new a.patch\n+\n+fixup_time_info a.patch\n+cmd guilt graph\n+\n+cmd echo a >> file.txt\n+cmd git add file.txt\n+cmd guilt refresh\n+fixup_time_info a.patch\n+cmd guilt graph\n+\n+# An unrelated file. No deps.\n+cmd guilt new b.patch\n+cmd echo b >> file2.txt\n+cmd git add file2.txt\n+cmd guilt refresh\n+fixup_time_info b.patch\n+cmd guilt graph\n+\n+# An change to an old file. Should add a dependency.\n+cmd guilt new c.patch\n+cmd echo c >> file.txt\n+cmd git add file.txt\n+cmd guilt refresh\n+fixup_time_info c.patch\n+cmd guilt graph\n-- \n1.8.3.1\n"},{"id":"237275","messageId":"1395387126-13681-21-git-send-email-cederp@opera.com","threadId":"36262","inReplyTo":"1395387126-13681-1-git-send-email-cederp@opera.com","subject":"[GUILT 20/28] \"guilt graph\": Handle patch names containing quotes.","fromName":"Per Cederqvist","fromEmail":"cederp@opera.com","sentAt":"2014-03-21T07:31:58Z","receivedAt":"2014-03-21T07:31:58Z","isPatch":false,"sender":{"key":"cederp@opera.com","avatar":"https://gravatar.com/avatar/008fe28caedea0ba34042cd5157705267934f4ba7a9b29fb248ae18ec5b3055e?d=mp&s=160"},"body":"Quote quotes with a backslash in the \"guitl graph\" output.  Otherwise,\nthe \"dot\" file could contain syntax errors.\n\nAdded a test case.\n---\n guilt-graph          |  2 ++\n regression/t-033.out | 22 ++++++++++++++++++++++\n regression/t-033.sh  |  9 +++++++++\n 3 files changed, 33 insertions(+)\n\ndiff --git a/guilt-graph b/guilt-graph\nindex 575f03b..24ab83b 100755\n--- a/guilt-graph\n+++ b/guilt-graph\n@@ -58,6 +58,8 @@ while [ \"$current\" != \"$base\" ]; do\n }\"`\n \t[ -z \"$pname\" ] && pname=\"?\"\n \n+\tpname=\"`printf \\\"%s\\\" $pname|sed 's/\\\"/\\\\\\\\\\\"/g'`\"\n+\n \tdisp \"# checking rev $current\"\n \tdisp \"\t\\\"$current\\\" [label=\\\"$pname\\\"]\"\n \ndiff --git a/regression/t-033.out b/regression/t-033.out\nindex e638d7b..1c28ea9 100644\n--- a/regression/t-033.out\n+++ b/regression/t-033.out\n@@ -63,3 +63,25 @@ digraph G {\n \t\"ff2775f8d1dc753f635830adcc3a067e0b681e2d\" [label=\"a.patch\"]\n \t\"891bc14b5603474c9743fd04f3da888644413dc5\" -> \"ff2775f8d1dc753f635830adcc3a067e0b681e2d\"; // ?\n }\n+% guilt new a-\"better&quicker'-patch.patch\n+% git add file.txt\n+% guilt refresh\n+Patch a-\"better&quicker'-patch.patch refreshed\n+% guilt pop\n+Now at c.patch.\n+% guilt push\n+Applying patch..a-\"better&quicker'-patch.patch\n+Patch applied.\n+% guilt graph\n+digraph G {\n+# checking rev bc7df666a646739eaf559af23cab72f2bfd01f0e\n+\t\"bc7df666a646739eaf559af23cab72f2bfd01f0e\" [label=\"a-\\\"better&quicker'-patch.patch\"]\n+# checking rev 891bc14b5603474c9743fd04f3da888644413dc5\n+\t\"891bc14b5603474c9743fd04f3da888644413dc5\" [label=\"c.patch\"]\n+\t\"bc7df666a646739eaf559af23cab72f2bfd01f0e\" -> \"891bc14b5603474c9743fd04f3da888644413dc5\"; // ?\n+# checking rev c7014443c33d2b0237293687ceb9cbd38313df65\n+\t\"c7014443c33d2b0237293687ceb9cbd38313df65\" [label=\"b.patch\"]\n+# checking rev ff2775f8d1dc753f635830adcc3a067e0b681e2d\n+\t\"ff2775f8d1dc753f635830adcc3a067e0b681e2d\" [label=\"a.patch\"]\n+\t\"891bc14b5603474c9743fd04f3da888644413dc5\" -> \"ff2775f8d1dc753f635830adcc3a067e0b681e2d\"; // ?\n+}\ndiff --git a/regression/t-033.sh b/regression/t-033.sh\nindex 57dce78..968292c 100755\n--- a/regression/t-033.sh\n+++ b/regression/t-033.sh\n@@ -46,3 +46,12 @@ cmd git add file.txt\n cmd guilt refresh\n fixup_time_info c.patch\n cmd guilt graph\n+\n+# A patch name that contains funky characters, including unbalanced\n+# quotes.\n+cmd guilt new \"a-\\\"better&quicker'-patch.patch\"\n+cmd echo d >> file.txt\n+cmd git add file.txt\n+cmd guilt refresh\n+fixup_time_info \"a-\\\"better&quicker'-patch.patch\"\n+cmd guilt graph\n-- \n1.8.3.1\n"},{"id":"237280","messageId":"1395387126-13681-22-git-send-email-cederp@opera.com","threadId":"36262","inReplyTo":"1395387126-13681-1-git-send-email-cederp@opera.com","subject":"[GUILT 21/28] The log.decorate setting should not influence import-commit.","fromName":"Per Cederqvist","fromEmail":"cederp@opera.com","sentAt":"2014-03-21T07:31:59Z","receivedAt":"2014-03-21T07:31:59Z","isPatch":false,"sender":{"key":"cederp@opera.com","avatar":"https://gravatar.com/avatar/008fe28caedea0ba34042cd5157705267934f4ba7a9b29fb248ae18ec5b3055e?d=mp&s=160"},"body":"Use --no-decorate in the call to git log that tries to read the commit\nmessage to produce patch names.  Otherwise, if the user has set\nlog.decorate to short or full, the patch name will be less useful.\n\nModify the t-034.sh test case to demonstrate that this is needed.\n\nSigned-off-by: Per Cederqvist <cederp@opera.com>\n---\n guilt-import-commit  | 2 +-\n regression/t-034.out | 2 ++\n regression/t-034.sh  | 2 ++\n 3 files changed, 5 insertions(+), 1 deletion(-)\n\ndiff --git a/guilt-import-commit b/guilt-import-commit\nindex 6eb2f4e..703f034 100755\n--- a/guilt-import-commit\n+++ b/guilt-import-commit\n@@ -26,7 +26,7 @@ disp \"About to begin conversion...\" >&2\n disp \"Current head: `cat \\\"$GIT_DIR\\\"/refs/heads/\\`git_branch\\``\" >&2\n \n for rev in `git rev-list $rhash`; do\n-\ts=`git log --pretty=oneline -1 $rev | cut -c 42-`\n+\ts=`git log --no-decorate --pretty=oneline -1 $rev | cut -c 42-`\n \n \t# Try to convert the first line of the commit message to a\n \t# valid patch name.\ndiff --git a/regression/t-034.out b/regression/t-034.out\nindex bda4399..5d81bd4 100644\n--- a/regression/t-034.out\n+++ b/regression/t-034.out\n@@ -232,6 +232,7 @@ Date:   Mon Jan 1 00:00:00 2007 +0000\n     \n     Signed-off-by: Commiter Name <commiter@email>\n % guilt init\n+% git config log.decorate short\n % guilt import-commit base..HEAD\n About to begin conversion...\n Current head: 2a8b1889aa5066193bac978e6bf5073ffcfa6541\n@@ -259,6 +260,7 @@ Converting 45e81b51 as the_sequence_.lock-_is_forbidden\n Converting eebb76e9 as the_sequence_-._is_forbidden\n Done.\n Current head: d4850419ccc1146c7169f500725ce504b9774ed0\n+% git config log.decorate no\n % guilt push -a\n Applying patch..the_sequence_-._is_forbidden.patch\n Patch applied.\ndiff --git a/regression/t-034.sh b/regression/t-034.sh\nindex 1055ddb..8179bc7 100755\n--- a/regression/t-034.sh\n+++ b/regression/t-034.sh\n@@ -57,7 +57,9 @@ cmd git log\n \n # Import all the commits to guilt.\n cmd guilt init\n+cmd git config log.decorate short\n cmd guilt import-commit base..HEAD\n+cmd git config log.decorate no\n \n for patch in .git/patches/master/*.patch\n do\n-- \n1.8.3.1\n"},{"id":"237277","messageId":"1395387126-13681-23-git-send-email-cederp@opera.com","threadId":"36262","inReplyTo":"1395387126-13681-1-git-send-email-cederp@opera.com","subject":"[GUILT 22/28] The log.decorate setting should not influence patchbomb.","fromName":"Per Cederqvist","fromEmail":"cederp@opera.com","sentAt":"2014-03-21T07:32:00Z","receivedAt":"2014-03-21T07:32:00Z","isPatch":false,"sender":{"key":"cederp@opera.com","avatar":"https://gravatar.com/avatar/008fe28caedea0ba34042cd5157705267934f4ba7a9b29fb248ae18ec5b3055e?d=mp&s=160"},"body":"Signed-off-by: Per Cederqvist <cederp@opera.com>\n---\n guilt-patchbomb | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/guilt-patchbomb b/guilt-patchbomb\nindex 1231418..164b10c 100755\n--- a/guilt-patchbomb\n+++ b/guilt-patchbomb\n@@ -47,7 +47,7 @@ if [ $? -ne 0 ]; then\n fi\n \n # display the list of commits to be sent as patches\n-git log --pretty=oneline \"$r\" | cut -c 1-8,41- | $pager\n+git log --no-decorate --pretty=oneline \"$r\" | cut -c 1-8,41- | $pager\n \n _disp \"Are these what you want to send? [Y/n] \"\n read n\n-- \n1.8.3.1\n"},{"id":"237284","messageId":"1395387126-13681-24-git-send-email-cederp@opera.com","threadId":"36262","inReplyTo":"1395387126-13681-1-git-send-email-cederp@opera.com","subject":"[GUILT 23/28] The log.decorate setting should not influence guilt rebase.","fromName":"Per Cederqvist","fromEmail":"cederp@opera.com","sentAt":"2014-03-21T07:32:01Z","receivedAt":"2014-03-21T07:32:01Z","isPatch":false,"sender":{"key":"cederp@opera.com","avatar":"https://gravatar.com/avatar/008fe28caedea0ba34042cd5157705267934f4ba7a9b29fb248ae18ec5b3055e?d=mp&s=160"},"body":"Signed-off-by: Per Cederqvist <cederp@opera.com>\n---\n guilt-rebase | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/guilt-rebase b/guilt-rebase\nindex fd28e48..a1714a0 100755\n--- a/guilt-rebase\n+++ b/guilt-rebase\n@@ -66,7 +66,7 @@ pop_all_patches\n git merge --no-commit $upstream > /dev/null 2> /dev/null\n \n disp \"\"\n-log=`git log -1 --pretty=oneline`\n+log=`git log -1 --no-decorate --pretty=oneline`\n disp \"HEAD is now at `echo $log | cut -c 1-7`... `echo \"$log\" | cut -c 41-`\"\n \n #\n-- \n1.8.3.1\n"},{"id":"237279","messageId":"1395387126-13681-25-git-send-email-cederp@opera.com","threadId":"36262","inReplyTo":"1395387126-13681-1-git-send-email-cederp@opera.com","subject":"[GUILT 24/28] disp no longer processes backslashes.","fromName":"Per Cederqvist","fromEmail":"cederp@opera.com","sentAt":"2014-03-21T07:32:02Z","receivedAt":"2014-03-21T07:32:02Z","isPatch":false,"sender":{"key":"cederp@opera.com","avatar":"https://gravatar.com/avatar/008fe28caedea0ba34042cd5157705267934f4ba7a9b29fb248ae18ec5b3055e?d=mp&s=160"},"body":"Only one invocation of \"disp\" or \"_disp\" actually needed backslash\nprocessing.  In quite a few instances, it was wrong to do backslash\nprocessing, as the message contained data derived from the user.\n\nCreated the new function \"disp_e\" that should be used when backslash\nprocessing is required, and changed \"disp\" and \"disp_\" to use printf\ncode %s instead of \"%b\".\n\nSigned-off-by: Per Cederqvist <cederp@opera.com>\n---\n guilt | 17 +++++++++++++----\n 1 file changed, 13 insertions(+), 4 deletions(-)\n\ndiff --git a/guilt b/guilt\nindex ca922aa..36cfd1e 100755\n--- a/guilt\n+++ b/guilt\n@@ -36,15 +36,24 @@ usage()\n \texit 1\n }\n \n-# echo -n is a bashism, use printf instead\n+# Print arguments, but no trailing newline.\n+# (echo -n is a bashism, use printf instead)\n _disp()\n {\n-\tprintf \"%b\" \"$*\"\n+\tprintf \"%s\" \"$*\"\n }\n \n-# echo -e is a bashism, use printf instead\n+# Print arguments.\n+# (echo -E is a bashism, use printf instead)\n disp()\n {\n+\tprintf \"%s\\n\" \"$*\"\n+}\n+\n+# Print arguments, processing backslash sequences.\n+# (echo -e is a bashism, use printf instead)\n+disp_e()\n+{\n \tprintf \"%b\\n\" \"$*\"\n }\n \n@@ -117,7 +126,7 @@ else\n \n \tdisp \"\"\n \tdisp \"Example:\"\n-\tdisp \"\\tguilt push\"\n+\tdisp_e \"\\tguilt push\"\n \n \t# now, let's exit\n \texit 1\n-- \n1.8.3.1\n"},{"id":"237276","messageId":"1395387126-13681-26-git-send-email-cederp@opera.com","threadId":"36262","inReplyTo":"1395387126-13681-1-git-send-email-cederp@opera.com","subject":"[GUILT 25/28] \"guilt push\" now fails when there are no more patches to push.","fromName":"Per Cederqvist","fromEmail":"cederp@opera.com","sentAt":"2014-03-21T07:32:03Z","receivedAt":"2014-03-21T07:32:03Z","isPatch":false,"sender":{"key":"cederp@opera.com","avatar":"https://gravatar.com/avatar/008fe28caedea0ba34042cd5157705267934f4ba7a9b29fb248ae18ec5b3055e?d=mp&s=160"},"body":"This makes it easier to script operations on the entire queue, for\nexample run the test suite on each patch in the queue:\n\n    guilt pop -a;while guilt push; do make test||break; done\n\nThis brings \"guilt push\" in line with the push operation in Mercurial\nQueues (hg qpush), which fails when there are no patches to apply.\n\nUpdated the test suite.\n\n\"guilt push -a\" still does not fail.  (It successfully manages to\nensure that all patches are pushed, even if it did not have to do\nanything to make it so.)\n\nSigned-off-by: Per Cederqvist <cederp@opera.com>\n---\n guilt-push           | 14 ++++-----\n regression/t-020.out | 89 ++++++++++++++++++++++++++++++++++++++++++++++++++++\n regression/t-020.sh  | 13 +++++++-\n 3 files changed, 108 insertions(+), 8 deletions(-)\n\ndiff --git a/guilt-push b/guilt-push\nindex 67687e7..2222350 100755\n--- a/guilt-push\n+++ b/guilt-push\n@@ -55,6 +55,7 @@ fi\n \n patch=\"$1\"\n [ ! -z \"$all\" ] && patch=\"-a\"\n+[ -z \"$patch\" ] && { patch=1; num=t; }\n \n if [ \"$patch\" = \"-a\" ]; then\n \t# we are supposed to push all patches, get the last one out of\n@@ -65,7 +66,7 @@ if [ \"$patch\" = \"-a\" ]; then\n \t\tdie \"There are no patches to push.\"\n \tfi\n elif [ ! -z \"$num\" ]; then\n-\t# we are supposed to pop a set number of patches\n+\t# we are supposed to push a set number of patches\n \n \t[ \"$patch\" -lt 0 ] && die \"Invalid number of patches to push.\"\n \n@@ -78,11 +79,6 @@ elif [ ! -z \"$num\" ]; then\n \t# clamp to minimum\n \t[ $tidx -lt $eidx ] && eidx=$tidx\n \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=`expr $eidx + 1`\n else\n \t# we're supposed to push only up to a patch, make sure the patch is\n \t# in the series\n@@ -109,7 +105,11 @@ if [ \"$sidx\" -gt \"$eidx\" ]; then\n \telse\n \t\tdisp \"File series fully applied, ends at patch `get_series | tail -n 1`\"\n \tfi\n-\texit 0\n+\tif [ -n \"$all\" ]; then\n+\t\texit 0\n+\telse\n+\t\texit 1\n+\tfi\n fi\n \n get_series | sed -n -e \"${sidx},${eidx}p\" | while read p\ndiff --git a/regression/t-020.out b/regression/t-020.out\nindex 7e07efa..23cb9db 100644\n--- a/regression/t-020.out\n+++ b/regression/t-020.out\n@@ -270,6 +270,95 @@ index 0000000..8baef1b\n +++ b/def\n @@ -0,0 +1 @@\n +abc\n+% guilt push\n+File series fully applied, ends at patch mode\n+% guilt push -a\n+File series fully applied, ends at patch mode\n+% list_files\n+d .git/patches\n+d .git/patches/master\n+d .git/refs/patches\n+d .git/refs/patches/master\n+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode\n+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove\n+f 71596bf71b72c2717e1aee378aabefbfa19ab7c8  .git/patches/master/status\n+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add\n+f bacb4aad8a55fe4e7aa58a9ae169990bb764069f  .git/patches/master/series\n+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify\n+r 33633e7a1aa31972f125878baf7807be57b1672d  .git/refs/patches/master/modify\n+r 37d588cc39848368810e88332bd03b083f2ce3ac  .git/refs/patches/master/add\n+r ccd56089d1b5305a9d35617cb7f6f4b06ffa68ba  .git/refs/patches/master/mode\n+r ffb7faa126a6d91bcdd44a494f76b96dd860b8b9  .git/refs/patches/master/remove\n+% git log -p\n+commit ccd56089d1b5305a9d35617cb7f6f4b06ffa68ba\n+Author: Author Name <author@email>\n+Date:   Mon Jan 1 00:00:00 2007 +0000\n+\n+    patch mode\n+\n+diff --git a/def b/def\n+old mode 100644\n+new mode 100755\n+\n+commit ffb7faa126a6d91bcdd44a494f76b96dd860b8b9\n+Author: Author Name <author@email>\n+Date:   Mon Jan 1 00:00:00 2007 +0000\n+\n+    patch remove\n+\n+diff --git a/abd b/abd\n+deleted file mode 100644\n+index fd3896d..0000000\n+--- a/abd\n++++ /dev/null\n+@@ -1 +0,0 @@\n+-öu\u001bØ\u0014½\u0004á\u001aZâñeÏÈE£\u0006\u001fWÀV¼/\u0003U?Ú<|\u0013\u0012¢@6¤8'H¸1G_Í§*·\u0012ðRÒ¤\nªÂ~·\n+\\ No newline at end of file\n+\n+commit 37d588cc39848368810e88332bd03b083f2ce3ac\n+Author: Author Name <author@email>\n+Date:   Mon Jan 1 00:00:00 2007 +0000\n+\n+    patch add\n+\n+diff --git a/abd b/abd\n+new file mode 100644\n+index 0000000..fd3896d\n+--- /dev/null\n++++ b/abd\n+@@ -0,0 +1 @@\n++öu\u001bØ\u0014½\u0004á\u001aZâñeÏÈE£\u0006\u001fWÀV¼/\u0003U?Ú<|\u0013\u0012¢@6¤8'H¸1G_Í§*·\u0012ðRÒ¤\nªÂ~·\n+\\ No newline at end of file\n+\n+commit 33633e7a1aa31972f125878baf7807be57b1672d\n+Author: Author Name <author@email>\n+Date:   Mon Jan 1 00:00:00 2007 +0000\n+\n+    patch modify\n+\n+diff --git a/def b/def\n+index 8baef1b..7d69c2f 100644\n+--- a/def\n++++ b/def\n+@@ -1 +1,2 @@\n+ abc\n++asjhfksad\n+\n+commit d4850419ccc1146c7169f500725ce504b9774ed0\n+Author: Author Name <author@email>\n+Date:   Mon Jan 1 00:00:00 2007 +0000\n+\n+    initial\n+    \n+    Signed-off-by: Commiter Name <commiter@email>\n+\n+diff --git a/def b/def\n+new file mode 100644\n+index 0000000..8baef1b\n+--- /dev/null\n++++ b/def\n+@@ -0,0 +1 @@\n++abc\n % guilt pop --all\n All patches popped.\n % guilt push\ndiff --git a/regression/t-020.sh b/regression/t-020.sh\nindex 906aec6..0f9f85d 100755\n--- a/regression/t-020.sh\n+++ b/regression/t-020.sh\n@@ -26,6 +26,17 @@ guilt series | while read n ; do\n done\n \n #\n+# pushing when there is nothing to push\n+#\n+\n+shouldfail guilt push\n+cmd guilt push -a\n+\n+cmd list_files\n+\n+cmd git log -p\n+\n+#\n # pop all\n #\n cmd guilt pop --all\n@@ -61,7 +72,7 @@ cmd guilt pop --all\n \n npatches=`guilt series | wc -l`\n for n in `_seq -2 $npatches`; do\n-\tif [ $n -ge 0 ]; then\n+\tif [ $n -gt 0 ]; then\n \t\tcmd guilt push -n $n\n \telse\n \t\tshouldfail guilt push -n $n\n-- \n1.8.3.1\n"},{"id":"237274","messageId":"1395387126-13681-27-git-send-email-cederp@opera.com","threadId":"36262","inReplyTo":"1395387126-13681-1-git-send-email-cederp@opera.com","subject":"[GUILT 26/28] \"guilt pop\" now fails when there are no more patches to pop.","fromName":"Per Cederqvist","fromEmail":"cederp@opera.com","sentAt":"2014-03-21T07:32:04Z","receivedAt":"2014-03-21T07:32:04Z","isPatch":false,"sender":{"key":"cederp@opera.com","avatar":"https://gravatar.com/avatar/008fe28caedea0ba34042cd5157705267934f4ba7a9b29fb248ae18ec5b3055e?d=mp&s=160"},"body":"This is analogous to how \"guilt push\" now fails when there are no more\npatches to push.  Like push, the \"--all\" argument still succeeds even\nif there was no need to pop anything.\n\nUpdated the test suite.\n\nSigned-off-by: Per Cederqvist <cederp@opera.com>\n---\n guilt-pop            | 13 +++++++------\n regression/t-021.out |  2 ++\n regression/t-021.sh  |  6 ++++++\n regression/t-061.sh  |  7 ++++++-\n 4 files changed, 21 insertions(+), 7 deletions(-)\n\ndiff --git a/guilt-pop b/guilt-pop\nindex f0e647f..208f868 100755\n--- a/guilt-pop\n+++ b/guilt-pop\n@@ -48,10 +48,16 @@ fi\n \n patch=\"$1\"\n [ ! -z \"$all\" ] && patch=\"-a\"\n+[ -z \"$patch\" ] && { patch=1; num=t; }\n \n if [ ! -s \"$applied\" ]; then\n \tdisp \"No patches applied.\"\n-\texit 0\n+\tif [ \"$patch\" = \"-a\" ]\n+\tthen\n+\t\texit 0\n+\telse\n+\t\texit 1\n+\tfi\n elif [ \"$patch\" = \"-a\" ]; then\n \t# we are supposed to pop all patches\n \n@@ -68,11 +74,6 @@ elif [ ! -z \"$num\" ]; then\n \t# catch underflow\n \t[ $eidx -lt 0 ] && eidx=0\n \t[ $eidx -eq $sidx ] && die \"No patches requested to be removed.\"\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-\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\ndiff --git a/regression/t-021.out b/regression/t-021.out\nindex 9b42d9c..58be12f 100644\n--- a/regression/t-021.out\n+++ b/regression/t-021.out\n@@ -287,6 +287,8 @@ index 0000000..8baef1b\n +++ b/def\n @@ -0,0 +1 @@\n +abc\n+% guilt pop\n+No patches applied.\n % guilt push --all\n Applying patch..modify\n Patch applied.\ndiff --git a/regression/t-021.sh b/regression/t-021.sh\nindex 614e870..e0d2dc1 100755\n--- a/regression/t-021.sh\n+++ b/regression/t-021.sh\n@@ -23,6 +23,12 @@ guilt series | _tac | while read n ; do\n done\n \n #\n+# pop when there is nothing to pop\n+#\n+\n+shouldfail guilt pop\n+\n+#\n # push all\n #\n cmd guilt push --all\ndiff --git a/regression/t-061.sh b/regression/t-061.sh\nindex 1411baa..a9a4fea 100755\n--- a/regression/t-061.sh\n+++ b/regression/t-061.sh\n@@ -48,7 +48,12 @@ cmd list_files\n \n for i in `seq 5`\n do\n-\tcmd guilt pop\n+\tif [ $i -ge 5 ]\n+\tthen\n+\t\tshouldfail guilt pop\n+\telse\n+\t\tcmd guilt pop\n+\tfi\n \tcmd git for-each-ref\n \tcmd guilt push\n \tcmd git for-each-ref\n-- \n1.8.3.1\n"},{"id":"237278","messageId":"1395387126-13681-28-git-send-email-cederp@opera.com","threadId":"36262","inReplyTo":"1395387126-13681-1-git-send-email-cederp@opera.com","subject":"[GUILT 27/28] Minor testsuite fix.","fromName":"Per Cederqvist","fromEmail":"cederp@opera.com","sentAt":"2014-03-21T07:32:05Z","receivedAt":"2014-03-21T07:32:05Z","isPatch":false,"sender":{"key":"cederp@opera.com","avatar":"https://gravatar.com/avatar/008fe28caedea0ba34042cd5157705267934f4ba7a9b29fb248ae18ec5b3055e?d=mp&s=160"},"body":"Fix remove_topic() in t-061.sh so that it doesn't print a git hash.\n\nSigned-off-by: Per Cederqvist <cederp@opera.com>\n---\n regression/t-061.out | 1 -\n regression/t-061.sh  | 2 +-\n 2 files changed, 1 insertion(+), 2 deletions(-)\n\ndiff --git a/regression/t-061.out b/regression/t-061.out\nindex ef0f335..60ad56d 100644\n--- a/regression/t-061.out\n+++ b/regression/t-061.out\n@@ -381,7 +381,6 @@ ccd56089d1b5305a9d35617cb7f6f4b06ffa68ba commit\trefs/patches/master/mode\n ffb7faa126a6d91bcdd44a494f76b96dd860b8b9 commit\trefs/patches/master/remove\n % guilt pop -a\n No patches applied.\n-ccd56089d1b5305a9d35617cb7f6f4b06ffa68ba\n % git checkout guilt/master\n Switched to branch \"guilt/master\"\n % guilt pop -a\ndiff --git a/regression/t-061.sh b/regression/t-061.sh\nindex a9a4fea..b573885 100755\n--- a/regression/t-061.sh\n+++ b/regression/t-061.sh\n@@ -15,7 +15,7 @@ old_style_branch() {\n \n remove_topic() {\n \tcmd guilt pop -a\n-\tif git rev-parse --verify --quiet guilt/master\n+\tif git rev-parse --verify --quiet guilt/master >/dev/null\n \tthen\n \t\tcmd git checkout guilt/master\n \telse\n-- \n1.8.3.1\n"},{"id":"237282","messageId":"1395387126-13681-29-git-send-email-cederp@opera.com","threadId":"36262","inReplyTo":"1395387126-13681-1-git-send-email-cederp@opera.com","subject":"[GUILT 28/28] Added guilt.reusebranch configuration option.","fromName":"Per Cederqvist","fromEmail":"cederp@opera.com","sentAt":"2014-03-21T07:32:06Z","receivedAt":"2014-03-21T07:32:06Z","isPatch":false,"sender":{"key":"cederp@opera.com","avatar":"https://gravatar.com/avatar/008fe28caedea0ba34042cd5157705267934f4ba7a9b29fb248ae18ec5b3055e?d=mp&s=160"},"body":"From: Per Cederqvist <ceder@lysator.liu.se>\n\nWhen the option is true (the default), Guilt does not create a new Git\nbranch when patches are applied.  This way, you can switch between\nGuilt 0.35 and the current version of Guilt with no issues.\n\nAt a future time, maybe a year after Guilt with guilt.reusebranch\nsupport is released, the default should be changed to \"false\" to take\nadvantage of the ability to use a separate Git branch when patches are\napplied.\n\nSigned-off-by: Per Cederqvist <cederp@opera.com>\n---\n guilt                |  29 +++-\n regression/scaffold  |   1 +\n regression/t-062.out | 441 +++++++++++++++++++++++++++++++++++++++++++++++++++\n regression/t-062.sh  | 140 ++++++++++++++++\n 4 files changed, 606 insertions(+), 5 deletions(-)\n create mode 100644 regression/t-062.out\n create mode 100755 regression/t-062.sh\n\ndiff --git a/guilt b/guilt\nindex 36cfd1e..c89d939 100755\n--- a/guilt\n+++ b/guilt\n@@ -850,6 +850,9 @@ guilt_push_diff_context=1\n # default diffstat value: true or false\n DIFFSTAT_DEFAULT=\"false\"\n \n+# default old_style_prefix value: true or false\n+REUSE_BRANCH_DEFAULT=\"true\"\n+\n # Prefix for guilt branches.\n GUILT_PREFIX=guilt/\n \n@@ -861,6 +864,10 @@ GUILT_PREFIX=guilt/\n diffstat=`git config --bool guilt.diffstat`\n [ -z \"$diffstat\" ] && diffstat=$DIFFSTAT_DEFAULT\n \n+# reuse Git branch?\n+reuse_branch=`git config --bool guilt.reusebranch`\n+[ -z \"$reuse_branch\" ] && reuse_branch=$REUSE_BRANCH_DEFAULT\n+\n #\n # The following gets run every time this file is source'd\n #\n@@ -925,13 +932,25 @@ else\n \tdie \"Unsupported operating system: $UNAME_S\"\n fi\n \n-if [ \"$branch\" = \"$raw_git_branch\" ] && [ -n \"`get_top 2>/dev/null`\" ]\n+if [ -n \"`get_top 2>/dev/null`\" ]\n then\n-    # This is for compat with old repositories that still have a\n-    # pushed patch without the new-style branch prefix.\n-    old_style_prefix=true\n+\t# If there is at least one pushed patch, we set\n+\t# old_style_prefix according to how it was pushed.  It is only\n+\t# possible to change the prefix style while no patches are\n+\t# applied.\n+\tif [ \"$branch\" = \"$raw_git_branch\" ]\n+\tthen\n+\t\told_style_prefix=true\n+\telse\n+\t\told_style_prefix=false\n+\tfi\n else\n-    old_style_prefix=false\n+\tif $reuse_branch\n+\tthen\n+\t\told_style_prefix=true\n+\telse\n+\t\told_style_prefix=false\n+\tfi\n fi\n \n _main \"$@\"\ndiff --git a/regression/scaffold b/regression/scaffold\nindex e4d7487..e4d2f35 100644\n--- a/regression/scaffold\n+++ b/regression/scaffold\n@@ -93,6 +93,7 @@ function setup_git_repo\n \tgit config log.date default\n \tgit config log.decorate no\n \tgit config guilt.diffstat false\n+\tgit config guilt.reusebranch false\n }\n \n function setup_guilt_repo\ndiff --git a/regression/t-062.out b/regression/t-062.out\nnew file mode 100644\nindex 0000000..727b436\n--- /dev/null\n+++ b/regression/t-062.out\n@@ -0,0 +1,441 @@\n+% setup_repo\n+% git config guilt.reusebranch true\n+% guilt push -a\n+Applying patch..modify\n+Patch applied.\n+Applying patch..add\n+Patch applied.\n+Applying patch..remove\n+Patch applied.\n+Applying patch..mode\n+Patch applied.\n+% list_files\n+d .git/patches\n+d .git/patches/master\n+d .git/refs/patches\n+d .git/refs/patches/master\n+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode\n+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove\n+f 71596bf71b72c2717e1aee378aabefbfa19ab7c8  .git/patches/master/status\n+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add\n+f bacb4aad8a55fe4e7aa58a9ae169990bb764069f  .git/patches/master/series\n+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify\n+r 33633e7a1aa31972f125878baf7807be57b1672d  .git/refs/patches/master/modify\n+r 37d588cc39848368810e88332bd03b083f2ce3ac  .git/refs/patches/master/add\n+r ccd56089d1b5305a9d35617cb7f6f4b06ffa68ba  .git/refs/patches/master/mode\n+r ffb7faa126a6d91bcdd44a494f76b96dd860b8b9  .git/refs/patches/master/remove\n+% git for-each-ref\n+ccd56089d1b5305a9d35617cb7f6f4b06ffa68ba commit\trefs/heads/master\n+37d588cc39848368810e88332bd03b083f2ce3ac commit\trefs/patches/master/add\n+ccd56089d1b5305a9d35617cb7f6f4b06ffa68ba commit\trefs/patches/master/mode\n+33633e7a1aa31972f125878baf7807be57b1672d commit\trefs/patches/master/modify\n+ffb7faa126a6d91bcdd44a494f76b96dd860b8b9 commit\trefs/patches/master/remove\n+% git for-each-ref\n+ccd56089d1b5305a9d35617cb7f6f4b06ffa68ba commit\trefs/heads/master\n+37d588cc39848368810e88332bd03b083f2ce3ac commit\trefs/patches/master/add\n+ccd56089d1b5305a9d35617cb7f6f4b06ffa68ba commit\trefs/patches/master/mode\n+33633e7a1aa31972f125878baf7807be57b1672d commit\trefs/patches/master/modify\n+ffb7faa126a6d91bcdd44a494f76b96dd860b8b9 commit\trefs/patches/master/remove\n+% list_files\n+d .git/patches\n+d .git/patches/master\n+d .git/refs/patches\n+d .git/refs/patches/master\n+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode\n+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove\n+f 71596bf71b72c2717e1aee378aabefbfa19ab7c8  .git/patches/master/status\n+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add\n+f bacb4aad8a55fe4e7aa58a9ae169990bb764069f  .git/patches/master/series\n+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify\n+r 33633e7a1aa31972f125878baf7807be57b1672d  .git/refs/patches/master/modify\n+r 37d588cc39848368810e88332bd03b083f2ce3ac  .git/refs/patches/master/add\n+r ccd56089d1b5305a9d35617cb7f6f4b06ffa68ba  .git/refs/patches/master/mode\n+r ffb7faa126a6d91bcdd44a494f76b96dd860b8b9  .git/refs/patches/master/remove\n+% guilt pop\n+Now at remove.\n+% git for-each-ref\n+ffb7faa126a6d91bcdd44a494f76b96dd860b8b9 commit\trefs/heads/master\n+37d588cc39848368810e88332bd03b083f2ce3ac commit\trefs/patches/master/add\n+33633e7a1aa31972f125878baf7807be57b1672d commit\trefs/patches/master/modify\n+ffb7faa126a6d91bcdd44a494f76b96dd860b8b9 commit\trefs/patches/master/remove\n+% guilt push\n+Applying patch..mode\n+Patch applied.\n+% git for-each-ref\n+ccd56089d1b5305a9d35617cb7f6f4b06ffa68ba commit\trefs/heads/master\n+37d588cc39848368810e88332bd03b083f2ce3ac commit\trefs/patches/master/add\n+ccd56089d1b5305a9d35617cb7f6f4b06ffa68ba commit\trefs/patches/master/mode\n+33633e7a1aa31972f125878baf7807be57b1672d commit\trefs/patches/master/modify\n+ffb7faa126a6d91bcdd44a494f76b96dd860b8b9 commit\trefs/patches/master/remove\n+% guilt pop\n+Now at remove.\n+% git for-each-ref\n+ffb7faa126a6d91bcdd44a494f76b96dd860b8b9 commit\trefs/heads/master\n+37d588cc39848368810e88332bd03b083f2ce3ac commit\trefs/patches/master/add\n+33633e7a1aa31972f125878baf7807be57b1672d commit\trefs/patches/master/modify\n+ffb7faa126a6d91bcdd44a494f76b96dd860b8b9 commit\trefs/patches/master/remove\n+% guilt pop\n+Now at add.\n+% git for-each-ref\n+37d588cc39848368810e88332bd03b083f2ce3ac commit\trefs/heads/master\n+37d588cc39848368810e88332bd03b083f2ce3ac commit\trefs/patches/master/add\n+33633e7a1aa31972f125878baf7807be57b1672d commit\trefs/patches/master/modify\n+% guilt push\n+Applying patch..remove\n+Patch applied.\n+% git for-each-ref\n+ffb7faa126a6d91bcdd44a494f76b96dd860b8b9 commit\trefs/heads/master\n+37d588cc39848368810e88332bd03b083f2ce3ac commit\trefs/patches/master/add\n+33633e7a1aa31972f125878baf7807be57b1672d commit\trefs/patches/master/modify\n+ffb7faa126a6d91bcdd44a494f76b96dd860b8b9 commit\trefs/patches/master/remove\n+% guilt pop\n+Now at add.\n+% git for-each-ref\n+37d588cc39848368810e88332bd03b083f2ce3ac commit\trefs/heads/master\n+37d588cc39848368810e88332bd03b083f2ce3ac commit\trefs/patches/master/add\n+33633e7a1aa31972f125878baf7807be57b1672d commit\trefs/patches/master/modify\n+% guilt pop\n+Now at modify.\n+% git for-each-ref\n+33633e7a1aa31972f125878baf7807be57b1672d commit\trefs/heads/master\n+33633e7a1aa31972f125878baf7807be57b1672d commit\trefs/patches/master/modify\n+% guilt push\n+Applying patch..add\n+Patch applied.\n+% git for-each-ref\n+37d588cc39848368810e88332bd03b083f2ce3ac commit\trefs/heads/master\n+37d588cc39848368810e88332bd03b083f2ce3ac commit\trefs/patches/master/add\n+33633e7a1aa31972f125878baf7807be57b1672d commit\trefs/patches/master/modify\n+% guilt pop\n+Now at modify.\n+% git for-each-ref\n+33633e7a1aa31972f125878baf7807be57b1672d commit\trefs/heads/master\n+33633e7a1aa31972f125878baf7807be57b1672d commit\trefs/patches/master/modify\n+% guilt pop\n+All patches popped.\n+% git for-each-ref\n+d4850419ccc1146c7169f500725ce504b9774ed0 commit\trefs/heads/master\n+% guilt push\n+Applying patch..modify\n+Patch applied.\n+% git for-each-ref\n+33633e7a1aa31972f125878baf7807be57b1672d commit\trefs/heads/master\n+33633e7a1aa31972f125878baf7807be57b1672d commit\trefs/patches/master/modify\n+% guilt pop\n+All patches popped.\n+% git for-each-ref\n+d4850419ccc1146c7169f500725ce504b9774ed0 commit\trefs/heads/master\n+% guilt pop\n+No patches applied.\n+% git for-each-ref\n+d4850419ccc1146c7169f500725ce504b9774ed0 commit\trefs/heads/master\n+% guilt push\n+Applying patch..modify\n+Patch applied.\n+% git for-each-ref\n+33633e7a1aa31972f125878baf7807be57b1672d commit\trefs/heads/master\n+33633e7a1aa31972f125878baf7807be57b1672d commit\trefs/patches/master/modify\n+% guilt pop\n+All patches popped.\n+% git for-each-ref\n+d4850419ccc1146c7169f500725ce504b9774ed0 commit\trefs/heads/master\n+% guilt push -a\n+Applying patch..modify\n+Patch applied.\n+Applying patch..add\n+Patch applied.\n+Applying patch..remove\n+Patch applied.\n+Applying patch..mode\n+Patch applied.\n+% git for-each-ref\n+ccd56089d1b5305a9d35617cb7f6f4b06ffa68ba commit\trefs/heads/master\n+37d588cc39848368810e88332bd03b083f2ce3ac commit\trefs/patches/master/add\n+ccd56089d1b5305a9d35617cb7f6f4b06ffa68ba commit\trefs/patches/master/mode\n+33633e7a1aa31972f125878baf7807be57b1672d commit\trefs/patches/master/modify\n+ffb7faa126a6d91bcdd44a494f76b96dd860b8b9 commit\trefs/patches/master/remove\n+% guilt pop -a\n+All patches popped.\n+% git for-each-ref\n+d4850419ccc1146c7169f500725ce504b9774ed0 commit\trefs/heads/master\n+% guilt push add\n+Applying patch..modify\n+Patch applied.\n+Applying patch..add\n+Patch applied.\n+% git for-each-ref\n+37d588cc39848368810e88332bd03b083f2ce3ac commit\trefs/heads/master\n+37d588cc39848368810e88332bd03b083f2ce3ac commit\trefs/patches/master/add\n+33633e7a1aa31972f125878baf7807be57b1672d commit\trefs/patches/master/modify\n+% guilt branch topic\n+Switched to branch \"topic\"\n+% git for-each-ref\n+37d588cc39848368810e88332bd03b083f2ce3ac commit\trefs/heads/master\n+37d588cc39848368810e88332bd03b083f2ce3ac commit\trefs/heads/topic\n+37d588cc39848368810e88332bd03b083f2ce3ac commit\trefs/patches/master/add\n+33633e7a1aa31972f125878baf7807be57b1672d commit\trefs/patches/master/modify\n+37d588cc39848368810e88332bd03b083f2ce3ac commit\trefs/patches/topic/add\n+33633e7a1aa31972f125878baf7807be57b1672d commit\trefs/patches/topic/modify\n+% guilt pop -a\n+All patches popped.\n+% guilt push\n+Applying patch..modify\n+Patch applied.\n+% git for-each-ref\n+37d588cc39848368810e88332bd03b083f2ce3ac commit\trefs/heads/master\n+33633e7a1aa31972f125878baf7807be57b1672d commit\trefs/heads/topic\n+37d588cc39848368810e88332bd03b083f2ce3ac commit\trefs/patches/master/add\n+33633e7a1aa31972f125878baf7807be57b1672d commit\trefs/patches/master/modify\n+33633e7a1aa31972f125878baf7807be57b1672d commit\trefs/patches/topic/modify\n+% guilt pop -a\n+All patches popped.\n+% git checkout master\n+Switched to branch \"master\"\n+% guilt pop -a\n+All patches popped.\n+% git branch -d topic\n+Deleted branch topic (was d485041).\n+% rm -r .git/patches/topic\n+% git for-each-ref\n+d4850419ccc1146c7169f500725ce504b9774ed0 commit\trefs/heads/master\n+% list_files\n+d .git/patches\n+d .git/patches/master\n+d .git/refs/patches\n+d .git/refs/patches/master\n+d .git/refs/patches/topic\n+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode\n+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove\n+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add\n+f bacb4aad8a55fe4e7aa58a9ae169990bb764069f  .git/patches/master/series\n+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/status\n+% guilt push -a\n+Applying patch..modify\n+Patch applied.\n+Applying patch..add\n+Patch applied.\n+Applying patch..remove\n+Patch applied.\n+Applying patch..mode\n+Patch applied.\n+% guilt branch topic\n+Switched to branch \"topic\"\n+% git for-each-ref\n+ccd56089d1b5305a9d35617cb7f6f4b06ffa68ba commit\trefs/heads/master\n+ccd56089d1b5305a9d35617cb7f6f4b06ffa68ba commit\trefs/heads/topic\n+37d588cc39848368810e88332bd03b083f2ce3ac commit\trefs/patches/master/add\n+ccd56089d1b5305a9d35617cb7f6f4b06ffa68ba commit\trefs/patches/master/mode\n+33633e7a1aa31972f125878baf7807be57b1672d commit\trefs/patches/master/modify\n+ffb7faa126a6d91bcdd44a494f76b96dd860b8b9 commit\trefs/patches/master/remove\n+37d588cc39848368810e88332bd03b083f2ce3ac commit\trefs/patches/topic/add\n+ccd56089d1b5305a9d35617cb7f6f4b06ffa68ba commit\trefs/patches/topic/mode\n+33633e7a1aa31972f125878baf7807be57b1672d commit\trefs/patches/topic/modify\n+ffb7faa126a6d91bcdd44a494f76b96dd860b8b9 commit\trefs/patches/topic/remove\n+% guilt pop -a\n+All patches popped.\n+% git checkout master\n+Switched to branch \"master\"\n+% guilt pop -a\n+All patches popped.\n+% git branch -d topic\n+Deleted branch topic (was d485041).\n+% rm -r .git/patches/topic\n+% git for-each-ref\n+d4850419ccc1146c7169f500725ce504b9774ed0 commit\trefs/heads/master\n+% list_files\n+d .git/patches\n+d .git/patches/master\n+d .git/refs/patches\n+d .git/refs/patches/master\n+d .git/refs/patches/topic\n+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode\n+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove\n+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add\n+f bacb4aad8a55fe4e7aa58a9ae169990bb764069f  .git/patches/master/series\n+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/status\n+% guilt branch topic\n+Switched to branch \"topic\"\n+% git for-each-ref\n+d4850419ccc1146c7169f500725ce504b9774ed0 commit\trefs/heads/master\n+d4850419ccc1146c7169f500725ce504b9774ed0 commit\trefs/heads/topic\n+% list_files\n+d .git/patches\n+d .git/patches/master\n+d .git/patches/topic\n+d .git/refs/patches\n+d .git/refs/patches/master\n+d .git/refs/patches/topic\n+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode\n+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/topic/mode\n+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove\n+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/topic/remove\n+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add\n+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/topic/add\n+f bacb4aad8a55fe4e7aa58a9ae169990bb764069f  .git/patches/master/series\n+f bacb4aad8a55fe4e7aa58a9ae169990bb764069f  .git/patches/topic/series\n+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify\n+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/topic/modify\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/status\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/topic/status\n+% guilt pop -a\n+No patches applied.\n+% git checkout master\n+Switched to branch \"master\"\n+% guilt pop -a\n+No patches applied.\n+% git branch -d topic\n+Deleted branch topic (was d485041).\n+% rm -r .git/patches/topic\n+% git for-each-ref\n+d4850419ccc1146c7169f500725ce504b9774ed0 commit\trefs/heads/master\n+% list_files\n+d .git/patches\n+d .git/patches/master\n+d .git/refs/patches\n+d .git/refs/patches/master\n+d .git/refs/patches/topic\n+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode\n+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove\n+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add\n+f bacb4aad8a55fe4e7aa58a9ae169990bb764069f  .git/patches/master/series\n+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/status\n+% guilt push -a\n+Applying patch..modify\n+Patch applied.\n+Applying patch..add\n+Patch applied.\n+Applying patch..remove\n+Patch applied.\n+Applying patch..mode\n+Patch applied.\n+% guilt branch topic\n+Switched to branch \"topic\"\n+% git for-each-ref\n+ccd56089d1b5305a9d35617cb7f6f4b06ffa68ba commit\trefs/heads/master\n+ccd56089d1b5305a9d35617cb7f6f4b06ffa68ba commit\trefs/heads/topic\n+37d588cc39848368810e88332bd03b083f2ce3ac commit\trefs/patches/master/add\n+ccd56089d1b5305a9d35617cb7f6f4b06ffa68ba commit\trefs/patches/master/mode\n+33633e7a1aa31972f125878baf7807be57b1672d commit\trefs/patches/master/modify\n+ffb7faa126a6d91bcdd44a494f76b96dd860b8b9 commit\trefs/patches/master/remove\n+37d588cc39848368810e88332bd03b083f2ce3ac commit\trefs/patches/topic/add\n+ccd56089d1b5305a9d35617cb7f6f4b06ffa68ba commit\trefs/patches/topic/mode\n+33633e7a1aa31972f125878baf7807be57b1672d commit\trefs/patches/topic/modify\n+ffb7faa126a6d91bcdd44a494f76b96dd860b8b9 commit\trefs/patches/topic/remove\n+% list_files\n+d .git/patches\n+d .git/patches/master\n+d .git/patches/topic\n+d .git/refs/patches\n+d .git/refs/patches/master\n+d .git/refs/patches/topic\n+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode\n+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/topic/mode\n+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove\n+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/topic/remove\n+f 71596bf71b72c2717e1aee378aabefbfa19ab7c8  .git/patches/master/status\n+f 71596bf71b72c2717e1aee378aabefbfa19ab7c8  .git/patches/topic/status\n+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add\n+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/topic/add\n+f bacb4aad8a55fe4e7aa58a9ae169990bb764069f  .git/patches/master/series\n+f bacb4aad8a55fe4e7aa58a9ae169990bb764069f  .git/patches/topic/series\n+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify\n+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/topic/modify\n+r 33633e7a1aa31972f125878baf7807be57b1672d  .git/refs/patches/master/modify\n+r 33633e7a1aa31972f125878baf7807be57b1672d  .git/refs/patches/topic/modify\n+r 37d588cc39848368810e88332bd03b083f2ce3ac  .git/refs/patches/master/add\n+r 37d588cc39848368810e88332bd03b083f2ce3ac  .git/refs/patches/topic/add\n+r ccd56089d1b5305a9d35617cb7f6f4b06ffa68ba  .git/refs/patches/master/mode\n+r ccd56089d1b5305a9d35617cb7f6f4b06ffa68ba  .git/refs/patches/topic/mode\n+r ffb7faa126a6d91bcdd44a494f76b96dd860b8b9  .git/refs/patches/master/remove\n+r ffb7faa126a6d91bcdd44a494f76b96dd860b8b9  .git/refs/patches/topic/remove\n+% guilt pop -a\n+All patches popped.\n+% git for-each-ref\n+ccd56089d1b5305a9d35617cb7f6f4b06ffa68ba commit\trefs/heads/master\n+d4850419ccc1146c7169f500725ce504b9774ed0 commit\trefs/heads/topic\n+37d588cc39848368810e88332bd03b083f2ce3ac commit\trefs/patches/master/add\n+ccd56089d1b5305a9d35617cb7f6f4b06ffa68ba commit\trefs/patches/master/mode\n+33633e7a1aa31972f125878baf7807be57b1672d commit\trefs/patches/master/modify\n+ffb7faa126a6d91bcdd44a494f76b96dd860b8b9 commit\trefs/patches/master/remove\n+% guilt pop -a\n+No patches applied.\n+% git checkout master\n+Switched to branch \"master\"\n+% guilt pop -a\n+All patches popped.\n+% git branch -d topic\n+Deleted branch topic (was d485041).\n+% rm -r .git/patches/topic\n+% git for-each-ref\n+d4850419ccc1146c7169f500725ce504b9774ed0 commit\trefs/heads/master\n+% list_files\n+d .git/patches\n+d .git/patches/master\n+d .git/refs/patches\n+d .git/refs/patches/master\n+d .git/refs/patches/topic\n+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode\n+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove\n+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add\n+f bacb4aad8a55fe4e7aa58a9ae169990bb764069f  .git/patches/master/series\n+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify\n+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/status\n+% guilt new newpatch\n+% git for-each-ref --format=%(refname)\n+refs/heads/master\n+refs/patches/master/newpatch\n+% guilt pop\n+All patches popped.\n+% guilt push\n+Applying patch..newpatch\n+Patch applied.\n+% git for-each-ref\n+25465dc1687f3833ecbd4e8bca437e522d7026db commit\trefs/heads/master\n+25465dc1687f3833ecbd4e8bca437e522d7026db commit\trefs/patches/master/newpatch\n+% git branch\n+* master\n+% guilt applied\n+newpatch\n+% guilt commit -a\n+% git for-each-ref\n+25465dc1687f3833ecbd4e8bca437e522d7026db commit\trefs/heads/master\n+% git branch\n+* master\n+% guilt push -a\n+Applying patch..modify\n+Patch applied.\n+Applying patch..add\n+Patch applied.\n+Applying patch..remove\n+Patch applied.\n+Applying patch..mode\n+Patch applied.\n+% guilt applied\n+modify\n+add\n+remove\n+mode\n+% git branch\n+* master\n+% git for-each-ref\n+fefbdcef61022d473838926619f31e030dd04fdc commit\trefs/heads/master\n+5effcbeb303e8433935151d8c69f3bf63db1e8ef commit\trefs/patches/master/add\n+fefbdcef61022d473838926619f31e030dd04fdc commit\trefs/patches/master/mode\n+9509f22e2e627756d87b42432931c45955b74234 commit\trefs/patches/master/modify\n+9cbe2fc643b1a9e2179a8738f80424a1c2aa202d commit\trefs/patches/master/remove\n+% guilt commit -n 2\n+% git for-each-ref\n+fefbdcef61022d473838926619f31e030dd04fdc commit\trefs/heads/master\n+fefbdcef61022d473838926619f31e030dd04fdc commit\trefs/patches/master/mode\n+9cbe2fc643b1a9e2179a8738f80424a1c2aa202d commit\trefs/patches/master/remove\n+% git branch\n+* master\n+% guilt commit -n 2\n+% git for-each-ref\n+fefbdcef61022d473838926619f31e030dd04fdc commit\trefs/heads/master\n+% git branch\n+* master\n+% guilt series\ndiff --git a/regression/t-062.sh b/regression/t-062.sh\nnew file mode 100755\nindex 0000000..e5d2e2d\n--- /dev/null\n+++ b/regression/t-062.sh\n@@ -0,0 +1,140 @@\n+#!/bin/bash\n+#\n+# Test the branch-switching upgrade code\n+#\n+\n+source $REG_DIR/scaffold\n+\n+remove_topic() {\n+\tcmd guilt pop -a\n+\tif git rev-parse --verify --quiet guilt/master >/dev/null\n+\tthen\n+\t\tcmd git checkout guilt/master\n+\telse\n+\t\tcmd git checkout master\n+\tfi\n+\tcmd guilt pop -a\n+\tcmd git branch -d $1\n+\tcmd rm -r .git/patches/$1\n+\tcmd git for-each-ref\n+\tcmd list_files\n+}\n+\n+function fixup_time_info\n+{\n+\ttouch -a -m -t \"$TOUCH_DATE\" \".git/patches/master/$1\"\n+}\n+\n+cmd setup_repo\n+\n+cmd git config guilt.reusebranch true\n+\n+cmd guilt push -a\n+cmd list_files\n+cmd git for-each-ref\n+\n+cmd git for-each-ref\n+\n+cmd list_files\n+\n+for i in `seq 5`\n+do\n+\tif [ $i -ge 5 ]\n+\tthen\n+\t\tshouldfail guilt pop\n+\telse\n+\t\tcmd guilt pop\n+\tfi\n+\tcmd git for-each-ref\n+\tcmd guilt push\n+\tcmd git for-each-ref\n+\tcmd guilt pop\n+\tcmd git for-each-ref\n+done\n+\n+# Check that \"pop -a\" does the right thing.\n+cmd guilt push -a\n+\n+cmd git for-each-ref\n+\n+cmd guilt pop -a\n+\n+cmd git for-each-ref\n+\n+# Check that pushing two patches converts the repo to now-style (since\n+# it currently has no patches applied).\n+cmd guilt push add\n+cmd git for-each-ref\n+\n+# Check guilt branch with a few patches applied.\n+cmd guilt branch topic\n+cmd git for-each-ref\n+\n+# Check that the topic branch is converted to new-style.\n+cmd guilt pop -a\n+cmd guilt push\n+cmd git for-each-ref\n+\n+remove_topic topic\n+\n+# Check guilt branch with the full patch series applied.\n+cmd guilt push -a\n+cmd guilt branch topic\n+cmd git for-each-ref\n+\n+remove_topic topic\n+\n+# Check guilt branch with no patches applied.\n+# This gives us a new-style checkout.\n+cmd guilt branch topic\n+cmd git for-each-ref\n+cmd list_files\n+\n+remove_topic topic\n+\n+# Check guilt branch in a new-style directory with all patches\n+# applied.  (Strictly speaking, this test should probably move to a\n+# file devoted to testing \"guilt branch\".)\n+cmd guilt push -a\n+cmd guilt branch topic\n+cmd git for-each-ref\n+cmd list_files\n+cmd guilt pop -a\n+cmd git for-each-ref\n+\n+remove_topic topic\n+\n+# Check that \"guilt new\" does the right thing when no patches are\n+# applied.  (Strictly speaking, this test should maybe move to\n+# t-025.sh).\n+\n+cmd guilt new newpatch\n+cmd git for-each-ref '--format=%(refname)'\n+cmd guilt pop\n+fixup_time_info newpatch\n+cmd guilt push\n+cmd git for-each-ref\n+\n+# Check that \"guilt commit\" does the right thing when committing all\n+# applied patches.  (Strictly speaking, this test should maybe move to\n+# t-030.sh).\n+cmd git branch\n+cmd guilt applied\n+cmd guilt commit -a\n+cmd git for-each-ref\n+cmd git branch\n+\n+# Check that \"guilt commit\" does the right thing when committing only\n+# a few of the applied patches.  (Strictly speaking, this test should\n+# maybe move to t-030.sh).\n+cmd guilt push -a\n+cmd guilt applied\n+cmd git branch\n+cmd git for-each-ref\n+cmd guilt commit -n 2\n+cmd git for-each-ref\n+cmd git branch\n+cmd guilt commit -n 2\n+cmd git for-each-ref\n+cmd git branch\n+cmd guilt series\n-- \n1.8.3.1\n"},{"id":"237300","messageId":"CAPig+cQ8aPSjCzf0AjNQRvtJJ52eaOi=fJNZ8vXdnFoE5vxyAQ@mail.gmail.com","threadId":"36262","inReplyTo":"1395387126-13681-21-git-send-email-cederp@opera.com","subject":"Re: [GUILT 20/28] \"guilt graph\": Handle patch names containing quotes.","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2014-03-21T07:57:37Z","receivedAt":"2014-03-21T07:57:37Z","isPatch":false,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Fri, Mar 21, 2014 at 3:31 AM, Per Cederqvist <cederp@opera.com> wrote:\n> Quote quotes with a backslash in the \"guitl graph\" output.  Otherwise,\n\ns/guitl/guilt/\n\n> the \"dot\" file could contain syntax errors.\n>\n> Added a test case.\n> ---\n>  guilt-graph          |  2 ++\n>  regression/t-033.out | 22 ++++++++++++++++++++++\n>  regression/t-033.sh  |  9 +++++++++\n>  3 files changed, 33 insertions(+)\n>\n> diff --git a/guilt-graph b/guilt-graph\n> index 575f03b..24ab83b 100755\n> --- a/guilt-graph\n> +++ b/guilt-graph\n> @@ -58,6 +58,8 @@ while [ \"$current\" != \"$base\" ]; do\n>  }\"`\n>         [ -z \"$pname\" ] && pname=\"?\"\n>\n> +       pname=\"`printf \\\"%s\\\" $pname|sed 's/\\\"/\\\\\\\\\\\"/g'`\"\n> +\n>         disp \"# checking rev $current\"\n>         disp \"  \\\"$current\\\" [label=\\\"$pname\\\"]\"\n>\n> diff --git a/regression/t-033.out b/regression/t-033.out\n> index e638d7b..1c28ea9 100644\n> --- a/regression/t-033.out\n> +++ b/regression/t-033.out\n> @@ -63,3 +63,25 @@ digraph G {\n>         \"ff2775f8d1dc753f635830adcc3a067e0b681e2d\" [label=\"a.patch\"]\n>         \"891bc14b5603474c9743fd04f3da888644413dc5\" -> \"ff2775f8d1dc753f635830adcc3a067e0b681e2d\"; // ?\n>  }\n> +% guilt new a-\"better&quicker'-patch.patch\n> +% git add file.txt\n> +% guilt refresh\n> +Patch a-\"better&quicker'-patch.patch refreshed\n> +% guilt pop\n> +Now at c.patch.\n> +% guilt push\n> +Applying patch..a-\"better&quicker'-patch.patch\n> +Patch applied.\n> +% guilt graph\n> +digraph G {\n> +# checking rev bc7df666a646739eaf559af23cab72f2bfd01f0e\n> +       \"bc7df666a646739eaf559af23cab72f2bfd01f0e\" [label=\"a-\\\"better&quicker'-patch.patch\"]\n> +# checking rev 891bc14b5603474c9743fd04f3da888644413dc5\n> +       \"891bc14b5603474c9743fd04f3da888644413dc5\" [label=\"c.patch\"]\n> +       \"bc7df666a646739eaf559af23cab72f2bfd01f0e\" -> \"891bc14b5603474c9743fd04f3da888644413dc5\"; // ?\n> +# checking rev c7014443c33d2b0237293687ceb9cbd38313df65\n> +       \"c7014443c33d2b0237293687ceb9cbd38313df65\" [label=\"b.patch\"]\n> +# checking rev ff2775f8d1dc753f635830adcc3a067e0b681e2d\n> +       \"ff2775f8d1dc753f635830adcc3a067e0b681e2d\" [label=\"a.patch\"]\n> +       \"891bc14b5603474c9743fd04f3da888644413dc5\" -> \"ff2775f8d1dc753f635830adcc3a067e0b681e2d\"; // ?\n> +}\n> diff --git a/regression/t-033.sh b/regression/t-033.sh\n> index 57dce78..968292c 100755\n> --- a/regression/t-033.sh\n> +++ b/regression/t-033.sh\n> @@ -46,3 +46,12 @@ cmd git add file.txt\n>  cmd guilt refresh\n>  fixup_time_info c.patch\n>  cmd guilt graph\n> +\n> +# A patch name that contains funky characters, including unbalanced\n> +# quotes.\n> +cmd guilt new \"a-\\\"better&quicker'-patch.patch\"\n> +cmd echo d >> file.txt\n> +cmd git add file.txt\n> +cmd guilt refresh\n> +fixup_time_info \"a-\\\"better&quicker'-patch.patch\"\n> +cmd guilt graph\n> --\n> 1.8.3.1\n>\n> --\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n"},{"id":"237358","messageId":"20140321203917.GP1852@meili.valhalla.31bits.net","threadId":"36262","inReplyTo":"1395387126-13681-1-git-send-email-cederp@opera.com","subject":"Re: [GUILT 00/28] Teach guilt import-commit how create legal patch names, and more","fromName":"Jeff Sipek","fromEmail":"jeffpc@josefsipek.net","sentAt":"2014-03-21T20:39:17Z","receivedAt":"2014-03-21T20:39:17Z","isPatch":false,"sender":{"key":"jeffpc@josefsipek.net","avatar":null},"body":"On Fri, Mar 21, 2014 at 08:31:38AM +0100, Per Cederqvist wrote:\n> I recently found myself sitting on a train with a computer in front of\n> me.  I tried to use \"guilt import-commit\", which seemed to work, but\n> when I tried to \"guilt push\" the commits I had just imported I got\n> some errors.  It turned out that \"guilt import-commit\" had generated\n> invalid patch names.\n> \n> I decided to fix the issue, and write a test case that demonstrated\n> the problem.\n> \n> One thing led to another, and here I am, a few late nights at a hotel\n> and a return trip on the train later, submitting a patch series in 28\n> parts.  Sorry about the number of patches, but this is what happens\n> when you uncover a bug while writing a test case for the bug you\n> uncovered while writing a test case for your original problem.\n\nNo problem.  I prefer large number of patches instead of a big wad that's\nmuch harder to follow.\n\n> The patch series consists of:\n...\n>  - Changed behavior: \"guilt push\" when there is nothing more to push\n>    now uses exit status 1.  This makes it possible to write shell\n>    loops such as \"while guilt push; do make test||break; done\".  Also,\n>    \"guilt pop\" when no patches are applied also uses exit status 1.\n>    (This aligns \"guilt push\" and \"guilt pop\" with how \"hg qpush\" and\n>    \"hg qpop\" has worked for several years.)\n\nSounds fine.\n\n>  - Changed behavior: by default, guilt no longer changes branch when\n>    you push a patch.  You need to do \"git config guilt.reusebranch\n>    false\" to re-enable that.  This patch sets the default value of\n>    guilt.reusebranch to true; it should in my opinion change to false\n>    a year or two after the next release.\n\nProbably a fair thing to do.  I should really make a release soon :/\n\nI'm sending this off before I go through all the patches so you know that\nI've seen this and plan to comment/pull.  It'll probably take a bit to go\nthrough all 28 :)\n\nThanks,\n\nJeff.\n\n-- \nReady; T=0.01/0.01 08:47:23\n"},{"id":"237417","messageId":"20140323170409.GG1661@meili.valhalla.31bits.net","threadId":"36262","inReplyTo":"1395387126-13681-5-git-send-email-cederp@opera.com","subject":"Re: [GUILT 04/28] Allow \"guilt import-commit\" to run from a dir which contains spaces.","fromName":"Jeff Sipek","fromEmail":"jeffpc@josefsipek.net","sentAt":"2014-03-23T17:04:09Z","receivedAt":"2014-03-23T17:04:09Z","isPatch":false,"sender":{"key":"jeffpc@josefsipek.net","avatar":null},"body":"On Fri, Mar 21, 2014 at 08:31:42AM +0100, Per Cederqvist wrote:\n> Signed-off-by: Per Cederqvist <cederp@opera.com>\n> ---\n>  guilt-import-commit | 6 +++---\n>  1 file changed, 3 insertions(+), 3 deletions(-)\n> \n> diff --git a/guilt-import-commit b/guilt-import-commit\n> index 20dcee2..9488ded 100755\n> --- a/guilt-import-commit\n> +++ b/guilt-import-commit\n> @@ -23,7 +23,7 @@ if ! must_commit_first; then\n>  fi\n>  \n>  disp \"About to begin conversion...\" >&2\n> -disp \"Current head: `cat $GIT_DIR/refs/heads/\\`git_branch\\``\" >&2\n> +disp \"Current head: `cat \\\"$GIT_DIR\\\"/refs/heads/\\`git_branch\\``\" >&2\n\nI wonder if it'd be better to use 'git rev-parse' here instead of looking at\nthe refs directly.\n\nIOW,\n\ndisp \"Current head: `git rev-parse \\`git_branch\\``\" >&2\n\nMaybe even $() instead of the inner `` to clean it up some more.\n\nJeff.\n\n>  \n>  for rev in `git rev-list $rhash`; do\n>  \ts=`git log --pretty=oneline -1 $rev | cut -c 42-`\n> @@ -46,7 +46,7 @@ for rev in `git rev-list $rhash`; do\n>  \t\tdo_make_header $rev\n>  \t\techo \"\"\n>  \t\tgit diff --binary $rev^..$rev\n> -\t) > $GUILT_DIR/$branch/$fname\n> +\t) > \"$GUILT_DIR/$branch/$fname\"\n>  \n>  \t# FIXME: grab the GIT_AUTHOR_DATE from the commit object and set the\n>  \t# timestamp on the patch\n> @@ -68,6 +68,6 @@ for rev in `git rev-list $rhash`; do\n>  done\n>  \n>  disp \"Done.\" >&2\n> -disp \"Current head: `cat $GIT_DIR/refs/heads/\\`git_branch\\``\" >&2\n> +disp \"Current head: `cat \\\"$GIT_DIR\\\"/refs/heads/\\`git_branch\\``\" >&2\n>  \n>  }\n> -- \n> 1.8.3.1\n> \n\n-- \nIt used to be said [...] that AIX looks like one space alien discovered\nUnix, and described it to another different space alien who then implemented\nAIX. But their universal translators were broken and they'd had to gesture a\nlot.\n\t\t- Paul Tomblin \n"},{"id":"237418","messageId":"20140323170932.GH1661@meili.valhalla.31bits.net","threadId":"36262","inReplyTo":"1395387126-13681-7-git-send-email-cederp@opera.com","subject":"Re: [GUILT 06/28] Fix and simplify the do_get_patch function.","fromName":"Jeff Sipek","fromEmail":"jeffpc@josefsipek.net","sentAt":"2014-03-23T17:09:33Z","receivedAt":"2014-03-23T17:09:33Z","isPatch":false,"sender":{"key":"jeffpc@josefsipek.net","avatar":null},"body":"On Fri, Mar 21, 2014 at 08:31:44AM +0100, Per Cederqvist wrote:\n> When extracting the patch, we only want the actual patches.  We don't\n> want the \"---\" delimiter.  Simplify the extraction by simply deleting\n> everything before the first \"diff \" line.  (Use sed instead of awk to\n> simplify the code.)\n> \n> Without this patch, \"guilt fold\" and \"guilt push\" sometimes fails if\n> guilt.diffstat is true.\n> \n> Signed-off-by: Per Cederqvist <cederp@opera.com>\n> ---\n>  guilt | 7 +------\n>  1 file changed, 1 insertion(+), 6 deletions(-)\n> \n> diff --git a/guilt b/guilt\n> index 8701481..c59cd0f 100755\n> --- a/guilt\n> +++ b/guilt\n> @@ -332,12 +332,7 @@ do_make_header()\n>  # usage: do_get_patch patchfile\n>  do_get_patch()\n>  {\n> -\tawk '\n> -BEGIN{}\n> -/^(diff |---$|--- )/ {patch = 1}\n> -patch == 1 {print $0}\n> -END{}\n> -' < \"$1\"\n> +\tsed -n '/^diff /,$p' < \"$1\"\n\nSo, the thought behind this mess was to allow minimal patches to work.  The\n'diff' line is *not* required by patch(1)!\n\nIs it a problem if a patch description contains a line that starts with\n'diff '?  (The current code has this issue as well.)\n\nFor the record, this ambiguity is what's on several occasions made me\nconsider splitting the header and the patch into separate files.  Yeah, it'd\nbe messier.  :/\n\n>  }\n>  \n>  # usage: do_get_header patchfile\n> -- \n> 1.8.3.1\n> \n\n-- \nDefenestration n. (formal or joc.):\n  The act of removing Windows from your computer in disgust, usually\n  followed by the installation of Linux or some other Unix-like operating\n  system.\n"},{"id":"237425","messageId":"CAP=KgsSBcsG1kMfyc=MbUDCuC+4W9Boa2Fwf-FSg6XNxaCAt8g@mail.gmail.com","threadId":"36262","inReplyTo":"20140323170409.GG1661@meili.valhalla.31bits.net","subject":"Re: [GUILT 04/28] Allow \"guilt import-commit\" to run from a dir which contains spaces.","fromName":"Per Cederqvist","fromEmail":"cederp@opera.com","sentAt":"2014-03-23T19:57:08Z","receivedAt":"2014-03-23T19:57:08Z","isPatch":false,"sender":{"key":"cederp@opera.com","avatar":"https://gravatar.com/avatar/008fe28caedea0ba34042cd5157705267934f4ba7a9b29fb248ae18ec5b3055e?d=mp&s=160"},"body":"On Sun, Mar 23, 2014 at 6:04 PM, Jeff Sipek <jeffpc@josefsipek.net> wrote:\n\n> On Fri, Mar 21, 2014 at 08:31:42AM +0100, Per Cederqvist wrote:\n>\n>> Signed-off-by: Per Cederqvist <cederp@opera.com>\n>> ---\n>>  guilt-import-commit | 6 +++---\n>>  1 file changed, 3 insertions(+), 3 deletions(-)\n>>\n>> diff --git a/guilt-import-commit b/guilt-import-commit\n>> index 20dcee2..9488ded 100755\n>> --- a/guilt-import-commit\n>> +++ b/guilt-import-commit\n>> @@ -23,7 +23,7 @@ if ! must_commit_first; then\n>>  fi\n>>\n>>  disp \"About to begin conversion...\" >&2\n>> -disp \"Current head: `cat $GIT_DIR/refs/heads/\\`git_branch\\``\" >&2\n>> +disp \"Current head: `cat \\\"$GIT_DIR\\\"/refs/heads/\\`git_branch\\``\" >&2\n>\n> I wonder if it'd be better to use 'git rev-parse' here instead of looking at\n> the refs directly.\n>\n> IOW,\n>\n> disp \"Current head: `git rev-parse \\`git_branch\\``\" >&2\n\nThat is probably a good idea. I only made the minimum change\nrequired to get the test suite to pass.\n\n> Maybe even $() instead of the inner `` to clean it up some more.\n\nYes, given that that construct is already used in several places\nit is apparently portable enough for guilt. (I guess nobody uses\n/bin/sh on Solaris to run guilt. It doesn't support the $(...)\nconstruct.)\n\n> Jeff.\n\n    /ceder\n\n>>\n>>  for rev in `git rev-list $rhash`; do\n>>       s=`git log --pretty=oneline -1 $rev | cut -c 42-`\n>> @@ -46,7 +46,7 @@ for rev in `git rev-list $rhash`; do\n>>               do_make_header $rev\n>>               echo \"\"\n>>               git diff --binary $rev^..$rev\n>> -     ) > $GUILT_DIR/$branch/$fname\n>> +     ) > \"$GUILT_DIR/$branch/$fname\"\n>>\n>>       # FIXME: grab the GIT_AUTHOR_DATE from the commit object and set the\n>>       # timestamp on the patch\n>> @@ -68,6 +68,6 @@ for rev in `git rev-list $rhash`; do\n>>  done\n>>\n>>  disp \"Done.\" >&2\n>> -disp \"Current head: `cat $GIT_DIR/refs/heads/\\`git_branch\\``\" >&2\n>> +disp \"Current head: `cat \\\"$GIT_DIR\\\"/refs/heads/\\`git_branch\\``\" >&2\n>>\n>>  }\n>> --\n>> 1.8.3.1\n>>\n>\n> --\n> It used to be said [...] that AIX looks like one space alien discovered\n> Unix, and described it to another different space alien who then implemented\n> AIX. But their universal translators were broken and they'd had to gesture a\n> lot.\n>                 - Paul Tomblin\n"},{"id":"237426","messageId":"20140323200739.GJ1661@meili.valhalla.31bits.net","threadId":"36262","inReplyTo":"CAP=KgsSBcsG1kMfyc=MbUDCuC+4W9Boa2Fwf-FSg6XNxaCAt8g@mail.gmail.com","subject":"Re: [GUILT 04/28] Allow \"guilt import-commit\" to run from a dir which contains spaces.","fromName":"Jeff Sipek","fromEmail":"jeffpc@josefsipek.net","sentAt":"2014-03-23T20:07:39Z","receivedAt":"2014-03-23T20:07:39Z","isPatch":false,"sender":{"key":"jeffpc@josefsipek.net","avatar":null},"body":"On Sun, Mar 23, 2014 at 08:57:08PM +0100, Per Cederqvist wrote:\n> On Sun, Mar 23, 2014 at 6:04 PM, Jeff Sipek <jeffpc@josefsipek.net> wrote:\n> \n> > On Fri, Mar 21, 2014 at 08:31:42AM +0100, Per Cederqvist wrote:\n> >\n> >> Signed-off-by: Per Cederqvist <cederp@opera.com>\n> >> ---\n> >>  guilt-import-commit | 6 +++---\n> >>  1 file changed, 3 insertions(+), 3 deletions(-)\n> >>\n> >> diff --git a/guilt-import-commit b/guilt-import-commit\n> >> index 20dcee2..9488ded 100755\n> >> --- a/guilt-import-commit\n> >> +++ b/guilt-import-commit\n> >> @@ -23,7 +23,7 @@ if ! must_commit_first; then\n> >>  fi\n> >>\n> >>  disp \"About to begin conversion...\" >&2\n> >> -disp \"Current head: `cat $GIT_DIR/refs/heads/\\`git_branch\\``\" >&2\n> >> +disp \"Current head: `cat \\\"$GIT_DIR\\\"/refs/heads/\\`git_branch\\``\" >&2\n> >\n> > I wonder if it'd be better to use 'git rev-parse' here instead of looking at\n> > the refs directly.\n> >\n> > IOW,\n> >\n> > disp \"Current head: `git rev-parse \\`git_branch\\``\" >&2\n> \n> That is probably a good idea. I only made the minimum change\n> required to get the test suite to pass.\n\nI totally understand.\n\n> > Maybe even $() instead of the inner `` to clean it up some more.\n> \n> Yes, given that that construct is already used in several places\n> it is apparently portable enough for guilt. (I guess nobody uses\n> /bin/sh on Solaris to run guilt. It doesn't support the $(...)\n> construct.)\n\nHrm?  I'm using OpenIndiana (OpenSolaris derivative) and my /bin/sh seems to\nbe a symlink to ksh93.  What version of Solaris are you seeing this behavior\non?\n\nJeff.\n\n-- \nThe reasonable man adapts himself to the world; the unreasonable one\npersists in trying to adapt the world to himself. Therefore all progress\ndepends on the unreasonable man.\n\t\t- George Bernard Shaw\n"},{"id":"237428","messageId":"CAP=KgsQtJb3t1c7qK8reO6nzMJppoV-zooK16ZZcWmCirAr3ew@mail.gmail.com","threadId":"36262","inReplyTo":"20140323170932.GH1661@meili.valhalla.31bits.net","subject":"Re: [GUILT 06/28] Fix and simplify the do_get_patch function.","fromName":"Per Cederqvist","fromEmail":"cederp@opera.com","sentAt":"2014-03-23T21:03:48Z","receivedAt":"2014-03-23T21:03:48Z","isPatch":false,"sender":{"key":"cederp@opera.com","avatar":"https://gravatar.com/avatar/008fe28caedea0ba34042cd5157705267934f4ba7a9b29fb248ae18ec5b3055e?d=mp&s=160"},"body":"On Sun, Mar 23, 2014 at 6:09 PM, Jeff Sipek <jeffpc@josefsipek.net> wrote:\n\n> On Fri, Mar 21, 2014 at 08:31:44AM +0100, Per Cederqvist wrote:\n>> When extracting the patch, we only want the actual patches.  We don't\n>> want the \"---\" delimiter.  Simplify the extraction by simply deleting\n>> everything before the first \"diff \" line.  (Use sed instead of awk to\n>> simplify the code.)\n>>\n>> Without this patch, \"guilt fold\" and \"guilt push\" sometimes fails if\n>> guilt.diffstat is true.\n>>\n>> Signed-off-by: Per Cederqvist <cederp@opera.com>\n>> ---\n>>  guilt | 7 +------\n>>  1 file changed, 1 insertion(+), 6 deletions(-)\n>>\n>> diff --git a/guilt b/guilt\n>> index 8701481..c59cd0f 100755\n>> --- a/guilt\n>> +++ b/guilt\n>> @@ -332,12 +332,7 @@ do_make_header()\n>>  # usage: do_get_patch patchfile\n>>  do_get_patch()\n>>  {\n>> -     awk '\n>> -BEGIN{}\n>> -/^(diff |---$|--- )/ {patch = 1}\n>> -patch == 1 {print $0}\n>> -END{}\n>> -' < \"$1\"\n>> +     sed -n '/^diff /,$p' < \"$1\"\n>\n> So, the thought behind this mess was to allow minimal patches to work.  The\n> 'diff' line is *not* required by patch(1)!\n\nI see. I can see that this is sometimes useful, even though I think\nit is more important that guilt actually works with the patches itself\ncreates.\n\n> Is it a problem if a patch description contains a line that starts with\n> 'diff '?  (The current code has this issue as well.)\n\nYes.\n\n> For the record, this ambiguity is what's on several occasions made me\n> consider splitting the header and the patch into separate files.  Yeah, it'd\n> be messier.  :/\n\nI really like having the header and the patches in the same file. I had\nto solve a similar problem when I wrote my utility for diffing two diff\nfiles (https://git.lysator.liu.se/pdiffdiff). Based on the experience I got\ndoing that, I propose this new do_get_patch function:\n\n# usage: do_get_patch patchfile\ndo_get_patch()\n{\n    awk '\nBEGIN {\n    patchheader = \"\"\n    patch = 0\n}\npatch == 1 {\n    print $0\n    next\n}\n/^(diff |index |=|RCS file:|retrieving revision )/ {\n    patchheader = patchheader $0 \"\\n\"\n    next\n}\n/^(--- |((new|deleted) file|old) mode )/ {\n    printf \"%s\", patchheader\n  -/^(diff |---$|--- )/ {patch = 1}  print $0\n    patch = 1\n}\n{\n    patchheader = \"\"\n}' < \"$1\"\n\n}\n\nThe idea is to collect lines that *might* start the patch in\npatchheader. Once we detect the start of the patch (via a\nline that matches \"--- \" or any of the mode change lines)\nwe print the patcheader and the current line. If we get a\nline that neither looks like a patchheader nor starts a patch,\nwe discard the patcheader. This is the case of a commit\nmessage with a line that starts with \"diff \".\n\nThe function above solves the issue with lines that\nstart with \"diff \" in the commit message.  On the other\nhand, it introduces the same issue for lines that start\nwith for instance \"old mode \".\n\nActually, a smaller change that probably fixes the\nissue with diffstat is to replace\n\n/^(diff |---$|--- )/ {patch = 1}\n\nwitih\n\n/^(diff |--- )/ {patch = 1}\n\nas the problem with the original implementation is that\nthe \"---\\n\" line that starts the diffstat should not start\nthe patch.\n\n    /ceder\n\n>>  }\n>>\n>>  # usage: do_get_header patchfile\n>> --\n>> 1.8.3.1\n>>\n>\n> --\n> Defenestration n. (formal or joc.):\n>   The act of removing Windows from your computer in disgust, usually\n>   followed by the installation of Linux or some other Unix-like operating\n>   system.\n"},{"id":"237429","messageId":"CAP=KgsTVfJ-P9OvpHOHf8kOtf+nZAwY94Dr4FcPDnwr23XP7+Q@mail.gmail.com","threadId":"36262","inReplyTo":"20140323200739.GJ1661@meili.valhalla.31bits.net","subject":"Re: [GUILT 04/28] Allow \"guilt import-commit\" to run from a dir which contains spaces.","fromName":"Per Cederqvist","fromEmail":"cederp@opera.com","sentAt":"2014-03-23T21:13:53Z","receivedAt":"2014-03-23T21:13:53Z","isPatch":false,"sender":{"key":"cederp@opera.com","avatar":"https://gravatar.com/avatar/008fe28caedea0ba34042cd5157705267934f4ba7a9b29fb248ae18ec5b3055e?d=mp&s=160"},"body":"On Sun, Mar 23, 2014 at 9:07 PM, Jeff Sipek <jeffpc@josefsipek.net> wrote:\n> On Sun, Mar 23, 2014 at 08:57:08PM +0100, Per Cederqvist wrote:\n>> On Sun, Mar 23, 2014 at 6:04 PM, Jeff Sipek <jeffpc@josefsipek.net> wrote:\n>>\n>> > On Fri, Mar 21, 2014 at 08:31:42AM +0100, Per Cederqvist wrote:\n>> >\n>> >> Signed-off-by: Per Cederqvist <cederp@opera.com>\n>> >> ---\n>> >>  guilt-import-commit | 6 +++---\n>> >>  1 file changed, 3 insertions(+), 3 deletions(-)\n>> >>\n>> >> diff --git a/guilt-import-commit b/guilt-import-commit\n>> >> index 20dcee2..9488ded 100755\n>> >> --- a/guilt-import-commit\n>> >> +++ b/guilt-import-commit\n>> >> @@ -23,7 +23,7 @@ if ! must_commit_first; then\n>> >>  fi\n>> >>\n>> >>  disp \"About to begin conversion...\" >&2\n>> >> -disp \"Current head: `cat $GIT_DIR/refs/heads/\\`git_branch\\``\" >&2\n>> >> +disp \"Current head: `cat \\\"$GIT_DIR\\\"/refs/heads/\\`git_branch\\``\" >&2\n>> >\n>> > I wonder if it'd be better to use 'git rev-parse' here instead of looking at\n>> > the refs directly.\n>> >\n>> > IOW,\n>> >\n>> > disp \"Current head: `git rev-parse \\`git_branch\\``\" >&2\n>>\n>> That is probably a good idea. I only made the minimum change\n>> required to get the test suite to pass.\n>\n> I totally understand.\n>\n>> > Maybe even $() instead of the inner `` to clean it up some more.\n>>\n>> Yes, given that that construct is already used in several places\n>> it is apparently portable enough for guilt. (I guess nobody uses\n>> /bin/sh on Solaris to run guilt. It doesn't support the $(...)\n>> construct.)\n>\n> Hrm?  I'm using OpenIndiana (OpenSolaris derivative) and my /bin/sh seems to\n> be a symlink to ksh93.  What version of Solaris are you seeing this behavior\n> on?\n\nSolaris 10:\n\nLast login: Sun Mar 23 20:53:28 2014 from c80-217-121-12.\nSun Microsystems Inc.   SunOS 5.10      Generic January 2005\nYou have mail.\n500 ceder@bacon> uname -a\nSunOS bacon 5.10 Generic_147147-26 sun4u sparc SUNW,Sun-Fire-15000\n501 ceder@bacon> /bin/sh\n$ echo `id`\nuid=105(ceder) gid=20105(ceder)\n$ echo $(id)\nsyntax error: `(' unexpected\n\n/bin/sh is a symlink to /sbin/sh.\n\nOn Solaris 10, you are supposed to use /usr/xpg4/bin/sh if you want\na competent standards-compliant shell. /bin/sh is provided as a very\nbackward-compatible shell.\n\n> Jeff.\n\n    /ceder\n> --\n> The reasonable man adapts himself to the world; the unreasonable one\n> persists in trying to adapt the world to himself. Therefore all progress\n> depends on the unreasonable man.\n>                 - George Bernard Shaw\n"},{"id":"240821","messageId":"20140506182738.GI1655@meili.valhalla.31bits.net","threadId":"36262","inReplyTo":"CAP=KgsTVfJ-P9OvpHOHf8kOtf+nZAwY94Dr4FcPDnwr23XP7+Q@mail.gmail.com","subject":"Re: [GUILT 04/28] Allow \"guilt import-commit\" to run from a dir which contains spaces.","fromName":"Jeff Sipek","fromEmail":"jeffpc@josefsipek.net","sentAt":"2014-05-06T18:27:38Z","receivedAt":"2014-05-06T18:27:38Z","isPatch":false,"sender":{"key":"jeffpc@josefsipek.net","avatar":null},"body":"On Sun, Mar 23, 2014 at 10:13:53PM +0100, Per Cederqvist wrote:\n> On Sun, Mar 23, 2014 at 9:07 PM, Jeff Sipek <jeffpc@josefsipek.net> wrote:\n> > On Sun, Mar 23, 2014 at 08:57:08PM +0100, Per Cederqvist wrote:\n> >> On Sun, Mar 23, 2014 at 6:04 PM, Jeff Sipek <jeffpc@josefsipek.net> wrote:\n> >>\n> >> > On Fri, Mar 21, 2014 at 08:31:42AM +0100, Per Cederqvist wrote:\n> >> >\n> >> >> Signed-off-by: Per Cederqvist <cederp@opera.com>\n> >> >> ---\n> >> >>  guilt-import-commit | 6 +++---\n> >> >>  1 file changed, 3 insertions(+), 3 deletions(-)\n> >> >>\n> >> >> diff --git a/guilt-import-commit b/guilt-import-commit\n> >> >> index 20dcee2..9488ded 100755\n> >> >> --- a/guilt-import-commit\n> >> >> +++ b/guilt-import-commit\n> >> >> @@ -23,7 +23,7 @@ if ! must_commit_first; then\n> >> >>  fi\n> >> >>\n> >> >>  disp \"About to begin conversion...\" >&2\n> >> >> -disp \"Current head: `cat $GIT_DIR/refs/heads/\\`git_branch\\``\" >&2\n> >> >> +disp \"Current head: `cat \\\"$GIT_DIR\\\"/refs/heads/\\`git_branch\\``\" >&2\n> >> >\n> >> > I wonder if it'd be better to use 'git rev-parse' here instead of looking at\n> >> > the refs directly.\n> >> >\n> >> > IOW,\n> >> >\n> >> > disp \"Current head: `git rev-parse \\`git_branch\\``\" >&2\n> >>\n> >> That is probably a good idea. I only made the minimum change\n> >> required to get the test suite to pass.\n> >\n> > I totally understand.\n> >\n> >> > Maybe even $() instead of the inner `` to clean it up some more.\n> >>\n> >> Yes, given that that construct is already used in several places\n> >> it is apparently portable enough for guilt. (I guess nobody uses\n> >> /bin/sh on Solaris to run guilt. It doesn't support the $(...)\n> >> construct.)\n> >\n> > Hrm?  I'm using OpenIndiana (OpenSolaris derivative) and my /bin/sh seems to\n> > be a symlink to ksh93.  What version of Solaris are you seeing this behavior\n> > on?\n> \n> Solaris 10:\n> \n> Last login: Sun Mar 23 20:53:28 2014 from c80-217-121-12.\n> Sun Microsystems Inc.   SunOS 5.10      Generic January 2005\n> You have mail.\n> 500 ceder@bacon> uname -a\n> SunOS bacon 5.10 Generic_147147-26 sun4u sparc SUNW,Sun-Fire-15000\n> 501 ceder@bacon> /bin/sh\n> $ echo `id`\n> uid=105(ceder) gid=20105(ceder)\n> $ echo $(id)\n> syntax error: `(' unexpected\n> \n> /bin/sh is a symlink to /sbin/sh.\n> \n> On Solaris 10, you are supposed to use /usr/xpg4/bin/sh if you want\n> a competent standards-compliant shell. /bin/sh is provided as a very\n> backward-compatible shell.\n\nOk, I finally got back to this series...\n\nI'd say let's use the nested ``.\n\nJeff.\n\n-- \nHegh QaQ law'\nquvHa'ghach QaQ puS\n"},{"id":"240819","messageId":"20140506190830.GJ1655@meili.valhalla.31bits.net","threadId":"36262","inReplyTo":"CAP=KgsQtJb3t1c7qK8reO6nzMJppoV-zooK16ZZcWmCirAr3ew@mail.gmail.com","subject":"Re: [GUILT 06/28] Fix and simplify the do_get_patch function.","fromName":"Jeff Sipek","fromEmail":"jeffpc@josefsipek.net","sentAt":"2014-05-06T19:08:30Z","receivedAt":"2014-05-06T19:08:30Z","isPatch":false,"sender":{"key":"jeffpc@josefsipek.net","avatar":null},"body":"On Sun, Mar 23, 2014 at 10:03:48PM +0100, Per Cederqvist wrote:\n> On Sun, Mar 23, 2014 at 6:09 PM, Jeff Sipek <jeffpc@josefsipek.net> wrote:\n> \n> > On Fri, Mar 21, 2014 at 08:31:44AM +0100, Per Cederqvist wrote:\n> >> When extracting the patch, we only want the actual patches.  We don't\n> >> want the \"---\" delimiter.  Simplify the extraction by simply deleting\n> >> everything before the first \"diff \" line.  (Use sed instead of awk to\n> >> simplify the code.)\n> >>\n> >> Without this patch, \"guilt fold\" and \"guilt push\" sometimes fails if\n> >> guilt.diffstat is true.\n\nHrm, I just did a test and guilt-push seems to work with a patch such as:\n\naoeuaoeu\nthis is\n---\nnot a patch!\n---\n foo |    1 +\n 1 files changed, 1 insertions(+), 0 deletions(-)\n\ndiff --git a/foo b/foo\nindex e69de29..203a557 100644\n--- a/foo\n+++ b/foo\n@@ -0,0 +1 @@\n+aoue\n\nWhat sort of thing breaks fold/push?\n\n...\n> >> diff --git a/guilt b/guilt\n> >> index 8701481..c59cd0f 100755\n> >> --- a/guilt\n> >> +++ b/guilt\n> >> @@ -332,12 +332,7 @@ do_make_header()\n> >>  # usage: do_get_patch patchfile\n> >>  do_get_patch()\n> >>  {\n> >> -     awk '\n> >> -BEGIN{}\n> >> -/^(diff |---$|--- )/ {patch = 1}\n> >> -patch == 1 {print $0}\n> >> -END{}\n> >> -' < \"$1\"\n> >> +     sed -n '/^diff /,$p' < \"$1\"\n> >\n> > So, the thought behind this mess was to allow minimal patches to work.  The\n> > 'diff' line is *not* required by patch(1)!\n> \n> I see. I can see that this is sometimes useful, even though I think\n> it is more important that guilt actually works with the patches itself\n> creates.\n\nFair enough.  I'm convinced that we should assume that all patches start\nwith 'diff '.\n\n...\n> I had to solve a similar problem when I wrote my utility for diffing two\n> diff files (https://git.lysator.liu.se/pdiffdiff). Based on the experience\n> I got doing that, I propose this new do_get_patch function:\n...\n> \n> The idea is to collect lines that *might* start the patch in\n> patchheader. Once we detect the start of the patch (via a\n> line that matches \"--- \" or any of the mode change lines)\n> we print the patcheader and the current line. If we get a\n> line that neither looks like a patchheader nor starts a patch,\n> we discard the patcheader. This is the case of a commit\n> message with a line that starts with \"diff \".\n> \n> The function above solves the issue with lines that\n> start with \"diff \" in the commit message.  On the other\n> hand, it introduces the same issue for lines that start\n> with for instance \"old mode \".\n\nHrm.  I'm open to revisiting the get-patch/get-header functions to address\nthe ambiguity issues in the future.\n\n> Actually, a smaller change that probably fixes the\n> issue with diffstat is to replace\n> \n> /^(diff |---$|--- )/ {patch = 1}\n> \n> witih\n> \n> /^(diff |--- )/ {patch = 1}\n> \n> as the problem with the original implementation is that\n> the \"---\\n\" line that starts the diffstat should not start\n> the patch.\n\n(Thinking out loud...) I suppose there are three portions to a patch file...\n\n(1) the description\n(2) optional diffstat\n(3) the patch\n\nYou just convinced me that the patch should start with '^diff '.  Currently,\nthe diffstat begins with '^---$'.  Sadly, the description can contain what\nlooks like the beginning of a diffstat or a patch.  In the case of\ndo_get_patch, we're only interested in the patch, so we can just look for\n'^diff ' (because garbage before the diff itself seems to be ignored by\ngit).  (If we wanted to allow patches without the 'diff ' line, we'd need\n'^(diff |--- )'.)\n\nI feel like I'm missing something.\n\nJeff.\n\n-- \nI'm somewhere between geek and normal.\n\t\t- Linus Torvalds\n"},{"id":"240816","messageId":"20140506194026.GK1655@meili.valhalla.31bits.net","threadId":"36262","inReplyTo":"1395387126-13681-8-git-send-email-cederp@opera.com","subject":"Re: [GUILT 07/28] Added test cases for \"guilt fold\".","fromName":"Jeff Sipek","fromEmail":"jeffpc@josefsipek.net","sentAt":"2014-05-06T19:40:26Z","receivedAt":"2014-05-06T19:40:26Z","isPatch":false,"sender":{"key":"jeffpc@josefsipek.net","avatar":null},"body":"On Fri, Mar 21, 2014 at 08:31:45AM +0100, Per Cederqvist wrote:\n> Test that we can combine any combination of patches with empty and\n> non-empty messages, both with and without guilt.diffstat.  (All\n> patches are empty.)\n\nI feel like we should have *some* content there - most of the time, I care\nmore about the diffs getting folded than the commit message :)\n\n> Signed-off-by: Per Cederqvist <cederp@opera.com>\n> ---\n>  regression/t-035.out | 659 +++++++++++++++++++++++++++++++++++++++++++++++++++\n>  regression/t-035.sh  |  88 +++++++\n>  2 files changed, 747 insertions(+)\n>  create mode 100644 regression/t-035.out\n>  create mode 100755 regression/t-035.sh\n> \n> diff --git a/regression/t-035.out b/regression/t-035.out\n> new file mode 100644\n> index 0000000..04af146\n> --- /dev/null\n> +++ b/regression/t-035.out\n> @@ -0,0 +1,659 @@\n> +% setup_repo\n> +% git config guilt.diffstat true\n> +%% empty + empty (diffstat=true)\n> +% guilt new empty-1\n> +% guilt pop\n> +All patches popped.\n> +% guilt push\n> +Applying patch..empty-1\n> +Patch applied.\n> +% guilt new empty-2\n> +% guilt pop\n> +Now at empty-1.\n> +% guilt push\n> +Applying patch..empty-2\n> +Patch applied.\n> +% guilt pop\n> +Now at empty-1.\n> +% guilt fold empty-2\n> +% guilt pop\n> +All patches popped.\n> +% guilt push\n> +Applying patch..empty-1\n> +Patch applied.\n> +% list_files\n> +d .git/patches\n> +d .git/patches/master\n> +d .git/refs/patches\n> +d .git/refs/patches/master\n> +f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode\n> +f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove\n> +f 4ea806e306f0228a8ef41f186035e7b04097f1f2  .git/patches/master/status\n> +f 7d261b8caad0f161c21daf5de65eeb521ff8c067  .git/patches/master/empty-1\n> +f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add\n> +f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify\n> +f d28d87b88c1e24d637e390dc3603cfa7c1715711  .git/patches/master/series\n> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty-1~\n> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty-2~\n> +r bde3d337af70f36836ad606c800d194006f883b3  .git/refs/patches/master/empty-1\n> +% git log -p\n\nStrictly speaking, git log isn't necessary since list_files prints the\nhashes of each of the files as well as the refs for all the applied patches.\nIf anything mismatches, the hashes will catch it.  I'm ok with keeping the\ngit log here as long as people can't mess up the formatting with git\nconfig/etc.\n\n...\n> diff --git a/regression/t-035.sh b/regression/t-035.sh\n> new file mode 100755\n> index 0000000..aed3ef2\n> --- /dev/null\n> +++ b/regression/t-035.sh\n> @@ -0,0 +1,88 @@\n> +#!/bin/bash\n> +#\n> +# Test the fold code\n> +#\n> +\n> +source \"$REG_DIR/scaffold\"\n> +\n> +cmd setup_repo\n> +\n> +function fixup_time_info\n> +{\n> +\tcmd guilt pop\n> +\ttouch -a -m -t \"$TOUCH_DATE\" \".git/patches/master/$1\"\n> +\tcmd guilt push\n> +}\n> +\n> +function test_fold\n> +{\n> +    using_diffstat=$1\n> +\n> +    cmd git config guilt.diffstat $using_diffstat\n> +\n> +    # Empty message + empty message = empty message.\n> +    echo \"%% empty + empty (diffstat=$using_diffstat)\"\n> +    cmd guilt new empty-1\n> +    fixup_time_info empty-1\n> +    cmd guilt new empty-2\n> +    fixup_time_info empty-2\n> +    cmd guilt pop\n> +    cmd guilt fold empty-2\n> +    fixup_time_info empty-1\n> +    cmd list_files\n> +    cmd git log -p\n> +    cmd guilt pop\n> +    cmd guilt delete -f empty-1\n> +    cmd list_files\n> +\n> +    # Empty message + non-empty message\n> +    echo \"%% empty + non-empty (diffstat=$using_diffstat)\"\n> +    cmd guilt new empty\n> +    fixup_time_info empty\n> +    cmd echo test > a\n\nI see these redirected echos... what are they for?\n\n> +    cmd guilt new -f -s -m \"A commit message.\" non-empty\n> +    fixup_time_info non-empty\n> +    cmd guilt pop\n> +    cmd guilt fold non-empty\n> +    fixup_time_info empty\n> +    cmd list_files\n> +    cmd git log -p\n> +    cmd guilt pop\n> +    cmd guilt delete -f empty\n> +    cmd list_files\n\nMaybe make two helper functions.. one to make a patch with an empty message\nand one to make a patch with a non-empty message.  Then each of these blocks\nwould look a bit cleaner.\n\n\techo \"%% empty + non-empty (diffstat=$using_diffstat)\"\n\tempty_patch empty\n\tnonempty_patch non-empty\n\tcmd guilt pop non-empty\n\tcmd guilt fold non-empty\n\tfixup_time_info empty\n\tcmd list_files\n\tcleanup empty\n\tcmd list_files\n\ncleanup()\n{\n\tguilt pop $1\n\tguilt delete -f $1\n}\n\nEh, it's not as clean as I thought it would be, but I think it's still a\nbit better.  Ok, how about:\n\nfor using_diffstat in true false ; do\n\tfor patcha in empty nonempty ; do\n\t\tfor patchb in empty nonempty ; do\n\t\t\techo \"%% $patcha + $patchb (diffstat=$using_diffstat)\"\n\t\t\t${patcha}_patch $patcha\n\t\t\t${patchb}_patch $patchb\n\t\t\tcmd guilt pop $patchb\n\t\t\tcmd guilt fold $patchb\n\t\t\tfixup_time_info $patcha\n\t\t\tcmd list_files\n\t\t\tcleanup $patcha\n\t\t\tcmd list_files\n\t\tdone\n\tdone\ndone\n\nAha!  That's better, IMO.\n\nAdding the non-empty diff is a matter of another loop, but I'm ok with just\ntesting the headers (for now) :)\n\nJeff.\n\n-- \nI abhor a system designed for the \"user\", if that word is a coded pejorative\nmeaning \"stupid and unsophisticated.\"\n\t\t- Ken Thompson\n"},{"id":"240830","messageId":"20140506195653.GL1655@meili.valhalla.31bits.net","threadId":"36262","inReplyTo":"1395387126-13681-11-git-send-email-cederp@opera.com","subject":"Re: [GUILT 10/28] Run test_failed if the exit status of a test script is bad.","fromName":"Jeff Sipek","fromEmail":"jeffpc@josefsipek.net","sentAt":"2014-05-06T19:56:53Z","receivedAt":"2014-05-06T19:56:53Z","isPatch":false,"sender":{"key":"jeffpc@josefsipek.net","avatar":null},"body":"On Fri, Mar 21, 2014 at 08:31:48AM +0100, Per Cederqvist wrote:\n> There were two problems with the old code:\n> \n>  - Since \"set -e\" is in effect (that is set in scaffold) the run-test\n>    script exited immediately if a t-*.sh script failed.  This is not\n>    nice, as we want the error report that test_failed prints.\n> \n>  - The code ran \"cd -\" between running the t-*.sh script and checking\n>    the exit status, so the exit status was lost.  (Actually, the exit\n>    status was saved in $ERR, but nothing ever looked at $ERR.)\n\nOops :)\n\n> Signed-off-by: Per Cederqvist <cederp@opera.com>\n> ---\n>  regression/run-tests | 11 ++++++++---\n>  1 file changed, 8 insertions(+), 3 deletions(-)\n> \n> diff --git a/regression/run-tests b/regression/run-tests\n> index a10e796..d39f9ef 100755\n> --- a/regression/run-tests\n> +++ b/regression/run-tests\n> @@ -55,11 +55,16 @@ function run_test\n>  \n>  \t# run the test\n>  \tcd \"$REPODIR\" > /dev/null\n> -\t\"$REG_DIR/t-$1.sh\" 2>&1 > \"$LOGFILE\"\n> -\tERR=$?\n> +\tif \"$REG_DIR/t-$1.sh\" 2>&1 > \"$LOGFILE\"\n> +\tthen\n> +\t    ERR=false\n> +\telse\n> +\t    ERR=true\n\nI'm going to comment on this here... Coding style.  Guilt is a bit of a\nhodge-podge of style as my personal style for shell changed over the years\nand various contributors threw in some more.  I need to get better at\nspotting style mismatch during review.  With that said, I have two comments\nabout the above:\n\n(1) I'd put the 'then' on the same line as 'if' but I don't feel strongly\n    enough about this to reject this patch.\n\n(2) Tabs for indentation.  I do feel strongly about this one :)\n\nJeff.\n\n> +\tfi\n> +\n>  \tcd - > /dev/null\n>  \n> -\t[ $? -ne 0 ] && test_failed\n> +\t$ERR && test_failed\n>  \tdiff -u \"t-$1.out\" \"$LOGFILE\" || test_failed\n>  \n>  \techo \"done.\"\n> -- \n> 1.8.3.1\n> \n\n-- \nI'm somewhere between geek and normal.\n\t\t- Linus Torvalds\n"},{"id":"240826","messageId":"20140506195739.GM1655@meili.valhalla.31bits.net","threadId":"36262","inReplyTo":"1395387126-13681-12-git-send-email-cederp@opera.com","subject":"Re: [GUILT 11/28] test suite: remove pointless redirection.","fromName":"Jeff Sipek","fromEmail":"jeffpc@josefsipek.net","sentAt":"2014-05-06T19:57:39Z","receivedAt":"2014-05-06T19:57:39Z","isPatch":false,"sender":{"key":"jeffpc@josefsipek.net","avatar":null},"body":"Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>\n\nOn Fri, Mar 21, 2014 at 08:31:49AM +0100, Per Cederqvist wrote:\n> The shouldfail function already redirects stderr to stdout, so there\n> is no need to do the same in t-028.sh and t-021.sh.\n> \n> Signed-off-by: Per Cederqvist <cederp@opera.com>\n> ---\n>  regression/t-021.sh | 2 +-\n>  regression/t-025.sh | 2 +-\n>  regression/t-028.sh | 2 +-\n>  3 files changed, 3 insertions(+), 3 deletions(-)\n> \n> diff --git a/regression/t-021.sh b/regression/t-021.sh\n> index 6337d7b..614e870 100755\n> --- a/regression/t-021.sh\n> +++ b/regression/t-021.sh\n> @@ -61,7 +61,7 @@ for n in `_seq -2 $npatches`; do\n>  \tif [ $n -gt 0 ]; then\n>  \t\tcmd guilt pop -n $n\n>  \telse\n> -\t\tshouldfail guilt pop -n $n 2>&1\n> +\t\tshouldfail guilt pop -n $n\n>  \tfi\n>  \n>  \tcmd list_files\n> diff --git a/regression/t-025.sh b/regression/t-025.sh\n> index 3824608..985fed4 100755\n> --- a/regression/t-025.sh\n> +++ b/regression/t-025.sh\n> @@ -44,7 +44,7 @@ shouldfail guilt new \"white space\"\n>  cmd list_files\n>  \n>  for pname in prepend mode /abc ./blah ../blah abc/./blah abc/../blah abc/. abc/.. abc/ ; do\n> -\tshouldfail guilt new \"$pname\" 2>&1\n> +\tshouldfail guilt new \"$pname\"\n>  \n>  \tcmd list_files\n>  done\n> diff --git a/regression/t-028.sh b/regression/t-028.sh\n> index 8480100..88e9adb 100755\n> --- a/regression/t-028.sh\n> +++ b/regression/t-028.sh\n> @@ -29,6 +29,6 @@ guilt series | while read n; do\n>  \tcmd guilt header $n\n>  done\n>  \n> -shouldfail guilt header non-existant 2>&1\n> +shouldfail guilt header non-existant\n>  \n>  # FIXME: how do we check that -e works?\n> -- \n> 1.8.3.1\n> \n\n-- \nFailure is not an option,\nIt comes bundled with your Microsoft product.\n"},{"id":"240825","messageId":"20140506201023.GN1655@meili.valhalla.31bits.net","threadId":"36262","inReplyTo":"1395387126-13681-18-git-send-email-cederp@opera.com","subject":"Re: [GUILT 17/28] \"guilt graph\" no longer loops when no patches are applied.","fromName":"Jeff Sipek","fromEmail":"jeffpc@josefsipek.net","sentAt":"2014-05-06T20:10:23Z","receivedAt":"2014-05-06T20:10:23Z","isPatch":false,"sender":{"key":"jeffpc@josefsipek.net","avatar":null},"body":"Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>\n\nOn Fri, Mar 21, 2014 at 08:31:55AM +0100, Per Cederqvist wrote:\n> Give an error message if no patches are applied.  Added a test case\n> that never terminates unless this fix is applied.\n> \n> Signed-off-by: Per Cederqvist <cederp@opera.com>\n> ---\n>  guilt-graph          | 10 ++++++++--\n>  regression/t-033.out |  3 +++\n>  regression/t-033.sh  | 11 +++++++++++\n>  3 files changed, 22 insertions(+), 2 deletions(-)\n>  create mode 100644 regression/t-033.out\n>  create mode 100755 regression/t-033.sh\n> \n> diff --git a/guilt-graph b/guilt-graph\n> index b3469dc..00301d5 100755\n> --- a/guilt-graph\n> +++ b/guilt-graph\n> @@ -17,8 +17,14 @@ fi\n>  \n>  patchname=\"$1\"\n>  \n> -bottom=`git rev-parse refs/patches/$branch/$(head_n 1 < \"$applied\")`\n> -base=`git rev-parse $bottom^`\n> +bottompatch=$(head_n 1 < \"$applied\")\n> +if [ -z \"$bottompatch\" ]\n> +then\n> +\techo \"No patch applied.\" >&2\n> +\texit 1\n> +fi\n> +\n> +base=`git rev-parse \"refs/patches/${branch}/${bottompatch}^\"`\n>  \n>  if [ -z \"$patchname\" ]; then\n>  \ttop=`git rev-parse HEAD`\n> diff --git a/regression/t-033.out b/regression/t-033.out\n> new file mode 100644\n> index 0000000..76613f9\n> --- /dev/null\n> +++ b/regression/t-033.out\n> @@ -0,0 +1,3 @@\n> +% setup_repo\n> +% guilt graph\n> +No patch applied.\n> diff --git a/regression/t-033.sh b/regression/t-033.sh\n> new file mode 100755\n> index 0000000..ae40577\n> --- /dev/null\n> +++ b/regression/t-033.sh\n> @@ -0,0 +1,11 @@\n> +#!/bin/bash\n> +#\n> +# Test the graph code\n> +#\n> +\n> +source \"$REG_DIR/scaffold\"\n> +\n> +cmd setup_repo\n> +\n> +shouldfail guilt graph\n> +\n> -- \n> 1.8.3.1\n> \n\n-- \nYou measure democracy by the freedom it gives its dissidents, not the\nfreedom it gives its assimilated conformists.\n\t\t- Abbie Hoffman\n"},{"id":"240827","messageId":"20140506201310.GO1655@meili.valhalla.31bits.net","threadId":"36262","inReplyTo":"1395387126-13681-19-git-send-email-cederp@opera.com","subject":"Re: [GUILT 18/28] guilt-graph: Handle commas in branch names.","fromName":"Jeff Sipek","fromEmail":"jeffpc@josefsipek.net","sentAt":"2014-05-06T20:13:10Z","receivedAt":"2014-05-06T20:13:10Z","isPatch":false,"sender":{"key":"jeffpc@josefsipek.net","avatar":null},"body":"Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>\n\nOn Fri, Mar 21, 2014 at 08:31:56AM +0100, Per Cederqvist wrote:\n> This fix relies on the fact that git branch names can not contain \":\".\n> \n> Signed-off-by: Per Cederqvist <cederp@opera.com>\n> ---\n>  guilt-graph | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n> \n> diff --git a/guilt-graph b/guilt-graph\n> index 00301d5..575f03b 100755\n> --- a/guilt-graph\n> +++ b/guilt-graph\n> @@ -52,7 +52,7 @@ safebranch=`echo \"$branch\"|sed 's%/%\\\\\\\\/%g'`\n>  while [ \"$current\" != \"$base\" ]; do\n>  \tpname=`git show-ref | sed -n -e \"\n>  /^$current refs\\/patches\\/$safebranch/ {\n> -\ts,^$current refs/patches/$branch/,,\n> +\ts:^$current refs/patches/$branch/::\n>  \tp\n>  \tq\n>  }\"`\n> -- \n> 1.8.3.1\n> \n\n-- \nComputer Science is no more about computers than astronomy is about\ntelescopes.\n\t\t- Edsger Dijkstra\n"},{"id":"240831","messageId":"20140506201547.GP1655@meili.valhalla.31bits.net","threadId":"36262","inReplyTo":"1395387126-13681-20-git-send-email-cederp@opera.com","subject":"Re: [GUILT 19/28] Check that \"guilt graph\" works when working on a branch with a comma.","fromName":"Jeff Sipek","fromEmail":"jeffpc@josefsipek.net","sentAt":"2014-05-06T20:15:48Z","receivedAt":"2014-05-06T20:15:48Z","isPatch":false,"sender":{"key":"jeffpc@josefsipek.net","avatar":null},"body":"On Fri, Mar 21, 2014 at 08:31:57AM +0100, Per Cederqvist wrote:\n> git branch names can contain commas.  Check that \"guilt graph\" works\n> even in that case.\n> \n> Signed-off-by: Per Cederqvist <cederp@opera.com>\n> ---\n>  regression/t-033.out | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++\n>  regression/t-033.sh  | 37 +++++++++++++++++++++++++++++++\n>  2 files changed, 99 insertions(+)\n> \n> diff --git a/regression/t-033.out b/regression/t-033.out\n> index 76613f9..e638d7b 100644\n> --- a/regression/t-033.out\n> +++ b/regression/t-033.out\n> @@ -1,3 +1,65 @@\n>  % setup_repo\n>  % guilt graph\n>  No patch applied.\n> +% git checkout -b a,graph master\n> +Switched to a new branch 'a,graph'\n> +% guilt init\n> +% guilt new a.patch\n> +% guilt pop\n> +All patches popped.\n> +% guilt push\n> +Applying patch..a.patch\n> +Patch applied.\n> +% guilt graph\n> +digraph G {\n> +# checking rev 95275d7c05c6a6176d3941374115b91272877f6c\n> +\t\"95275d7c05c6a6176d3941374115b91272877f6c\" [label=\"a.patch\"]\n> +}\n> +% git add file.txt\n> +% guilt refresh\n> +Patch a.patch refreshed\n> +% guilt pop\n> +All patches popped.\n> +% guilt push\n> +Applying patch..a.patch\n> +Patch applied.\n> +% guilt graph\n> +digraph G {\n> +# checking rev ff2775f8d1dc753f635830adcc3a067e0b681e2d\n> +\t\"ff2775f8d1dc753f635830adcc3a067e0b681e2d\" [label=\"a.patch\"]\n> +}\n> +% guilt new b.patch\n> +% git add file2.txt\n> +% guilt refresh\n> +Patch b.patch refreshed\n> +% guilt pop\n> +Now at a.patch.\n> +% guilt push\n> +Applying patch..b.patch\n> +Patch applied.\n> +% guilt graph\n> +digraph G {\n> +# checking rev c7014443c33d2b0237293687ceb9cbd38313df65\n> +\t\"c7014443c33d2b0237293687ceb9cbd38313df65\" [label=\"b.patch\"]\n> +# checking rev ff2775f8d1dc753f635830adcc3a067e0b681e2d\n> +\t\"ff2775f8d1dc753f635830adcc3a067e0b681e2d\" [label=\"a.patch\"]\n> +}\n> +% guilt new c.patch\n> +% git add file.txt\n> +% guilt refresh\n> +Patch c.patch refreshed\n> +% guilt pop\n> +Now at b.patch.\n> +% guilt push\n> +Applying patch..c.patch\n> +Patch applied.\n> +% guilt graph\n> +digraph G {\n> +# checking rev 891bc14b5603474c9743fd04f3da888644413dc5\n> +\t\"891bc14b5603474c9743fd04f3da888644413dc5\" [label=\"c.patch\"]\n> +# checking rev c7014443c33d2b0237293687ceb9cbd38313df65\n> +\t\"c7014443c33d2b0237293687ceb9cbd38313df65\" [label=\"b.patch\"]\n> +# checking rev ff2775f8d1dc753f635830adcc3a067e0b681e2d\n> +\t\"ff2775f8d1dc753f635830adcc3a067e0b681e2d\" [label=\"a.patch\"]\n> +\t\"891bc14b5603474c9743fd04f3da888644413dc5\" -> \"ff2775f8d1dc753f635830adcc3a067e0b681e2d\"; // ?\n> +}\n> diff --git a/regression/t-033.sh b/regression/t-033.sh\n> index ae40577..57dce78 100755\n> --- a/regression/t-033.sh\n> +++ b/regression/t-033.sh\n> @@ -3,9 +3,46 @@\n>  # Test the graph code\n>  #\n>  \n> +function fixup_time_info\n> +{\n> +\tcmd guilt pop\n> +\ttouch -a -m -t \"$TOUCH_DATE\" \".git/patches/a,graph/$1\"\n> +\tcmd guilt push\n> +}\n> +\n>  source \"$REG_DIR/scaffold\"\n>  \n>  cmd setup_repo\n>  \n\nA comment here to justify this seemingly useless guilt-graph call?  Maybe\nadding one of the '%%' lines between each section.  Otherwise, this looks\ngood.\n\n>  shouldfail guilt graph\n>  \n> +cmd git checkout -b a,graph master\n> +\n> +cmd guilt init\n> +\n> +cmd guilt new a.patch\n> +\n> +fixup_time_info a.patch\n> +cmd guilt graph\n> +\n> +cmd echo a >> file.txt\n> +cmd git add file.txt\n> +cmd guilt refresh\n> +fixup_time_info a.patch\n> +cmd guilt graph\n> +\n> +# An unrelated file. No deps.\n> +cmd guilt new b.patch\n> +cmd echo b >> file2.txt\n> +cmd git add file2.txt\n> +cmd guilt refresh\n> +fixup_time_info b.patch\n> +cmd guilt graph\n> +\n> +# An change to an old file. Should add a dependency.\n> +cmd guilt new c.patch\n> +cmd echo c >> file.txt\n> +cmd git add file.txt\n> +cmd guilt refresh\n> +fixup_time_info c.patch\n> +cmd guilt graph\n> -- \n> 1.8.3.1\n> \n\n-- \nIt used to be said [...] that AIX looks like one space alien discovered\nUnix, and described it to another different space alien who then implemented\nAIX. But their universal translators were broken and they'd had to gesture a\nlot.\n\t\t- Paul Tomblin \n"},{"id":"240832","messageId":"20140506202446.GQ1655@meili.valhalla.31bits.net","threadId":"36262","inReplyTo":"CAPig+cQ8aPSjCzf0AjNQRvtJJ52eaOi=fJNZ8vXdnFoE5vxyAQ@mail.gmail.com","subject":"Re: [GUILT 20/28] \"guilt graph\": Handle patch names containing quotes.","fromName":"Jeff Sipek","fromEmail":"jeffpc@josefsipek.net","sentAt":"2014-05-06T20:24:46Z","receivedAt":"2014-05-06T20:24:46Z","isPatch":false,"sender":{"key":"jeffpc@josefsipek.net","avatar":null},"body":"On Fri, Mar 21, 2014 at 03:57:37AM -0400, Eric Sunshine wrote:\n> On Fri, Mar 21, 2014 at 3:31 AM, Per Cederqvist <cederp@opera.com> wrote:\n> > Quote quotes with a backslash in the \"guitl graph\" output.  Otherwise,\n> \n> s/guitl/guilt/\n\nYep.\n\n> > the \"dot\" file could contain syntax errors.\n> >\n> > Added a test case.\n> > ---\n> >  guilt-graph          |  2 ++\n> >  regression/t-033.out | 22 ++++++++++++++++++++++\n> >  regression/t-033.sh  |  9 +++++++++\n> >  3 files changed, 33 insertions(+)\n> >\n> > diff --git a/guilt-graph b/guilt-graph\n> > index 575f03b..24ab83b 100755\n> > --- a/guilt-graph\n> > +++ b/guilt-graph\n> > @@ -58,6 +58,8 @@ while [ \"$current\" != \"$base\" ]; do\n> >  }\"`\n> >         [ -z \"$pname\" ] && pname=\"?\"\n> >\n> > +       pname=\"`printf \\\"%s\\\" $pname|sed 's/\\\"/\\\\\\\\\\\"/g'`\"\n\nSome of this filtering is getting a bit unwieldy.  I'd add spaces around the\n|.  Do we want to be paranoid and add quotes around $pname?  If not, then it\nlooks good.\n\n> > +\n> >         disp \"# checking rev $current\"\n> >         disp \"  \\\"$current\\\" [label=\\\"$pname\\\"]\"\n> >\n> > diff --git a/regression/t-033.out b/regression/t-033.out\n> > index e638d7b..1c28ea9 100644\n> > --- a/regression/t-033.out\n> > +++ b/regression/t-033.out\n> > @@ -63,3 +63,25 @@ digraph G {\n> >         \"ff2775f8d1dc753f635830adcc3a067e0b681e2d\" [label=\"a.patch\"]\n> >         \"891bc14b5603474c9743fd04f3da888644413dc5\" -> \"ff2775f8d1dc753f635830adcc3a067e0b681e2d\"; // ?\n> >  }\n> > +% guilt new a-\"better&quicker'-patch.patch\n> > +% git add file.txt\n> > +% guilt refresh\n> > +Patch a-\"better&quicker'-patch.patch refreshed\n> > +% guilt pop\n> > +Now at c.patch.\n> > +% guilt push\n> > +Applying patch..a-\"better&quicker'-patch.patch\n> > +Patch applied.\n> > +% guilt graph\n> > +digraph G {\n> > +# checking rev bc7df666a646739eaf559af23cab72f2bfd01f0e\n> > +       \"bc7df666a646739eaf559af23cab72f2bfd01f0e\" [label=\"a-\\\"better&quicker'-patch.patch\"]\n> > +# checking rev 891bc14b5603474c9743fd04f3da888644413dc5\n> > +       \"891bc14b5603474c9743fd04f3da888644413dc5\" [label=\"c.patch\"]\n> > +       \"bc7df666a646739eaf559af23cab72f2bfd01f0e\" -> \"891bc14b5603474c9743fd04f3da888644413dc5\"; // ?\n> > +# checking rev c7014443c33d2b0237293687ceb9cbd38313df65\n> > +       \"c7014443c33d2b0237293687ceb9cbd38313df65\" [label=\"b.patch\"]\n> > +# checking rev ff2775f8d1dc753f635830adcc3a067e0b681e2d\n> > +       \"ff2775f8d1dc753f635830adcc3a067e0b681e2d\" [label=\"a.patch\"]\n> > +       \"891bc14b5603474c9743fd04f3da888644413dc5\" -> \"ff2775f8d1dc753f635830adcc3a067e0b681e2d\"; // ?\n> > +}\n> > diff --git a/regression/t-033.sh b/regression/t-033.sh\n> > index 57dce78..968292c 100755\n> > --- a/regression/t-033.sh\n> > +++ b/regression/t-033.sh\n> > @@ -46,3 +46,12 @@ cmd git add file.txt\n> >  cmd guilt refresh\n> >  fixup_time_info c.patch\n> >  cmd guilt graph\n> > +\n> > +# A patch name that contains funky characters, including unbalanced\n> > +# quotes.\n> > +cmd guilt new \"a-\\\"better&quicker'-patch.patch\"\n> > +cmd echo d >> file.txt\n> > +cmd git add file.txt\n> > +cmd guilt refresh\n> > +fixup_time_info \"a-\\\"better&quicker'-patch.patch\"\n> > +cmd guilt graph\n> > --\n> > 1.8.3.1\n> >\n> > --\n> > To unsubscribe from this list: send the line \"unsubscribe git\" in\n> > the body of a message to majordomo@vger.kernel.org\n> > More majordomo info at  http://vger.kernel.org/majordomo-info.html\n\n-- \nAll parts should go together without forcing.  You must remember that the\nparts you are reassembling were disassembled by you.  Therefore, if you\ncan’t get them together again, there must be a reason.  By all means, do not\nuse a hammer.\n\t\t— IBM Manual, 1925\n"},{"id":"240834","messageId":"20140506204114.GR1655@meili.valhalla.31bits.net","threadId":"36262","inReplyTo":"1395387126-13681-22-git-send-email-cederp@opera.com","subject":"Re: [GUILT 21/28] The log.decorate setting should not influence import-commit.","fromName":"Jeff Sipek","fromEmail":"jeffpc@josefsipek.net","sentAt":"2014-05-06T20:41:14Z","receivedAt":"2014-05-06T20:41:14Z","isPatch":false,"sender":{"key":"jeffpc@josefsipek.net","avatar":null},"body":"Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>\n\nOn Fri, Mar 21, 2014 at 08:31:59AM +0100, Per Cederqvist wrote:\n> Use --no-decorate in the call to git log that tries to read the commit\n> message to produce patch names.  Otherwise, if the user has set\n> log.decorate to short or full, the patch name will be less useful.\n> \n> Modify the t-034.sh test case to demonstrate that this is needed.\n> \n> Signed-off-by: Per Cederqvist <cederp@opera.com>\n> ---\n>  guilt-import-commit  | 2 +-\n>  regression/t-034.out | 2 ++\n>  regression/t-034.sh  | 2 ++\n>  3 files changed, 5 insertions(+), 1 deletion(-)\n> \n> diff --git a/guilt-import-commit b/guilt-import-commit\n> index 6eb2f4e..703f034 100755\n> --- a/guilt-import-commit\n> +++ b/guilt-import-commit\n> @@ -26,7 +26,7 @@ disp \"About to begin conversion...\" >&2\n>  disp \"Current head: `cat \\\"$GIT_DIR\\\"/refs/heads/\\`git_branch\\``\" >&2\n>  \n>  for rev in `git rev-list $rhash`; do\n> -\ts=`git log --pretty=oneline -1 $rev | cut -c 42-`\n> +\ts=`git log --no-decorate --pretty=oneline -1 $rev | cut -c 42-`\n>  \n>  \t# Try to convert the first line of the commit message to a\n>  \t# valid patch name.\n> diff --git a/regression/t-034.out b/regression/t-034.out\n> index bda4399..5d81bd4 100644\n> --- a/regression/t-034.out\n> +++ b/regression/t-034.out\n> @@ -232,6 +232,7 @@ Date:   Mon Jan 1 00:00:00 2007 +0000\n>      \n>      Signed-off-by: Commiter Name <commiter@email>\n>  % guilt init\n> +% git config log.decorate short\n>  % guilt import-commit base..HEAD\n>  About to begin conversion...\n>  Current head: 2a8b1889aa5066193bac978e6bf5073ffcfa6541\n> @@ -259,6 +260,7 @@ Converting 45e81b51 as the_sequence_.lock-_is_forbidden\n>  Converting eebb76e9 as the_sequence_-._is_forbidden\n>  Done.\n>  Current head: d4850419ccc1146c7169f500725ce504b9774ed0\n> +% git config log.decorate no\n>  % guilt push -a\n>  Applying patch..the_sequence_-._is_forbidden.patch\n>  Patch applied.\n> diff --git a/regression/t-034.sh b/regression/t-034.sh\n> index 1055ddb..8179bc7 100755\n> --- a/regression/t-034.sh\n> +++ b/regression/t-034.sh\n> @@ -57,7 +57,9 @@ cmd git log\n>  \n>  # Import all the commits to guilt.\n>  cmd guilt init\n> +cmd git config log.decorate short\n>  cmd guilt import-commit base..HEAD\n> +cmd git config log.decorate no\n>  \n>  for patch in .git/patches/master/*.patch\n>  do\n> -- \n> 1.8.3.1\n> \n\n-- \nEvolution, n.:\n  A hypothetical process whereby infinitely improbable events occur with\n  alarming frequency, order arises from chaos, and no one is given credit.\n"},{"id":"240836","messageId":"20140506204140.GS1655@meili.valhalla.31bits.net","threadId":"36262","inReplyTo":"1395387126-13681-23-git-send-email-cederp@opera.com","subject":"Re: [GUILT 22/28] The log.decorate setting should not influence patchbomb.","fromName":"Jeff Sipek","fromEmail":"jeffpc@josefsipek.net","sentAt":"2014-05-06T20:41:40Z","receivedAt":"2014-05-06T20:41:40Z","isPatch":false,"sender":{"key":"jeffpc@josefsipek.net","avatar":null},"body":"Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>\n\nOn Fri, Mar 21, 2014 at 08:32:00AM +0100, Per Cederqvist wrote:\n> Signed-off-by: Per Cederqvist <cederp@opera.com>\n> ---\n>  guilt-patchbomb | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n> \n> diff --git a/guilt-patchbomb b/guilt-patchbomb\n> index 1231418..164b10c 100755\n> --- a/guilt-patchbomb\n> +++ b/guilt-patchbomb\n> @@ -47,7 +47,7 @@ if [ $? -ne 0 ]; then\n>  fi\n>  \n>  # display the list of commits to be sent as patches\n> -git log --pretty=oneline \"$r\" | cut -c 1-8,41- | $pager\n> +git log --no-decorate --pretty=oneline \"$r\" | cut -c 1-8,41- | $pager\n>  \n>  _disp \"Are these what you want to send? [Y/n] \"\n>  read n\n> -- \n> 1.8.3.1\n> \n\n-- \nReady; T=0.01/0.01 16:41:35\n"},{"id":"240835","messageId":"20140506204159.GT1655@meili.valhalla.31bits.net","threadId":"36262","inReplyTo":"1395387126-13681-24-git-send-email-cederp@opera.com","subject":"Re: [GUILT 23/28] The log.decorate setting should not influence guilt rebase.","fromName":"Jeff Sipek","fromEmail":"jeffpc@josefsipek.net","sentAt":"2014-05-06T20:41:59Z","receivedAt":"2014-05-06T20:41:59Z","isPatch":false,"sender":{"key":"jeffpc@josefsipek.net","avatar":null},"body":"Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>\n\nOn Fri, Mar 21, 2014 at 08:32:01AM +0100, Per Cederqvist wrote:\n> Signed-off-by: Per Cederqvist <cederp@opera.com>\n> ---\n>  guilt-rebase | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n> \n> diff --git a/guilt-rebase b/guilt-rebase\n> index fd28e48..a1714a0 100755\n> --- a/guilt-rebase\n> +++ b/guilt-rebase\n> @@ -66,7 +66,7 @@ pop_all_patches\n>  git merge --no-commit $upstream > /dev/null 2> /dev/null\n>  \n>  disp \"\"\n> -log=`git log -1 --pretty=oneline`\n> +log=`git log -1 --no-decorate --pretty=oneline`\n>  disp \"HEAD is now at `echo $log | cut -c 1-7`... `echo \"$log\" | cut -c 41-`\"\n>  \n>  #\n> -- \n> 1.8.3.1\n> \n\n-- \nDon't drink and derive. Alcohol and algebra don't mix.\n"},{"id":"240953","messageId":"CAP=KgsSTX-z4Z2qqDNtSRUwk9XT0dQ8Do3noesB=UgNRBye-ig@mail.gmail.com","threadId":"36262","inReplyTo":"20140506190830.GJ1655@meili.valhalla.31bits.net","subject":"Re: [GUILT 06/28] Fix and simplify the do_get_patch function.","fromName":"Per Cederqvist","fromEmail":"cederp@opera.com","sentAt":"2014-05-07T20:44:58Z","receivedAt":"2014-05-07T20:44:58Z","isPatch":false,"sender":{"key":"cederp@opera.com","avatar":"https://gravatar.com/avatar/008fe28caedea0ba34042cd5157705267934f4ba7a9b29fb248ae18ec5b3055e?d=mp&s=160"},"body":"n Tue, May 6, 2014 at 9:08 PM, Jeff Sipek <jeffpc@josefsipek.net> wrote:\n> On Sun, Mar 23, 2014 at 10:03:48PM +0100, Per Cederqvist wrote:\n>> On Sun, Mar 23, 2014 at 6:09 PM, Jeff Sipek <jeffpc@josefsipek.net> wrote:\n>>\n>> > On Fri, Mar 21, 2014 at 08:31:44AM +0100, Per Cederqvist wrote:\n>> >> When extracting the patch, we only want the actual patches.  We don't\n>> >> want the \"---\" delimiter.  Simplify the extraction by simply deleting\n>> >> everything before the first \"diff \" line.  (Use sed instead of awk to\n>> >> simplify the code.)\n>> >>\n>> >> Without this patch, \"guilt fold\" and \"guilt push\" sometimes fails if\n>> >> guilt.diffstat is true.\n>\n> Hrm, I just did a test and guilt-push seems to work with a patch such as:\n>\n> aoeuaoeu\n> this is\n> ---\n> not a patch!\n> ---\n>  foo |    1 +\n>  1 files changed, 1 insertions(+), 0 deletions(-)\n>\n> diff --git a/foo b/foo\n> index e69de29..203a557 100644\n> --- a/foo\n> +++ b/foo\n> @@ -0,0 +1 @@\n> +aoue\n>\n> What sort of thing breaks fold/push?\n\nThis sequence breaks:\n\n  mkdir guiltdemo\n  cd guiltdemo\n  git init\n  git commit --allow-empty -mstart\n  guilt init\n  git config guilt.diffstat true\n  guilt new empty-1\n  guilt new empty-2\n  guilt pop\n  guilt fold empty-2\n  guilt pop\n  guilt push\n\nThat is, create two empty patches, fold them together, pop them, and try to push\nthe combined (still empty) patch.\n\nThe last command fails with:\n\n  Applying patch..empty-1\n  fatal: unrecognized input\n  To force apply this patch, use 'guilt push -f'\n\nAt this point, the patch series consists of a single patch, empty-1,\nwhich contains\nthe five characters \"-\", \"-\", \"-\", newline, newline.\n\nThe 06 patch (Added test cases for \"guilt fold\".) contains a test case\nfor this issue.\nWhich opens a style issue. When you fix a bug, should you:\n\n - commit the bug fix first and the test case later, so that \"git bisect\" always\n   finds commits where \"make test\" works, or\n - commit the test case first, and the bug fix later, so that it is more obvious\n   that you are actually fixing a pre-existing bug, or\n - commit the test case and the bug fix in the same commit?\n\nIn this series I have committed bug fixes first and test cases later, but\nI'm not convinced that is the right thing to do.\n\n> ...\n>> >> diff --git a/guilt b/guilt\n>> >> index 8701481..c59cd0f 100755\n>> >> --- a/guilt\n>> >> +++ b/guilt\n>> >> @@ -332,12 +332,7 @@ do_make_header()\n>> >>  # usage: do_get_patch patchfile\n>> >>  do_get_patch()\n>> >>  {\n>> >> -     awk '\n>> >> -BEGIN{}\n>> >> -/^(diff |---$|--- )/ {patch = 1}\n>> >> -patch == 1 {print $0}\n>> >> -END{}\n>> >> -' < \"$1\"\n>> >> +     sed -n '/^diff /,$p' < \"$1\"\n>> >\n>> > So, the thought behind this mess was to allow minimal patches to work.  The\n>> > 'diff' line is *not* required by patch(1)!\n>>\n>> I see. I can see that this is sometimes useful, even though I think\n>> it is more important that guilt actually works with the patches itself\n>> creates.\n>\n> Fair enough.  I'm convinced that we should assume that all patches start\n> with 'diff '.\n>\n> ...\n>> I had to solve a similar problem when I wrote my utility for diffing two\n>> diff files (https://git.lysator.liu.se/pdiffdiff). Based on the experience\n>> I got doing that, I propose this new do_get_patch function:\n> ...\n>>\n>> The idea is to collect lines that *might* start the patch in\n>> patchheader. Once we detect the start of the patch (via a\n>> line that matches \"--- \" or any of the mode change lines)\n>> we print the patcheader and the current line. If we get a\n>> line that neither looks like a patchheader nor starts a patch,\n>> we discard the patcheader. This is the case of a commit\n>> message with a line that starts with \"diff \".\n>>\n>> The function above solves the issue with lines that\n>> start with \"diff \" in the commit message.  On the other\n>> hand, it introduces the same issue for lines that start\n>> with for instance \"old mode \".\n>\n> Hrm.  I'm open to revisiting the get-patch/get-header functions to address\n> the ambiguity issues in the future.\n\nPostponing that for the future seems like a good plan. I think\nthere are three possible ways to deal with the problem.\n\n - Store the commit message, diffstat, and diffs in separate files.\n   I don't like this option, as it would make it a lot less convenient\n   to work with the patch files.\n\n - Add a quoting mechanism, so that you need to write \">diff\" or\n   \">---\" instead of just \"diff\" or \"---\" if you want to include those\n   characters at the start of the line in a commit message.\n\n - Ignore the problem. This is what guilt has done in the past,\n   and I see no reason why it needs to change *in this patch series*.\n\n>> Actually, a smaller change that probably fixes the\n>> issue with diffstat is to replace\n>>\n>> /^(diff |---$|--- )/ {patch = 1}\n>>\n>> witih\n>>\n>> /^(diff |--- )/ {patch = 1}\n>>\n>> as the problem with the original implementation is that\n>> the \"---\\n\" line that starts the diffstat should not start\n>> the patch.\n>\n> (Thinking out loud...) I suppose there are three portions to a patch file...\n>\n> (1) the description\n> (2) optional diffstat\n> (3) the patch\n>\n> You just convinced me that the patch should start with '^diff '.  Currently,\n> the diffstat begins with '^---$'.  Sadly, the description can contain what\n> looks like the beginning of a diffstat or a patch.  In the case of\n> do_get_patch, we're only interested in the patch, so we can just look for\n> '^diff ' (because garbage before the diff itself seems to be ignored by\n> git).  (If we wanted to allow patches without the 'diff ' line, we'd need\n> '^(diff |--- )'.)\n>\n> I feel like I'm missing something.\n>\n> Jeff.\n\nToday, I think the most reasonable thing to do is simply remove the\n\"---$\". After all, we want the patch, not the diffstat + patch.  So this\npatch would look like this:\n\ndiff --git a/guilt b/guilt\nindex 8701481..3fc524e 100755\n--- a/guilt\n+++ b/guilt\n@@ -334,7 +334,7 @@ do_get_patch()\n {\n     awk '\n BEGIN{}\n-/^(diff |---$|--- )/ {patch = 1}\n+/^(diff |--- )/ {patch = 1}\n patch == 1 {print $0}\n END{}\n ' < \"$1\"\n\n    /ceder\n"},{"id":"240963","messageId":"CAP=KgsQ2fvVWZG7OwwWac+tMeWaPTEdSrgFqE5gVfSAqNn-VCQ@mail.gmail.com","threadId":"36262","inReplyTo":"20140506194026.GK1655@meili.valhalla.31bits.net","subject":"Re: [GUILT 07/28] Added test cases for \"guilt fold\".","fromName":"Per Cederqvist","fromEmail":"cederp@opera.com","sentAt":"2014-05-07T20:59:56Z","receivedAt":"2014-05-07T20:59:56Z","isPatch":false,"sender":{"key":"cederp@opera.com","avatar":"https://gravatar.com/avatar/008fe28caedea0ba34042cd5157705267934f4ba7a9b29fb248ae18ec5b3055e?d=mp&s=160"},"body":"On Tue, May 6, 2014 at 9:40 PM, Jeff Sipek <jeffpc@josefsipek.net> wrote:\n> On Fri, Mar 21, 2014 at 08:31:45AM +0100, Per Cederqvist wrote:\n>> Test that we can combine any combination of patches with empty and\n>> non-empty messages, both with and without guilt.diffstat.  (All\n>> patches are empty.)\n>\n> I feel like we should have *some* content there - most of the time, I care\n> more about the diffs getting folded than the commit message :)\n\nI added these tests for a reason: the reproduce a bug in guilt that I found.\n\nI'm afraid that having some content might hide the bug I found. (I'm also\nequally afraid that it might uncover other bugs in guilt, which would delay\nintegration of this patch series. So adding more test cases with content\nis a good thing to do, but maybe not in this patch series.)\n\n>> Signed-off-by: Per Cederqvist <cederp@opera.com>\n>> ---\n>>  regression/t-035.out | 659 +++++++++++++++++++++++++++++++++++++++++++++++++++\n>>  regression/t-035.sh  |  88 +++++++\n>>  2 files changed, 747 insertions(+)\n>>  create mode 100644 regression/t-035.out\n>>  create mode 100755 regression/t-035.sh\n>>\n>> diff --git a/regression/t-035.out b/regression/t-035.out\n>> new file mode 100644\n>> index 0000000..04af146\n>> --- /dev/null\n>> +++ b/regression/t-035.out\n>> @@ -0,0 +1,659 @@\n>> +% setup_repo\n>> +% git config guilt.diffstat true\n>> +%% empty + empty (diffstat=true)\n>> +% guilt new empty-1\n>> +% guilt pop\n>> +All patches popped.\n>> +% guilt push\n>> +Applying patch..empty-1\n>> +Patch applied.\n>> +% guilt new empty-2\n>> +% guilt pop\n>> +Now at empty-1.\n>> +% guilt push\n>> +Applying patch..empty-2\n>> +Patch applied.\n>> +% guilt pop\n>> +Now at empty-1.\n>> +% guilt fold empty-2\n>> +% guilt pop\n>> +All patches popped.\n>> +% guilt push\n>> +Applying patch..empty-1\n>> +Patch applied.\n>> +% list_files\n>> +d .git/patches\n>> +d .git/patches/master\n>> +d .git/refs/patches\n>> +d .git/refs/patches/master\n>> +f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode\n>> +f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove\n>> +f 4ea806e306f0228a8ef41f186035e7b04097f1f2  .git/patches/master/status\n>> +f 7d261b8caad0f161c21daf5de65eeb521ff8c067  .git/patches/master/empty-1\n>> +f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add\n>> +f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify\n>> +f d28d87b88c1e24d637e390dc3603cfa7c1715711  .git/patches/master/series\n>> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty-1~\n>> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/empty-2~\n>> +r bde3d337af70f36836ad606c800d194006f883b3  .git/refs/patches/master/empty-1\n>> +% git log -p\n>\n> Strictly speaking, git log isn't necessary since list_files prints the\n> hashes of each of the files as well as the refs for all the applied patches.\n> If anything mismatches, the hashes will catch it.  I'm ok with keeping the\n> git log here as long as people can't mess up the formatting with git\n> config/etc.\n\nHaving the patches included was very helpful while I developed the\ntest case, but your concern about messing up the formatting is valid.\nI'll remove them.\n\n> ...\n>> diff --git a/regression/t-035.sh b/regression/t-035.sh\n>> new file mode 100755\n>> index 0000000..aed3ef2\n>> --- /dev/null\n>> +++ b/regression/t-035.sh\n>> @@ -0,0 +1,88 @@\n>> +#!/bin/bash\n>> +#\n>> +# Test the fold code\n>> +#\n>> +\n>> +source \"$REG_DIR/scaffold\"\n>> +\n>> +cmd setup_repo\n>> +\n>> +function fixup_time_info\n>> +{\n>> +     cmd guilt pop\n>> +     touch -a -m -t \"$TOUCH_DATE\" \".git/patches/master/$1\"\n>> +     cmd guilt push\n>> +}\n>> +\n>> +function test_fold\n>> +{\n>> +    using_diffstat=$1\n>> +\n>> +    cmd git config guilt.diffstat $using_diffstat\n>> +\n>> +    # Empty message + empty message = empty message.\n>> +    echo \"%% empty + empty (diffstat=$using_diffstat)\"\n>> +    cmd guilt new empty-1\n>> +    fixup_time_info empty-1\n>> +    cmd guilt new empty-2\n>> +    fixup_time_info empty-2\n>> +    cmd guilt pop\n>> +    cmd guilt fold empty-2\n>> +    fixup_time_info empty-1\n>> +    cmd list_files\n>> +    cmd git log -p\n>> +    cmd guilt pop\n>> +    cmd guilt delete -f empty-1\n>> +    cmd list_files\n>> +\n>> +    # Empty message + non-empty message\n>> +    echo \"%% empty + non-empty (diffstat=$using_diffstat)\"\n>> +    cmd guilt new empty\n>> +    fixup_time_info empty\n>> +    cmd echo test > a\n>\n> I see these redirected echos... what are they for?\n\nThe intent was to create files with some content. I was under\nthe impression that the \"guilt new\" on the next line would\ninclude the file, since I use the -f option. Now I see that\nthat is not the case, and I will remove these lines.\n\n>> +    cmd guilt new -f -s -m \"A commit message.\" non-empty\n>> +    fixup_time_info non-empty\n>> +    cmd guilt pop\n>> +    cmd guilt fold non-empty\n>> +    fixup_time_info empty\n>> +    cmd list_files\n>> +    cmd git log -p\n>> +    cmd guilt pop\n>> +    cmd guilt delete -f empty\n>> +    cmd list_files\n>\n> Maybe make two helper functions.. one to make a patch with an empty message\n> and one to make a patch with a non-empty message.  Then each of these blocks\n> would look a bit cleaner.\n>\n>         echo \"%% empty + non-empty (diffstat=$using_diffstat)\"\n>         empty_patch empty\n>         nonempty_patch non-empty\n>         cmd guilt pop non-empty\n>         cmd guilt fold non-empty\n>         fixup_time_info empty\n>         cmd list_files\n>         cleanup empty\n>         cmd list_files\n>\n> cleanup()\n> {\n>         guilt pop $1\n>         guilt delete -f $1\n> }\n>\n> Eh, it's not as clean as I thought it would be, but I think it's still a\n> bit better.  Ok, how about:\n>\n> for using_diffstat in true false ; do\n>         for patcha in empty nonempty ; do\n>                 for patchb in empty nonempty ; do\n>                         echo \"%% $patcha + $patchb (diffstat=$using_diffstat)\"\n>                         ${patcha}_patch $patcha\n>                         ${patchb}_patch $patchb\n>                         cmd guilt pop $patchb\n>                         cmd guilt fold $patchb\n>                         fixup_time_info $patcha\n>                         cmd list_files\n>                         cleanup $patcha\n>                         cmd list_files\n>                 done\n>         done\n> done\n>\n> Aha!  That's better, IMO.\n\nI'll try that and post a version 2 of the series. It might take a few\ndays, though.\n\n> Adding the non-empty diff is a matter of another loop, but I'm ok with just\n> testing the headers (for now) :)\n>\n> Jeff.\n>\n    /ceder\n"},{"id":"240964","messageId":"20140507210601.GA1459@meili.valhalla.31bits.net","threadId":"36262","inReplyTo":"CAP=KgsQ2fvVWZG7OwwWac+tMeWaPTEdSrgFqE5gVfSAqNn-VCQ@mail.gmail.com","subject":"Re: [GUILT 07/28] Added test cases for \"guilt fold\".","fromName":"Jeff Sipek","fromEmail":"jeffpc@josefsipek.net","sentAt":"2014-05-07T21:06:02Z","receivedAt":"2014-05-07T21:06:02Z","isPatch":false,"sender":{"key":"jeffpc@josefsipek.net","avatar":null},"body":"On Wed, May 07, 2014 at 10:59:56PM +0200, Per Cederqvist wrote:\n> On Tue, May 6, 2014 at 9:40 PM, Jeff Sipek <jeffpc@josefsipek.net> wrote:\n> > On Fri, Mar 21, 2014 at 08:31:45AM +0100, Per Cederqvist wrote:\n> >> Test that we can combine any combination of patches with empty and\n> >> non-empty messages, both with and without guilt.diffstat.  (All\n> >> patches are empty.)\n> >\n> > I feel like we should have *some* content there - most of the time, I care\n> > more about the diffs getting folded than the commit message :)\n> \n> I added these tests for a reason: the reproduce a bug in guilt that I found.\n> \n> I'm afraid that having some content might hide the bug I found. (I'm also\n> equally afraid that it might uncover other bugs in guilt, which would delay\n> integration of this patch series. So adding more test cases with content\n> is a good thing to do, but maybe not in this patch series.)\n\nFair enough.  I use guilt-fold all the time and it hasn't lost any of my\ndiffs, so I'm happy to defer this until some point in the future.\n\n...\n> > for using_diffstat in true false ; do\n> >         for patcha in empty nonempty ; do\n> >                 for patchb in empty nonempty ; do\n> >                         echo \"%% $patcha + $patchb (diffstat=$using_diffstat)\"\n> >                         ${patcha}_patch $patcha\n> >                         ${patchb}_patch $patchb\n> >                         cmd guilt pop $patchb\n> >                         cmd guilt fold $patchb\n> >                         fixup_time_info $patcha\n> >                         cmd list_files\n> >                         cleanup $patcha\n> >                         cmd list_files\n> >                 done\n> >         done\n> > done\n> >\n> > Aha!  That's better, IMO.\n> \n> I'll try that and post a version 2 of the series. It might take a few\n> days, though.\n\nNo problem.  I'm still the slower one of the two of us. :/\n\nJeff.\n\n-- \nKeyboard not found!\nPress F1 to enter Setup\n"},{"id":"240965","messageId":"20140507210923.GB1459@meili.valhalla.31bits.net","threadId":"36262","inReplyTo":"1395387126-13681-28-git-send-email-cederp@opera.com","subject":"Re: [GUILT 27/28] Minor testsuite fix.","fromName":"Jeff Sipek","fromEmail":"jeffpc@josefsipek.net","sentAt":"2014-05-07T21:09:23Z","receivedAt":"2014-05-07T21:09:23Z","isPatch":false,"sender":{"key":"jeffpc@josefsipek.net","avatar":null},"body":"Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>\n\nOn Fri, Mar 21, 2014 at 08:32:05AM +0100, Per Cederqvist wrote:\n> Fix remove_topic() in t-061.sh so that it doesn't print a git hash.\n> \n> Signed-off-by: Per Cederqvist <cederp@opera.com>\n> ---\n>  regression/t-061.out | 1 -\n>  regression/t-061.sh  | 2 +-\n>  2 files changed, 1 insertion(+), 2 deletions(-)\n> \n> diff --git a/regression/t-061.out b/regression/t-061.out\n> index ef0f335..60ad56d 100644\n> --- a/regression/t-061.out\n> +++ b/regression/t-061.out\n> @@ -381,7 +381,6 @@ ccd56089d1b5305a9d35617cb7f6f4b06ffa68ba commit\trefs/patches/master/mode\n>  ffb7faa126a6d91bcdd44a494f76b96dd860b8b9 commit\trefs/patches/master/remove\n>  % guilt pop -a\n>  No patches applied.\n> -ccd56089d1b5305a9d35617cb7f6f4b06ffa68ba\n>  % git checkout guilt/master\n>  Switched to branch \"guilt/master\"\n>  % guilt pop -a\n> diff --git a/regression/t-061.sh b/regression/t-061.sh\n> index a9a4fea..b573885 100755\n> --- a/regression/t-061.sh\n> +++ b/regression/t-061.sh\n> @@ -15,7 +15,7 @@ old_style_branch() {\n>  \n>  remove_topic() {\n>  \tcmd guilt pop -a\n> -\tif git rev-parse --verify --quiet guilt/master\n> +\tif git rev-parse --verify --quiet guilt/master >/dev/null\n>  \tthen\n>  \t\tcmd git checkout guilt/master\n>  \telse\n> -- \n> 1.8.3.1\n> \n\n-- \nFact: 12.5% of all statistics are generated randomly.\n"},{"id":"240966","messageId":"20140507211502.GC1459@meili.valhalla.31bits.net","threadId":"36262","inReplyTo":"1395387126-13681-25-git-send-email-cederp@opera.com","subject":"Re: [GUILT 24/28] disp no longer processes backslashes.","fromName":"Jeff Sipek","fromEmail":"jeffpc@josefsipek.net","sentAt":"2014-05-07T21:15:02Z","receivedAt":"2014-05-07T21:15:02Z","isPatch":false,"sender":{"key":"jeffpc@josefsipek.net","avatar":null},"body":"On Fri, Mar 21, 2014 at 08:32:02AM +0100, Per Cederqvist wrote:\n> Only one invocation of \"disp\" or \"_disp\" actually needed backslash\n> processing.  In quite a few instances, it was wrong to do backslash\n> processing, as the message contained data derived from the user.\n> \n> Created the new function \"disp_e\" that should be used when backslash\n> processing is required, and changed \"disp\" and \"disp_\" to use printf\n\ns/disp_/_disp/\n\notherwise LGTM\n\n> code %s instead of \"%b\".\n> \n> Signed-off-by: Per Cederqvist <cederp@opera.com>\n> ---\n>  guilt | 17 +++++++++++++----\n>  1 file changed, 13 insertions(+), 4 deletions(-)\n> \n> diff --git a/guilt b/guilt\n> index ca922aa..36cfd1e 100755\n> --- a/guilt\n> +++ b/guilt\n> @@ -36,15 +36,24 @@ usage()\n>  \texit 1\n>  }\n>  \n> -# echo -n is a bashism, use printf instead\n> +# Print arguments, but no trailing newline.\n> +# (echo -n is a bashism, use printf instead)\n>  _disp()\n>  {\n> -\tprintf \"%b\" \"$*\"\n> +\tprintf \"%s\" \"$*\"\n>  }\n>  \n> -# echo -e is a bashism, use printf instead\n> +# Print arguments.\n> +# (echo -E is a bashism, use printf instead)\n>  disp()\n>  {\n> +\tprintf \"%s\\n\" \"$*\"\n> +}\n> +\n> +# Print arguments, processing backslash sequences.\n> +# (echo -e is a bashism, use printf instead)\n> +disp_e()\n> +{\n>  \tprintf \"%b\\n\" \"$*\"\n>  }\n>  \n> @@ -117,7 +126,7 @@ else\n>  \n>  \tdisp \"\"\n>  \tdisp \"Example:\"\n> -\tdisp \"\\tguilt push\"\n> +\tdisp_e \"\\tguilt push\"\n>  \n>  \t# now, let's exit\n>  \texit 1\n> -- \n> 1.8.3.1\n> \n\n-- \nWe have joy, we have fun, we have Linux on a Sun...\n"},{"id":"240971","messageId":"20140507220427.GD1459@meili.valhalla.31bits.net","threadId":"36262","inReplyTo":"1395387126-13681-26-git-send-email-cederp@opera.com","subject":"Re: [GUILT 25/28] \"guilt push\" now fails when there are no more patches to push.","fromName":"Jeff Sipek","fromEmail":"jeffpc@josefsipek.net","sentAt":"2014-05-07T22:04:27Z","receivedAt":"2014-05-07T22:04:27Z","isPatch":false,"sender":{"key":"jeffpc@josefsipek.net","avatar":null},"body":"On Fri, Mar 21, 2014 at 08:32:03AM +0100, Per Cederqvist wrote:\n> This makes it easier to script operations on the entire queue, for\n> example run the test suite on each patch in the queue:\n> \n>     guilt pop -a;while guilt push; do make test||break; done\n> \n> This brings \"guilt push\" in line with the push operation in Mercurial\n> Queues (hg qpush), which fails when there are no patches to apply.\n> \n> Updated the test suite.\n> \n> \"guilt push -a\" still does not fail.  (It successfully manages to\n> ensure that all patches are pushed, even if it did not have to do\n> anything to make it so.)\n> \n> Signed-off-by: Per Cederqvist <cederp@opera.com>\n> ---\n>  guilt-push           | 14 ++++-----\n>  regression/t-020.out | 89 ++++++++++++++++++++++++++++++++++++++++++++++++++++\n>  regression/t-020.sh  | 13 +++++++-\n>  3 files changed, 108 insertions(+), 8 deletions(-)\n> \n> diff --git a/guilt-push b/guilt-push\n> index 67687e7..2222350 100755\n> --- a/guilt-push\n> +++ b/guilt-push\n> @@ -55,6 +55,7 @@ fi\n>  \n>  patch=\"$1\"\n>  [ ! -z \"$all\" ] && patch=\"-a\"\n> +[ -z \"$patch\" ] && { patch=1; num=t; }\n\nI don't think there's any other place in the repo that does this.  Instead\nyou see a lot of if-then-fi.  To keep it consistent, I'd suggest:\n\nif [ -z \"$patch\" ] ; then\n\tpatch=1\n\tnum=t\nfi\n\nAh, this took me a while to figure out.  The above turns:\n\n$ guilt push\n\ninto \n\n$ guilt push -n 1\n\nI'd throw in a comment.\n\n(Note to self, this file is a huge mess and could use a bit of cleanup.)\n\n> @@ -78,11 +79,6 @@ elif [ ! -z \"$num\" ]; then\n>  \t# clamp to minimum\n>  \t[ $tidx -lt $eidx ] && eidx=$tidx\n>  \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=`expr $eidx + 1`\n>  else\n>  \t# we're supposed to push only up to a patch, make sure the patch is\n>  \t# in the series\n> @@ -109,7 +105,11 @@ if [ \"$sidx\" -gt \"$eidx\" ]; then\n>  \telse\n>  \t\tdisp \"File series fully applied, ends at patch `get_series | tail -n 1`\"\n>  \tfi\n> -\texit 0\n> +\tif [ -n \"$all\" ]; then\n> +\t\texit 0\n> +\telse\n> +\t\texit 1\n> +\tfi\n\nThis changes the output on stdout.  E.g.,\n\n$ guilt pu\n$ guilt pu -n 1\nFile series fully applied, ends at patch crashdump\n\nWith this patch, both will print the message. Right?\n\n>  fi\n>  \n>  get_series | sed -n -e \"${sidx},${eidx}p\" | while read p\n\nJeff.\n"},{"id":"241021","messageId":"CAP=KgsR2CD39XeC+UsPU_Oh2GDBg-WrF=+Q33jhfYvToZz7UwA@mail.gmail.com","threadId":"36262","inReplyTo":"20140507210601.GA1459@meili.valhalla.31bits.net","subject":"Re: [GUILT 07/28] Added test cases for \"guilt fold\".","fromName":"Per Cederqvist","fromEmail":"cederp@opera.com","sentAt":"2014-05-08T19:41:22Z","receivedAt":"2014-05-08T19:41:22Z","isPatch":false,"sender":{"key":"cederp@opera.com","avatar":"https://gravatar.com/avatar/008fe28caedea0ba34042cd5157705267934f4ba7a9b29fb248ae18ec5b3055e?d=mp&s=160"},"body":"On Wed, May 7, 2014 at 11:06 PM, Jeff Sipek <jeffpc@josefsipek.net> wrote:\n> On Wed, May 07, 2014 at 10:59:56PM +0200, Per Cederqvist wrote:\n>> On Tue, May 6, 2014 at 9:40 PM, Jeff Sipek <jeffpc@josefsipek.net> wrote:\n>> > On Fri, Mar 21, 2014 at 08:31:45AM +0100, Per Cederqvist wrote:\n>> >> Test that we can combine any combination of patches with empty and\n>> >> non-empty messages, both with and without guilt.diffstat.  (All\n>> >> patches are empty.)\n>> >\n>> > I feel like we should have *some* content there - most of the time, I care\n>> > more about the diffs getting folded than the commit message :)\n>>\n>> I added these tests for a reason: the reproduce a bug in guilt that I found.\n>>\n>> I'm afraid that having some content might hide the bug I found. (I'm also\n>> equally afraid that it might uncover other bugs in guilt, which would delay\n>> integration of this patch series. So adding more test cases with content\n>> is a good thing to do, but maybe not in this patch series.)\n>\n> Fair enough.  I use guilt-fold all the time and it hasn't lost any of my\n> diffs, so I'm happy to defer this until some point in the future.\n>\n> ...\n>> > for using_diffstat in true false ; do\n>> >         for patcha in empty nonempty ; do\n>> >                 for patchb in empty nonempty ; do\n>> >                         echo \"%% $patcha + $patchb (diffstat=$using_diffstat)\"\n>> >                         ${patcha}_patch $patcha\n>> >                         ${patchb}_patch $patchb\n>> >                         cmd guilt pop $patchb\n>> >                         cmd guilt fold $patchb\n>> >                         fixup_time_info $patcha\n>> >                         cmd list_files\n>> >                         cleanup $patcha\n>> >                         cmd list_files\n>> >                 done\n>> >         done\n>> > done\n>> >\n>> > Aha!  That's better, IMO.\n>>\n>> I'll try that and post a version 2 of the series. It might take a few\n>> days, though.\n>\n> No problem.  I'm still the slower one of the two of us. :/\n>\n> Jeff.\n\nThere were a few details that made it a bit more complex than that,\nbut I think the end result was still an improvement.\n\nThe most obvious detail is that if you add two empty patches, you\ncannot name them both \"empty\", so when $patcha and $patchb is the same\nyou have to add suffixes.\n\nThe other detail is that my tests used different commit messages when\nboth commits contained a message.  I want to retain that behaviour, so\nthat added a few lines of complexity.\n\nI'll post an updated patch series once I've gone through all your\ncomments.  In the meantime, you can see my new implementation here:\n\nhttp://repo.or.cz/w/guilt/ceder.git/commitdiff/3107dc73eaff020da18024c3b5f5f92b94d17852?hp=6df110c95133d6e557ce3dbcb6fd39bc797f877b#patch2\n\n    /ceder\n"},{"id":"241024","messageId":"20140508195942.GC1619@meili.valhalla.31bits.net","threadId":"36262","inReplyTo":"CAP=KgsR2CD39XeC+UsPU_Oh2GDBg-WrF=+Q33jhfYvToZz7UwA@mail.gmail.com","subject":"Re: [GUILT 07/28] Added test cases for \"guilt fold\".","fromName":"Jeff Sipek","fromEmail":"jeffpc@josefsipek.net","sentAt":"2014-05-08T19:59:43Z","receivedAt":"2014-05-08T19:59:43Z","isPatch":false,"sender":{"key":"jeffpc@josefsipek.net","avatar":null},"body":"On Thu, May 08, 2014 at 09:41:22PM +0200, Per Cederqvist wrote:\n> On Wed, May 7, 2014 at 11:06 PM, Jeff Sipek <jeffpc@josefsipek.net> wrote:\n> > On Wed, May 07, 2014 at 10:59:56PM +0200, Per Cederqvist wrote:\n> >> On Tue, May 6, 2014 at 9:40 PM, Jeff Sipek <jeffpc@josefsipek.net> wrote:\n> >> > On Fri, Mar 21, 2014 at 08:31:45AM +0100, Per Cederqvist wrote:\n> >> >> Test that we can combine any combination of patches with empty and\n> >> >> non-empty messages, both with and without guilt.diffstat.  (All\n> >> >> patches are empty.)\n> >> >\n> >> > I feel like we should have *some* content there - most of the time, I care\n> >> > more about the diffs getting folded than the commit message :)\n> >>\n> >> I added these tests for a reason: the reproduce a bug in guilt that I found.\n> >>\n> >> I'm afraid that having some content might hide the bug I found. (I'm also\n> >> equally afraid that it might uncover other bugs in guilt, which would delay\n> >> integration of this patch series. So adding more test cases with content\n> >> is a good thing to do, but maybe not in this patch series.)\n> >\n> > Fair enough.  I use guilt-fold all the time and it hasn't lost any of my\n> > diffs, so I'm happy to defer this until some point in the future.\n> >\n> > ...\n> >> > for using_diffstat in true false ; do\n> >> >         for patcha in empty nonempty ; do\n> >> >                 for patchb in empty nonempty ; do\n> >> >                         echo \"%% $patcha + $patchb (diffstat=$using_diffstat)\"\n> >> >                         ${patcha}_patch $patcha\n> >> >                         ${patchb}_patch $patchb\n> >> >                         cmd guilt pop $patchb\n> >> >                         cmd guilt fold $patchb\n> >> >                         fixup_time_info $patcha\n> >> >                         cmd list_files\n> >> >                         cleanup $patcha\n> >> >                         cmd list_files\n> >> >                 done\n> >> >         done\n> >> > done\n> >> >\n> >> > Aha!  That's better, IMO.\n> >>\n> >> I'll try that and post a version 2 of the series. It might take a few\n> >> days, though.\n> >\n> > No problem.  I'm still the slower one of the two of us. :/\n> >\n> > Jeff.\n> \n> There were a few details that made it a bit more complex than that,\n> but I think the end result was still an improvement.\n\nThe devil's in the details :)\n\n> The most obvious detail is that if you add two empty patches, you\n> cannot name them both \"empty\", so when $patcha and $patchb is the same\n> you have to add suffixes.\n> \n> The other detail is that my tests used different commit messages when\n> both commits contained a message.  I want to retain that behaviour, so\n> that added a few lines of complexity.\n> \n> I'll post an updated patch series once I've gone through all your\n> comments.  In the meantime, you can see my new implementation here:\n> \n> http://repo.or.cz/w/guilt/ceder.git/commitdiff/3107dc73eaff020da18024c3b5f5f92b94d17852?hp=6df110c95133d6e557ce3dbcb6fd39bc797f877b#patch2\n\nMuch better than the original, IMO.\n\nThanks,\n\nJeff.\n\n-- \nWe have joy, we have fun, we have Linux on a Sun...\n"},{"id":"241027","messageId":"CAP=KgsSOz7Yg=J42QU9rUKmX+rxppXVVHs5S4G-_KOcUr+Lwaw@mail.gmail.com","threadId":"36262","inReplyTo":"20140506202446.GQ1655@meili.valhalla.31bits.net","subject":"Re: [GUILT 20/28] \"guilt graph\": Handle patch names containing quotes.","fromName":"Per Cederqvist","fromEmail":"cederp@opera.com","sentAt":"2014-05-08T20:18:44Z","receivedAt":"2014-05-08T20:18:44Z","isPatch":false,"sender":{"key":"cederp@opera.com","avatar":"https://gravatar.com/avatar/008fe28caedea0ba34042cd5157705267934f4ba7a9b29fb248ae18ec5b3055e?d=mp&s=160"},"body":"On Tue, May 6, 2014 at 10:24 PM, Jeff Sipek <jeffpc@josefsipek.net> wrote:\n> On Fri, Mar 21, 2014 at 03:57:37AM -0400, Eric Sunshine wrote:\n>> On Fri, Mar 21, 2014 at 3:31 AM, Per Cederqvist <cederp@opera.com> wrote:\n>> > Quote quotes with a backslash in the \"guitl graph\" output.  Otherwise,\n>>\n>> s/guitl/guilt/\n>\n> Yep.\n\nOups. Will fix.\n\n>> > the \"dot\" file could contain syntax errors.\n>> >\n>> > Added a test case.\n>> > ---\n>> >  guilt-graph          |  2 ++\n>> >  regression/t-033.out | 22 ++++++++++++++++++++++\n>> >  regression/t-033.sh  |  9 +++++++++\n>> >  3 files changed, 33 insertions(+)\n>> >\n>> > diff --git a/guilt-graph b/guilt-graph\n>> > index 575f03b..24ab83b 100755\n>> > --- a/guilt-graph\n>> > +++ b/guilt-graph\n>> > @@ -58,6 +58,8 @@ while [ \"$current\" != \"$base\" ]; do\n>> >  }\"`\n>> >         [ -z \"$pname\" ] && pname=\"?\"\n>> >\n>> > +       pname=\"`printf \\\"%s\\\" $pname|sed 's/\\\"/\\\\\\\\\\\"/g'`\"\n>\n> Some of this filtering is getting a bit unwieldy.  I'd add spaces around the\n> |.  Do we want to be paranoid and add quotes around $pname?  If not, then it\n> looks good.\n\nIndeed. I wish I could think of a better way to do this. :-)\n\nI'll add spaces, and quote $pname just to play safe.\n\n    /ceder\n\n>> > +\n>> >         disp \"# checking rev $current\"\n>> >         disp \"  \\\"$current\\\" [label=\\\"$pname\\\"]\"\n>> >\n>> > diff --git a/regression/t-033.out b/regression/t-033.out\n>> > index e638d7b..1c28ea9 100644\n>> > --- a/regression/t-033.out\n>> > +++ b/regression/t-033.out\n>> > @@ -63,3 +63,25 @@ digraph G {\n>> >         \"ff2775f8d1dc753f635830adcc3a067e0b681e2d\" [label=\"a.patch\"]\n>> >         \"891bc14b5603474c9743fd04f3da888644413dc5\" -> \"ff2775f8d1dc753f635830adcc3a067e0b681e2d\"; // ?\n>> >  }\n>> > +% guilt new a-\"better&quicker'-patch.patch\n>> > +% git add file.txt\n>> > +% guilt refresh\n>> > +Patch a-\"better&quicker'-patch.patch refreshed\n>> > +% guilt pop\n>> > +Now at c.patch.\n>> > +% guilt push\n>> > +Applying patch..a-\"better&quicker'-patch.patch\n>> > +Patch applied.\n>> > +% guilt graph\n>> > +digraph G {\n>> > +# checking rev bc7df666a646739eaf559af23cab72f2bfd01f0e\n>> > +       \"bc7df666a646739eaf559af23cab72f2bfd01f0e\" [label=\"a-\\\"better&quicker'-patch.patch\"]\n>> > +# checking rev 891bc14b5603474c9743fd04f3da888644413dc5\n>> > +       \"891bc14b5603474c9743fd04f3da888644413dc5\" [label=\"c.patch\"]\n>> > +       \"bc7df666a646739eaf559af23cab72f2bfd01f0e\" -> \"891bc14b5603474c9743fd04f3da888644413dc5\"; // ?\n>> > +# checking rev c7014443c33d2b0237293687ceb9cbd38313df65\n>> > +       \"c7014443c33d2b0237293687ceb9cbd38313df65\" [label=\"b.patch\"]\n>> > +# checking rev ff2775f8d1dc753f635830adcc3a067e0b681e2d\n>> > +       \"ff2775f8d1dc753f635830adcc3a067e0b681e2d\" [label=\"a.patch\"]\n>> > +       \"891bc14b5603474c9743fd04f3da888644413dc5\" -> \"ff2775f8d1dc753f635830adcc3a067e0b681e2d\"; // ?\n>> > +}\n>> > diff --git a/regression/t-033.sh b/regression/t-033.sh\n>> > index 57dce78..968292c 100755\n>> > --- a/regression/t-033.sh\n>> > +++ b/regression/t-033.sh\n>> > @@ -46,3 +46,12 @@ cmd git add file.txt\n>> >  cmd guilt refresh\n>> >  fixup_time_info c.patch\n>> >  cmd guilt graph\n>> > +\n>> > +# A patch name that contains funky characters, including unbalanced\n>> > +# quotes.\n>> > +cmd guilt new \"a-\\\"better&quicker'-patch.patch\"\n>> > +cmd echo d >> file.txt\n>> > +cmd git add file.txt\n>> > +cmd guilt refresh\n>> > +fixup_time_info \"a-\\\"better&quicker'-patch.patch\"\n>> > +cmd guilt graph\n>> > --\n>> > 1.8.3.1\n>> >\n>> > --\n>> > To unsubscribe from this list: send the line \"unsubscribe git\" in\n>> > the body of a message to majordomo@vger.kernel.org\n>> > More majordomo info at  http://vger.kernel.org/majordomo-info.html\n>\n> --\n> All parts should go together without forcing.  You must remember that the\n> parts you are reassembling were disassembled by you.  Therefore, if you\n> can’t get them together again, there must be a reason.  By all means, do not\n> use a hammer.\n>                 — IBM Manual, 1925\n"},{"id":"241038","messageId":"CAP=KgsTSD6Dnh7V8MO3S3ZN45R7QYJfBQBS1x=GajJKdTm9syA@mail.gmail.com","threadId":"36262","inReplyTo":"20140507220427.GD1459@meili.valhalla.31bits.net","subject":"Re: [GUILT 25/28] \"guilt push\" now fails when there are no more patches to push.","fromName":"Per Cederqvist","fromEmail":"cederp@opera.com","sentAt":"2014-05-08T21:37:46Z","receivedAt":"2014-05-08T21:37:46Z","isPatch":false,"sender":{"key":"cederp@opera.com","avatar":"https://gravatar.com/avatar/008fe28caedea0ba34042cd5157705267934f4ba7a9b29fb248ae18ec5b3055e?d=mp&s=160"},"body":"On Thu, May 8, 2014 at 12:04 AM, Jeff Sipek <jeffpc@josefsipek.net> wrote:\n> On Fri, Mar 21, 2014 at 08:32:03AM +0100, Per Cederqvist wrote:\n>> This makes it easier to script operations on the entire queue, for\n>> example run the test suite on each patch in the queue:\n>>\n>>     guilt pop -a;while guilt push; do make test||break; done\n>>\n>> This brings \"guilt push\" in line with the push operation in Mercurial\n>> Queues (hg qpush), which fails when there are no patches to apply.\n>>\n>> Updated the test suite.\n>>\n>> \"guilt push -a\" still does not fail.  (It successfully manages to\n>> ensure that all patches are pushed, even if it did not have to do\n>> anything to make it so.)\n>>\n>> Signed-off-by: Per Cederqvist <cederp@opera.com>\n>> ---\n>>  guilt-push           | 14 ++++-----\n>>  regression/t-020.out | 89 ++++++++++++++++++++++++++++++++++++++++++++++++++++\n>>  regression/t-020.sh  | 13 +++++++-\n>>  3 files changed, 108 insertions(+), 8 deletions(-)\n>>\n>> diff --git a/guilt-push b/guilt-push\n>> index 67687e7..2222350 100755\n>> --- a/guilt-push\n>> +++ b/guilt-push\n>> @@ -55,6 +55,7 @@ fi\n>>\n>>  patch=\"$1\"\n>>  [ ! -z \"$all\" ] && patch=\"-a\"\n>> +[ -z \"$patch\" ] && { patch=1; num=t; }\n>\n> I don't think there's any other place in the repo that does this.  Instead\n> you see a lot of if-then-fi.  To keep it consistent, I'd suggest:\n>\n> if [ -z \"$patch\" ] ; then\n>         patch=1\n>         num=t\n> fi\n\nOk.\n\n> Ah, this took me a while to figure out.  The above turns:\n>\n> $ guilt push\n>\n> into\n>\n> $ guilt push -n 1\n>\n> I'd throw in a comment.\n\nWill do.\n\n> (Note to self, this file is a huge mess and could use a bit of cleanup.)\n>\n>> @@ -78,11 +79,6 @@ elif [ ! -z \"$num\" ]; then\n>>       # clamp to minimum\n>>       [ $tidx -lt $eidx ] && eidx=$tidx\n>>\n>> -elif [ -z \"$patch\" ]; then\n>> -     # we are supposed to push only the next patch onto the stack\n>> -\n>> -     eidx=`wc -l < \"$applied\"`\n>> -     eidx=`expr $eidx + 1`\n>>  else\n>>       # we're supposed to push only up to a patch, make sure the patch is\n>>       # in the series\n>> @@ -109,7 +105,11 @@ if [ \"$sidx\" -gt \"$eidx\" ]; then\n>>       else\n>>               disp \"File series fully applied, ends at patch `get_series | tail -n 1`\"\n>>       fi\n>> -     exit 0\n>> +     if [ -n \"$all\" ]; then\n>> +             exit 0\n>> +     else\n>> +             exit 1\n>> +     fi\n>\n> This changes the output on stdout.  E.g.,\n>\n> $ guilt pu\n> $ guilt pu -n 1\n> File series fully applied, ends at patch crashdump\n>\n> With this patch, both will print the message. Right?\n\nYes. Personally, I think that is a good change. It feels\nstrange that \"guilt push\" silently does nothing when\nthere is no patch to apply.\n\n    /ceder\n\n>>  fi\n>>\n>>  get_series | sed -n -e \"${sidx},${eidx}p\" | while read p\n>\n> Jeff.\n"},{"id":"241446","messageId":"20140513213321.GG4791@meili.valhalla.31bits.net","threadId":"36262","inReplyTo":"1395387126-13681-20-git-send-email-cederp@opera.com","subject":"Re: [GUILT 19/28] Check that \"guilt graph\" works when working on a branch with a comma.","fromName":"Jeff Sipek","fromEmail":"jeffpc@josefsipek.net","sentAt":"2014-05-13T21:33:22Z","receivedAt":"2014-05-13T21:33:22Z","isPatch":false,"sender":{"key":"jeffpc@josefsipek.net","avatar":null},"body":"On Fri, Mar 21, 2014 at 08:31:57AM +0100, Per Cederqvist wrote:\n> git branch names can contain commas.  Check that \"guilt graph\" works\n> even in that case.\n> \n> Signed-off-by: Per Cederqvist <cederp@opera.com>\n> ---\n>  regression/t-033.out | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++\n>  regression/t-033.sh  | 37 +++++++++++++++++++++++++++++++\n>  2 files changed, 99 insertions(+)\n> \n> diff --git a/regression/t-033.out b/regression/t-033.out\n> index 76613f9..e638d7b 100644\n> --- a/regression/t-033.out\n> +++ b/regression/t-033.out\n> @@ -1,3 +1,65 @@\n>  % setup_repo\n>  % guilt graph\n>  No patch applied.\n> +% git checkout -b a,graph master\n> +Switched to a new branch 'a,graph'\n> +% guilt init\n> +% guilt new a.patch\n> +% guilt pop\n> +All patches popped.\n> +% guilt push\n> +Applying patch..a.patch\n> +Patch applied.\n> +% guilt graph\n> +digraph G {\n> +# checking rev 95275d7c05c6a6176d3941374115b91272877f6c\n> +\t\"95275d7c05c6a6176d3941374115b91272877f6c\" [label=\"a.patch\"]\n> +}\n> +% git add file.txt\n> +% guilt refresh\n> +Patch a.patch refreshed\n> +% guilt pop\n> +All patches popped.\n> +% guilt push\n> +Applying patch..a.patch\n> +Patch applied.\n> +% guilt graph\n> +digraph G {\n> +# checking rev ff2775f8d1dc753f635830adcc3a067e0b681e2d\n> +\t\"ff2775f8d1dc753f635830adcc3a067e0b681e2d\" [label=\"a.patch\"]\n> +}\n> +% guilt new b.patch\n> +% git add file2.txt\n> +% guilt refresh\n> +Patch b.patch refreshed\n> +% guilt pop\n> +Now at a.patch.\n> +% guilt push\n> +Applying patch..b.patch\n> +Patch applied.\n> +% guilt graph\n> +digraph G {\n> +# checking rev c7014443c33d2b0237293687ceb9cbd38313df65\n> +\t\"c7014443c33d2b0237293687ceb9cbd38313df65\" [label=\"b.patch\"]\n> +# checking rev ff2775f8d1dc753f635830adcc3a067e0b681e2d\n> +\t\"ff2775f8d1dc753f635830adcc3a067e0b681e2d\" [label=\"a.patch\"]\n> +}\n> +% guilt new c.patch\n> +% git add file.txt\n> +% guilt refresh\n> +Patch c.patch refreshed\n> +% guilt pop\n> +Now at b.patch.\n> +% guilt push\n> +Applying patch..c.patch\n> +Patch applied.\n> +% guilt graph\n> +digraph G {\n> +# checking rev 891bc14b5603474c9743fd04f3da888644413dc5\n> +\t\"891bc14b5603474c9743fd04f3da888644413dc5\" [label=\"c.patch\"]\n> +# checking rev c7014443c33d2b0237293687ceb9cbd38313df65\n> +\t\"c7014443c33d2b0237293687ceb9cbd38313df65\" [label=\"b.patch\"]\n> +# checking rev ff2775f8d1dc753f635830adcc3a067e0b681e2d\n> +\t\"ff2775f8d1dc753f635830adcc3a067e0b681e2d\" [label=\"a.patch\"]\n> +\t\"891bc14b5603474c9743fd04f3da888644413dc5\" -> \"ff2775f8d1dc753f635830adcc3a067e0b681e2d\"; // ?\n> +}\n> diff --git a/regression/t-033.sh b/regression/t-033.sh\n> index ae40577..57dce78 100755\n> --- a/regression/t-033.sh\n> +++ b/regression/t-033.sh\n> @@ -3,9 +3,46 @@\n>  # Test the graph code\n>  #\n>  \n> +function fixup_time_info\n> +{\n> +\tcmd guilt pop\n> +\ttouch -a -m -t \"$TOUCH_DATE\" \".git/patches/a,graph/$1\"\n> +\tcmd guilt push\n> +}\n> +\n>  source \"$REG_DIR/scaffold\"\n>  \n>  cmd setup_repo\n>  \n\nA comment here to justify this seemingly useless guilt-graph call?  Maybe\nadding one of the '%%' lines between each section.  Otherwise, this looks\ngood.\n\n>  shouldfail guilt graph\n>  \n> +cmd git checkout -b a,graph master\n> +\n> +cmd guilt init\n> +\n> +cmd guilt new a.patch\n> +\n> +fixup_time_info a.patch\n> +cmd guilt graph\n> +\n> +cmd echo a >> file.txt\n> +cmd git add file.txt\n> +cmd guilt refresh\n> +fixup_time_info a.patch\n> +cmd guilt graph\n> +\n> +# An unrelated file. No deps.\n> +cmd guilt new b.patch\n> +cmd echo b >> file2.txt\n> +cmd git add file2.txt\n> +cmd guilt refresh\n> +fixup_time_info b.patch\n> +cmd guilt graph\n> +\n> +# An change to an old file. Should add a dependency.\n> +cmd guilt new c.patch\n> +cmd echo c >> file.txt\n> +cmd git add file.txt\n> +cmd guilt refresh\n> +fixup_time_info c.patch\n> +cmd guilt graph\n> -- \n> 1.8.3.1\n> \n\n-- \nReady; T=0.01/0.01 17:32:39\n"},{"id":"241447","messageId":"20140513213504.GA23045@meili.valhalla.31bits.net","threadId":"36262","inReplyTo":"20140513213321.GG4791@meili.valhalla.31bits.net","subject":"Re: [GUILT 19/28] Check that \"guilt graph\" works when working on a branch with a comma.","fromName":"Jeff Sipek","fromEmail":"jeffpc@josefsipek.net","sentAt":"2014-05-13T21:35:05Z","receivedAt":"2014-05-13T21:35:05Z","isPatch":false,"sender":{"key":"jeffpc@josefsipek.net","avatar":null},"body":"Sorry, I accidentally replied to the v1 of this patch...\n\nOn Tue, May 13, 2014 at 05:33:21PM -0400, Jeff Sipek wrote:\n> On Fri, Mar 21, 2014 at 08:31:57AM +0100, Per Cederqvist wrote:\n> > git branch names can contain commas.  Check that \"guilt graph\" works\n> > even in that case.\n> > \n> > Signed-off-by: Per Cederqvist <cederp@opera.com>\n> > ---\n> >  regression/t-033.out | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++\n> >  regression/t-033.sh  | 37 +++++++++++++++++++++++++++++++\n> >  2 files changed, 99 insertions(+)\n> > \n> > diff --git a/regression/t-033.out b/regression/t-033.out\n> > index 76613f9..e638d7b 100644\n> > --- a/regression/t-033.out\n> > +++ b/regression/t-033.out\n> > @@ -1,3 +1,65 @@\n> >  % setup_repo\n> >  % guilt graph\n> >  No patch applied.\n> > +% git checkout -b a,graph master\n> > +Switched to a new branch 'a,graph'\n> > +% guilt init\n> > +% guilt new a.patch\n> > +% guilt pop\n> > +All patches popped.\n> > +% guilt push\n> > +Applying patch..a.patch\n> > +Patch applied.\n> > +% guilt graph\n> > +digraph G {\n> > +# checking rev 95275d7c05c6a6176d3941374115b91272877f6c\n> > +\t\"95275d7c05c6a6176d3941374115b91272877f6c\" [label=\"a.patch\"]\n> > +}\n> > +% git add file.txt\n> > +% guilt refresh\n> > +Patch a.patch refreshed\n> > +% guilt pop\n> > +All patches popped.\n> > +% guilt push\n> > +Applying patch..a.patch\n> > +Patch applied.\n> > +% guilt graph\n> > +digraph G {\n> > +# checking rev ff2775f8d1dc753f635830adcc3a067e0b681e2d\n> > +\t\"ff2775f8d1dc753f635830adcc3a067e0b681e2d\" [label=\"a.patch\"]\n> > +}\n> > +% guilt new b.patch\n> > +% git add file2.txt\n> > +% guilt refresh\n> > +Patch b.patch refreshed\n> > +% guilt pop\n> > +Now at a.patch.\n> > +% guilt push\n> > +Applying patch..b.patch\n> > +Patch applied.\n> > +% guilt graph\n> > +digraph G {\n> > +# checking rev c7014443c33d2b0237293687ceb9cbd38313df65\n> > +\t\"c7014443c33d2b0237293687ceb9cbd38313df65\" [label=\"b.patch\"]\n> > +# checking rev ff2775f8d1dc753f635830adcc3a067e0b681e2d\n> > +\t\"ff2775f8d1dc753f635830adcc3a067e0b681e2d\" [label=\"a.patch\"]\n> > +}\n> > +% guilt new c.patch\n> > +% git add file.txt\n> > +% guilt refresh\n> > +Patch c.patch refreshed\n> > +% guilt pop\n> > +Now at b.patch.\n> > +% guilt push\n> > +Applying patch..c.patch\n> > +Patch applied.\n> > +% guilt graph\n> > +digraph G {\n> > +# checking rev 891bc14b5603474c9743fd04f3da888644413dc5\n> > +\t\"891bc14b5603474c9743fd04f3da888644413dc5\" [label=\"c.patch\"]\n> > +# checking rev c7014443c33d2b0237293687ceb9cbd38313df65\n> > +\t\"c7014443c33d2b0237293687ceb9cbd38313df65\" [label=\"b.patch\"]\n> > +# checking rev ff2775f8d1dc753f635830adcc3a067e0b681e2d\n> > +\t\"ff2775f8d1dc753f635830adcc3a067e0b681e2d\" [label=\"a.patch\"]\n> > +\t\"891bc14b5603474c9743fd04f3da888644413dc5\" -> \"ff2775f8d1dc753f635830adcc3a067e0b681e2d\"; // ?\n> > +}\n> > diff --git a/regression/t-033.sh b/regression/t-033.sh\n> > index ae40577..57dce78 100755\n> > --- a/regression/t-033.sh\n> > +++ b/regression/t-033.sh\n> > @@ -3,9 +3,46 @@\n> >  # Test the graph code\n> >  #\n> >  \n> > +function fixup_time_info\n> > +{\n> > +\tcmd guilt pop\n> > +\ttouch -a -m -t \"$TOUCH_DATE\" \".git/patches/a,graph/$1\"\n> > +\tcmd guilt push\n> > +}\n> > +\n> >  source \"$REG_DIR/scaffold\"\n> >  \n> >  cmd setup_repo\n> >  \n> \n> A comment here to justify this seemingly useless guilt-graph call?  Maybe\n> adding one of the '%%' lines between each section.  Otherwise, this looks\n> good.\n> \n> >  shouldfail guilt graph\n> >  \n> > +cmd git checkout -b a,graph master\n> > +\n> > +cmd guilt init\n> > +\n> > +cmd guilt new a.patch\n> > +\n> > +fixup_time_info a.patch\n> > +cmd guilt graph\n> > +\n> > +cmd echo a >> file.txt\n> > +cmd git add file.txt\n> > +cmd guilt refresh\n> > +fixup_time_info a.patch\n> > +cmd guilt graph\n> > +\n> > +# An unrelated file. No deps.\n> > +cmd guilt new b.patch\n> > +cmd echo b >> file2.txt\n> > +cmd git add file2.txt\n> > +cmd guilt refresh\n> > +fixup_time_info b.patch\n> > +cmd guilt graph\n> > +\n> > +# An change to an old file. Should add a dependency.\n> > +cmd guilt new c.patch\n> > +cmd echo c >> file.txt\n> > +cmd git add file.txt\n> > +cmd guilt refresh\n> > +fixup_time_info c.patch\n> > +cmd guilt graph\n> > -- \n> > 1.8.3.1\n> > \n> \n> -- \n> Ready; T=0.01/0.01 17:32:39\n\n-- \nC is quirky, flawed, and an enormous success.\n\t\t- Dennis M. Ritchie.\n"}]}