{"thread":{"id":"36651","subject":"[GUILT v2 00/29] Teach guilt import-commit how to create legal patch names, and more","startedAt":"2014-05-13T20:30:36Z","lastAt":"2014-05-16T12:55:01Z","messageCount":63,"participants":["Per Cederqvist","Theodore Ts'o","Jeff Sipek"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"241400","messageId":"1400013065-27919-1-git-send-email-cederp@opera.com","threadId":"36651","inReplyTo":null,"subject":"[GUILT v2 00/29] Teach guilt import-commit how to create legal patch names, and more","fromName":"Per Cederqvist","fromEmail":"cederp@opera.com","sentAt":"2014-05-13T20:30:36Z","receivedAt":"2014-05-13T20:30:36Z","isPatch":false,"sender":{"key":"cederp@opera.com","avatar":"https://gravatar.com/avatar/008fe28caedea0ba34042cd5157705267934f4ba7a9b29fb248ae18ec5b3055e?d=mp&s=160"},"body":"This is version two of the patch series I sent back on 21 Mar 2014.  I\nhave addressed all feedback to date, updated the coding style, and\nadded signed-off-by lines from Jeff Sipek for those commits that I\nhave received an explicit approval from him (but only if I have not\nmade any other change to that particular commit).\n\nI have also added one more patch: a very limited coding style guide,\nand accompanying settings for Emacs.  See the last commit in the\nseries.  All other commits have retained their numbering.\n\nTo see how the patches have evolved, you might find\nhttp://www.lysator.liu.se/~ceder/guilt-oslo-2014-v2/ useful.  It\ndisplays diffs of all the patches, in pdiffdiff output format.\n\nHere is the original blurb for the series, slightly edited:\n\nI 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\n - The humble beginnings of a coding style guide.\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\n29. A coding style guide, with Emacs support.\n\nThis patch series is also available on\nhttp://repo.or.cz/w/guilt/ceder.git in the \"oslo-2014-v2\" branch.  If\nyou already have a copy of guilt, you should be able to fetch that\nbranch with something like:\n\n    git remote add ceder http://repo.or.cz/r/guilt/ceder.git\n    git fetch ceder refs/heads/oslo-2014-v2:refs/remotes/ceder/oslo-2014-v2\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 (29):\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 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  Added a short style guide, and Emacs settings.\n\n .dir-locals.el             |   3 +\n Documentation/Contributing |  15 ++\n guilt                      |  68 ++++--\n guilt-delete               |   2 +-\n guilt-fork                 |   2 +-\n guilt-graph                |  13 +-\n guilt-header               |  28 ++-\n guilt-import               |   2 +-\n guilt-import-commit        |  30 ++-\n guilt-new                  |   9 +-\n guilt-patchbomb            |   2 +-\n guilt-pop                  |  17 +-\n guilt-push                 |  19 +-\n guilt-rebase               |   2 +-\n regression/run-tests       |  10 +-\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       |  90 +++++++\n regression/t-033.sh        |  61 +++++\n regression/t-034.out       | 569 +++++++++++++++++++++++++++++++++++++++++++++\n regression/t-034.sh        |  73 ++++++\n regression/t-035.out       | 467 +++++++++++++++++++++++++++++++++++++\n regression/t-035.sh        |  62 +++++\n regression/t-061.out       |   1 -\n regression/t-061.sh        |   8 +-\n regression/t-062.out       | 441 +++++++++++++++++++++++++++++++++++\n regression/t-062.sh        | 137 +++++++++++\n 38 files changed, 2966 insertions(+), 85 deletions(-)\n create mode 100644 .dir-locals.el\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":"241401","messageId":"1400013065-27919-2-git-send-email-cederp@opera.com","threadId":"36651","inReplyTo":"1400013065-27919-1-git-send-email-cederp@opera.com","subject":"[GUILT v2 01/29] The tests should not fail if guilt.diffstat is set.","fromName":"Per Cederqvist","fromEmail":"cederp@opera.com","sentAt":"2014-05-13T20:30:37Z","receivedAt":"2014-05-13T20:30:37Z","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>\nSigned-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>\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":"241402","messageId":"1400013065-27919-3-git-send-email-cederp@opera.com","threadId":"36651","inReplyTo":"1400013065-27919-1-git-send-email-cederp@opera.com","subject":"[GUILT v2 02/29] Allow \"guilt delete -f\" to run from a dir which contains spaces.","fromName":"Per Cederqvist","fromEmail":"cederp@opera.com","sentAt":"2014-05-13T20:30:38Z","receivedAt":"2014-05-13T20:30:38Z","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>\nSigned-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>\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":"241403","messageId":"1400013065-27919-4-git-send-email-cederp@opera.com","threadId":"36651","inReplyTo":"1400013065-27919-1-git-send-email-cederp@opera.com","subject":"[GUILT v2 03/29] Added test case for \"guilt delete -f\".","fromName":"Per Cederqvist","fromEmail":"cederp@opera.com","sentAt":"2014-05-13T20:30:39Z","receivedAt":"2014-05-13T20:30:39Z","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>\nSigned-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>\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":"241404","messageId":"1400013065-27919-5-git-send-email-cederp@opera.com","threadId":"36651","inReplyTo":"1400013065-27919-1-git-send-email-cederp@opera.com","subject":"[GUILT v2 04/29] Allow \"guilt import-commit\" to run from a dir which contains spaces.","fromName":"Per Cederqvist","fromEmail":"cederp@opera.com","sentAt":"2014-05-13T20:30:40Z","receivedAt":"2014-05-13T20:30: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-import-commit | 6 +++---\n 1 file changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/guilt-import-commit b/guilt-import-commit\nindex 20dcee2..f14647c 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: `git rev-parse \\`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: `git rev-parse \\`git_branch\\``\" >&2\n \n }\n-- \n1.8.3.1\n"},{"id":"241405","messageId":"1400013065-27919-6-git-send-email-cederp@opera.com","threadId":"36651","inReplyTo":"1400013065-27919-1-git-send-email-cederp@opera.com","subject":"[GUILT v2 05/29] \"guilt new\": Accept more than 4 arguments.","fromName":"Per Cederqvist","fromEmail":"cederp@opera.com","sentAt":"2014-05-13T20:30:41Z","receivedAt":"2014-05-13T20:30:41Z","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>\nSigned-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>\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":"241406","messageId":"1400013065-27919-7-git-send-email-cederp@opera.com","threadId":"36651","inReplyTo":"1400013065-27919-1-git-send-email-cederp@opera.com","subject":"[GUILT v2 06/29] Fix the do_get_patch function.","fromName":"Per Cederqvist","fromEmail":"cederp@opera.com","sentAt":"2014-05-13T20:30:42Z","receivedAt":"2014-05-13T20:30:42Z","isPatch":false,"sender":{"key":"cederp@opera.com","avatar":"https://gravatar.com/avatar/008fe28caedea0ba34042cd5157705267934f4ba7a9b29fb248ae18ec5b3055e?d=mp&s=160"},"body":"A patch file consists of:\n\n(1) the description\n(2) optional diffstat\n(3) the patches\n\nWhen extracting the patch, we only want part 3.  The do_get_patch used\nto give us part 2 and part 3.  That made for instance this series of\noperations fail if guilt.diffstat is true:\n\n    guilt push empty-1\n    guilt push empty-2\n    guilt pop\n    guilt fold empty-2\n    guilt pop\n    guilt push\n\nSigned-off-by: Per Cederqvist <cederp@opera.com>\n---\n guilt | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\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 \tawk '\n BEGIN{}\n-/^(diff |---$|--- )/ {patch = 1}\n+/^(diff |--- )/ {patch = 1}\n patch == 1 {print $0}\n END{}\n ' < \"$1\"\n-- \n1.8.3.1\n"},{"id":"241408","messageId":"1400013065-27919-8-git-send-email-cederp@opera.com","threadId":"36651","inReplyTo":"1400013065-27919-1-git-send-email-cederp@opera.com","subject":"[GUILT v2 07/29] Added test cases for \"guilt fold\".","fromName":"Per Cederqvist","fromEmail":"cederp@opera.com","sentAt":"2014-05-13T20:30:43Z","receivedAt":"2014-05-13T20:30:43Z","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 | 467 +++++++++++++++++++++++++++++++++++++++++++++++++++\n regression/t-035.sh  |  62 +++++++\n 2 files changed, 529 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..cc16fb4\n--- /dev/null\n+++ b/regression/t-035.out\n@@ -0,0 +1,467 @@\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+% 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 + nonempty (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. nonempty\n+% guilt pop\n+Now at empty.\n+% guilt push\n+Applying patch..nonempty\n+Patch applied.\n+% guilt pop\n+Now at empty.\n+% guilt fold nonempty\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/nonempty~\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+% 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/nonempty~\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+%% nonempty + empty (diffstat=true)\n+% guilt new -f -s -m A commit message. nonempty\n+% guilt pop\n+All patches popped.\n+% guilt push\n+Applying patch..nonempty\n+Patch applied.\n+% guilt new empty\n+% guilt pop\n+Now at nonempty.\n+% guilt push\n+Applying patch..empty\n+Patch applied.\n+% guilt pop\n+Now at nonempty.\n+% guilt fold empty\n+% guilt pop\n+All patches popped.\n+% guilt push\n+Applying patch..nonempty\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 51fcfcf16db2903f19ab4a4a3caacd297ea9f6cd  .git/patches/master/nonempty~\n+f 683678040eef9334d6329e00d5b9babda3e65b57  .git/patches/master/nonempty\n+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add\n+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify\n+f c47ddc01337e3bb67a9968a8823a5ba12be67f77  .git/patches/master/series\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 f7f068d44bf796d0f7cd14d27d1f48d6e659816a  .git/patches/master/status\n+r 4eedaa32894fc07af3298d8c1178052942a3ca6a  .git/refs/patches/master/nonempty\n+% guilt pop\n+All patches popped.\n+% guilt delete -f nonempty\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/nonempty~\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+%% nonempty + nonempty (diffstat=true)\n+% guilt new -f -s -m A commit message. nonempty-1\n+% guilt pop\n+All patches popped.\n+% guilt push\n+Applying patch..nonempty-1\n+Patch applied.\n+% guilt new -f -s -m Another commit message. nonempty-2\n+% guilt pop\n+Now at nonempty-1.\n+% guilt push\n+Applying patch..nonempty-2\n+Patch applied.\n+% guilt pop\n+Now at nonempty-1.\n+% guilt fold nonempty-2\n+% guilt pop\n+All patches popped.\n+% guilt push\n+Applying patch..nonempty-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 3b526c794741fb2d6b463f3245ab2f260fa74b7b  .git/patches/master/status\n+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove\n+f 51fcfcf16db2903f19ab4a4a3caacd297ea9f6cd  .git/patches/master/nonempty~\n+f 669c9685ce791098bb3573f80af6d720a3689f80  .git/patches/master/nonempty-1\n+f 75c672c7dbec8e8275d26d720f499899d04912a4  .git/patches/master/nonempty-1~\n+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add\n+f a88f2625f128cfa307a52c8c2e84ed6c32a78d2b  .git/patches/master/series\n+f bbdc17918ad7ba268ea90ebf0fb71e32e0f09a02  .git/patches/master/nonempty-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 895dfbc21bde85fcc666a353a6bd32eaec939082  .git/refs/patches/master/nonempty-1\n+% guilt pop\n+All patches popped.\n+% guilt delete -f nonempty-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/nonempty~\n+f 75c672c7dbec8e8275d26d720f499899d04912a4  .git/patches/master/nonempty-1~\n+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add\n+f bacb4aad8a55fe4e7aa58a9ae169990bb764069f  .git/patches/master/series\n+f bbdc17918ad7ba268ea90ebf0fb71e32e0f09a02  .git/patches/master/nonempty-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/nonempty~\n+f 75c672c7dbec8e8275d26d720f499899d04912a4  .git/patches/master/nonempty-1~\n+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add\n+f bbdc17918ad7ba268ea90ebf0fb71e32e0f09a02  .git/patches/master/nonempty-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+% 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/nonempty~\n+f 75c672c7dbec8e8275d26d720f499899d04912a4  .git/patches/master/nonempty-1~\n+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add\n+f bacb4aad8a55fe4e7aa58a9ae169990bb764069f  .git/patches/master/series\n+f bbdc17918ad7ba268ea90ebf0fb71e32e0f09a02  .git/patches/master/nonempty-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 + nonempty (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. nonempty\n+% guilt pop\n+Now at empty.\n+% guilt push\n+Applying patch..nonempty\n+Patch applied.\n+% guilt pop\n+Now at empty.\n+% guilt fold nonempty\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/nonempty~\n+f 75c672c7dbec8e8275d26d720f499899d04912a4  .git/patches/master/nonempty-1~\n+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add\n+f a26a22287b500a2a372e42c2bab03599bbe37cdf  .git/patches/master/series\n+f bbdc17918ad7ba268ea90ebf0fb71e32e0f09a02  .git/patches/master/nonempty-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+% 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/nonempty~\n+f 75c672c7dbec8e8275d26d720f499899d04912a4  .git/patches/master/nonempty-1~\n+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add\n+f bacb4aad8a55fe4e7aa58a9ae169990bb764069f  .git/patches/master/series\n+f bbdc17918ad7ba268ea90ebf0fb71e32e0f09a02  .git/patches/master/nonempty-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+%% nonempty + empty (diffstat=false)\n+% guilt new -f -s -m A commit message. nonempty\n+% guilt pop\n+All patches popped.\n+% guilt push\n+Applying patch..nonempty\n+Patch applied.\n+% guilt new empty\n+% guilt pop\n+Now at nonempty.\n+% guilt push\n+Applying patch..empty\n+Patch applied.\n+% guilt pop\n+Now at nonempty.\n+% guilt fold empty\n+% guilt pop\n+All patches popped.\n+% guilt push\n+Applying patch..nonempty\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 51fcfcf16db2903f19ab4a4a3caacd297ea9f6cd  .git/patches/master/nonempty\n+f 51fcfcf16db2903f19ab4a4a3caacd297ea9f6cd  .git/patches/master/nonempty~\n+f 75c672c7dbec8e8275d26d720f499899d04912a4  .git/patches/master/nonempty-1~\n+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add\n+f bbdc17918ad7ba268ea90ebf0fb71e32e0f09a02  .git/patches/master/nonempty-2~\n+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify\n+f c47ddc01337e3bb67a9968a8823a5ba12be67f77  .git/patches/master/series\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 f7f068d44bf796d0f7cd14d27d1f48d6e659816a  .git/patches/master/status\n+r 4eedaa32894fc07af3298d8c1178052942a3ca6a  .git/refs/patches/master/nonempty\n+% guilt pop\n+All patches popped.\n+% guilt delete -f nonempty\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/nonempty~\n+f 75c672c7dbec8e8275d26d720f499899d04912a4  .git/patches/master/nonempty-1~\n+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add\n+f bacb4aad8a55fe4e7aa58a9ae169990bb764069f  .git/patches/master/series\n+f bbdc17918ad7ba268ea90ebf0fb71e32e0f09a02  .git/patches/master/nonempty-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+%% nonempty + nonempty (diffstat=false)\n+% guilt new -f -s -m A commit message. nonempty-1\n+% guilt pop\n+All patches popped.\n+% guilt push\n+Applying patch..nonempty-1\n+Patch applied.\n+% guilt new -f -s -m Another commit message. nonempty-2\n+% guilt pop\n+Now at nonempty-1.\n+% guilt push\n+Applying patch..nonempty-2\n+Patch applied.\n+% guilt pop\n+Now at nonempty-1.\n+% guilt fold nonempty-2\n+% guilt pop\n+All patches popped.\n+% guilt push\n+Applying patch..nonempty-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 3b526c794741fb2d6b463f3245ab2f260fa74b7b  .git/patches/master/status\n+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove\n+f 51fcfcf16db2903f19ab4a4a3caacd297ea9f6cd  .git/patches/master/nonempty~\n+f 75c672c7dbec8e8275d26d720f499899d04912a4  .git/patches/master/nonempty-1\n+f 75c672c7dbec8e8275d26d720f499899d04912a4  .git/patches/master/nonempty-1~\n+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add\n+f a88f2625f128cfa307a52c8c2e84ed6c32a78d2b  .git/patches/master/series\n+f bbdc17918ad7ba268ea90ebf0fb71e32e0f09a02  .git/patches/master/nonempty-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 895dfbc21bde85fcc666a353a6bd32eaec939082  .git/refs/patches/master/nonempty-1\n+% guilt pop\n+All patches popped.\n+% guilt delete -f nonempty-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/nonempty~\n+f 75c672c7dbec8e8275d26d720f499899d04912a4  .git/patches/master/nonempty-1~\n+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add\n+f bacb4aad8a55fe4e7aa58a9ae169990bb764069f  .git/patches/master/series\n+f bbdc17918ad7ba268ea90ebf0fb71e32e0f09a02  .git/patches/master/nonempty-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..e914b32\n--- /dev/null\n+++ b/regression/t-035.sh\n@@ -0,0 +1,62 @@\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 empty_patch\n+{\n+\tcmd guilt new \"empty$1\"\n+\tfixup_time_info \"empty$1\"\n+}\n+\n+function nonempty_patch\n+{\n+\tif [ \"$1\" = -2 ]; then\n+\t\tmsg=\"Another commit message.\"\n+\telse\n+\t\tmsg=\"A commit message.\"\n+\tfi\n+\n+\tcmd guilt new -f -s -m \"$msg\" \"nonempty$1\"\n+\tfixup_time_info \"nonempty$1\"\n+}\n+\n+for using_diffstat in true false; do\n+\tcmd git config guilt.diffstat $using_diffstat\n+\tfor patcha in empty nonempty; do\n+\t\tfor patchb in empty nonempty; do\n+\n+\t\t\tif [ $patcha = $patchb ]\n+\t\t\tthen\n+\t\t\t\tsuffixa=-1\n+\t\t\t\tsuffixb=-2\n+\t\t\telse\n+\t\t\t\tsuffixa=\n+\t\t\t\tsuffixb=\n+\t\t\tfi\n+\n+\t\t\techo \"%% $patcha + $patchb (diffstat=$using_diffstat)\"\n+\t\t\t${patcha}_patch $suffixa\n+\t\t\t${patchb}_patch $suffixb\n+\t\t\tcmd guilt pop\n+\t\t\tcmd guilt fold $patchb$suffixb\n+\t\t\tfixup_time_info $patcha$suffixa\n+\t\t\tcmd list_files\n+\t\t\tcmd guilt pop\n+\t\t\tcmd guilt delete -f $patcha$suffixa\n+\t\t\tcmd list_files\n+\n+\t\tdone\n+\tdone\n+done\n-- \n1.8.3.1\n"},{"id":"241409","messageId":"1400013065-27919-9-git-send-email-cederp@opera.com","threadId":"36651","inReplyTo":"1400013065-27919-1-git-send-email-cederp@opera.com","subject":"[GUILT v2 08/29] Added more test cases for \"guilt new\": empty patches.","fromName":"Per Cederqvist","fromEmail":"cederp@opera.com","sentAt":"2014-05-13T20:30:44Z","receivedAt":"2014-05-13T20:30:44Z","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":"241410","messageId":"1400013065-27919-10-git-send-email-cederp@opera.com","threadId":"36651","inReplyTo":"1400013065-27919-1-git-send-email-cederp@opera.com","subject":"[GUILT v2 09/29] Test suite: properly check the exit status of commands.","fromName":"Per Cederqvist","fromEmail":"cederp@opera.com","sentAt":"2014-05-13T20:30:45Z","receivedAt":"2014-05-13T20:30:45Z","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":"241413","messageId":"1400013065-27919-11-git-send-email-cederp@opera.com","threadId":"36651","inReplyTo":"1400013065-27919-1-git-send-email-cederp@opera.com","subject":"[GUILT v2 10/29] Run test_failed if the exit status of a test script is bad.","fromName":"Per Cederqvist","fromEmail":"cederp@opera.com","sentAt":"2014-05-13T20:30:46Z","receivedAt":"2014-05-13T20:30:46Z","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 | 10 +++++++---\n 1 file changed, 7 insertions(+), 3 deletions(-)\n\ndiff --git a/regression/run-tests b/regression/run-tests\nindex a10e796..8e0af9f 100755\n--- a/regression/run-tests\n+++ b/regression/run-tests\n@@ -55,11 +55,15 @@ 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\"; then\n+\t\tERR=false\n+\telse\n+\t\tERR=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":"241411","messageId":"1400013065-27919-12-git-send-email-cederp@opera.com","threadId":"36651","inReplyTo":"1400013065-27919-1-git-send-email-cederp@opera.com","subject":"[GUILT v2 11/29] test suite: remove pointless redirection.","fromName":"Per Cederqvist","fromEmail":"cederp@opera.com","sentAt":"2014-05-13T20:30:47Z","receivedAt":"2014-05-13T20:30:47Z","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>\nSigned-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>\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":"241414","messageId":"1400013065-27919-13-git-send-email-cederp@opera.com","threadId":"36651","inReplyTo":"1400013065-27919-1-git-send-email-cederp@opera.com","subject":"[GUILT v2 12/29] \"guilt header\": more robust header selection.","fromName":"Per Cederqvist","fromEmail":"cederp@opera.com","sentAt":"2014-05-13T20:30:48Z","receivedAt":"2014-05-13T20:30:48Z","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 | 28 +++++++++++++++++++++++++---\n 1 file changed, 25 insertions(+), 3 deletions(-)\n\ndiff --git a/guilt-header b/guilt-header\nindex 41e00cc..4701b31 100755\n--- a/guilt-header\n+++ b/guilt-header\n@@ -45,10 +45,32 @@ 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; do\n+\tif [ \"$x\" = \"$patch\" ]; then\n+\t\tfound_patch=\"$patch\"\n+\t\tbreak\n+\tfi\n+done < \"$full_series\"\n+if [ -z \"$found_patch\" ]; 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 ]; then\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 ]; then\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":"241412","messageId":"1400013065-27919-14-git-send-email-cederp@opera.com","threadId":"36651","inReplyTo":"1400013065-27919-1-git-send-email-cederp@opera.com","subject":"[GUILT v2 13/29] Check that \"guilt header '.*'\" fails.","fromName":"Per Cederqvist","fromEmail":"cederp@opera.com","sentAt":"2014-05-13T20:30:49Z","receivedAt":"2014-05-13T20:30:49Z","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":"241416","messageId":"1400013065-27919-15-git-send-email-cederp@opera.com","threadId":"36651","inReplyTo":"1400013065-27919-1-git-send-email-cederp@opera.com","subject":"[GUILT v2 14/29] Use \"git check-ref-format\" to validate patch names.","fromName":"Per Cederqvist","fromEmail":"cederp@opera.com","sentAt":"2014-05-13T20:30:50Z","receivedAt":"2014-05-13T20:30:50Z","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                |  21 ++-\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, 446 insertions(+), 23 deletions(-)\n\ndiff --git a/guilt b/guilt\nindex 3fc524e..23cc2da 100755\n--- a/guilt\n+++ b/guilt\n@@ -132,14 +132,19 @@ 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\"; then\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\" = \"@\" ]; then\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":"241417","messageId":"1400013065-27919-16-git-send-email-cederp@opera.com","threadId":"36651","inReplyTo":"1400013065-27919-1-git-send-email-cederp@opera.com","subject":"[GUILT v2 15/29] Produce legal patch names in guilt-import-commit.","fromName":"Per Cederqvist","fromEmail":"cederp@opera.com","sentAt":"2014-05-13T20:30:51Z","receivedAt":"2014-05-13T20:30:51Z","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  |  20 +-\n regression/t-034.out | 567 +++++++++++++++++++++++++++++++++++++++++++++++++++\n regression/t-034.sh  |  71 +++++++\n 3 files changed, 656 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 f14647c..6260c56 100755\n--- a/guilt-import-commit\n+++ b/guilt-import-commit\n@@ -28,19 +28,35 @@ disp \"Current head: `git rev-parse \\`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\"; then\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\"; then\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..f41f958\n--- /dev/null\n+++ b/regression/t-034.sh\n@@ -0,0 +1,71 @@\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+\tprintf \"%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; 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":"241418","messageId":"1400013065-27919-17-git-send-email-cederp@opera.com","threadId":"36651","inReplyTo":"1400013065-27919-1-git-send-email-cederp@opera.com","subject":"[GUILT v2 16/29] Fix backslash handling when creating names of imported patches.","fromName":"Per Cederqvist","fromEmail":"cederp@opera.com","sentAt":"2014-05-13T20:30:52Z","receivedAt":"2014-05-13T20:30:52Z","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 6260c56..45f2404 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":"241419","messageId":"1400013065-27919-18-git-send-email-cederp@opera.com","threadId":"36651","inReplyTo":"1400013065-27919-1-git-send-email-cederp@opera.com","subject":"[GUILT v2 17/29] \"guilt graph\" no longer loops when no patches are applied.","fromName":"Per Cederqvist","fromEmail":"cederp@opera.com","sentAt":"2014-05-13T20:30:53Z","receivedAt":"2014-05-13T20:30:53Z","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          |  9 +++++++--\n regression/t-033.out |  3 +++\n regression/t-033.sh  | 13 +++++++++++++\n 3 files changed, 23 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..56d0e77 100755\n--- a/guilt-graph\n+++ b/guilt-graph\n@@ -17,8 +17,13 @@ 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\" ]; 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..a3a8981\n--- /dev/null\n+++ b/regression/t-033.sh\n@@ -0,0 +1,13 @@\n+#!/bin/bash\n+#\n+# Test the graph code\n+#\n+\n+source \"$REG_DIR/scaffold\"\n+\n+cmd setup_repo\n+\n+# Check that \"guilt graph\" gives a proper \"No patch applied\" error\n+# message when no patches are applied.  (An older version of guilt\n+# used to enter an endless loop in this situation.)\n+shouldfail guilt graph\n-- \n1.8.3.1\n"},{"id":"241420","messageId":"1400013065-27919-19-git-send-email-cederp@opera.com","threadId":"36651","inReplyTo":"1400013065-27919-1-git-send-email-cederp@opera.com","subject":"[GUILT v2 18/29] guilt-graph: Handle commas in branch names.","fromName":"Per Cederqvist","fromEmail":"cederp@opera.com","sentAt":"2014-05-13T20:30:54Z","receivedAt":"2014-05-13T20:30:54Z","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>\nSigned-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>\n---\n guilt-graph | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/guilt-graph b/guilt-graph\nindex 56d0e77..924a63e 100755\n--- a/guilt-graph\n+++ b/guilt-graph\n@@ -51,7 +51,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":"241421","messageId":"1400013065-27919-20-git-send-email-cederp@opera.com","threadId":"36651","inReplyTo":"1400013065-27919-1-git-send-email-cederp@opera.com","subject":"[GUILT v2 19/29] Check that \"guilt graph\" works when working on a branch with a comma.","fromName":"Per Cederqvist","fromEmail":"cederp@opera.com","sentAt":"2014-05-13T20:30:55Z","receivedAt":"2014-05-13T20:30:55Z","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 | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++++\n regression/t-033.sh  | 39 +++++++++++++++++++++++++++++++\n 2 files changed, 104 insertions(+)\n\ndiff --git a/regression/t-033.out b/regression/t-033.out\nindex 76613f9..3d1c61f 100644\n--- a/regression/t-033.out\n+++ b/regression/t-033.out\n@@ -1,3 +1,68 @@\n % setup_repo\n % guilt graph\n No patch applied.\n+%% Testing branch a,graph\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+%% Adding an unrelated file in a new patch. No deps.\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+%% Changing a file already changed in the first patch adds a dependency.\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 a3a8981..fac081e 100755\n--- a/regression/t-033.sh\n+++ b/regression/t-033.sh\n@@ -3,6 +3,13 @@\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@@ -11,3 +18,35 @@ cmd setup_repo\n # message when no patches are applied.  (An older version of guilt\n # used to enter an endless loop in this situation.)\n shouldfail guilt graph\n+\n+echo \"%% Testing branch a,graph\"\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+echo \"%% Adding an unrelated file in a new patch. 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+echo \"%% Changing a file already changed in the first patch adds 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":"241422","messageId":"1400013065-27919-21-git-send-email-cederp@opera.com","threadId":"36651","inReplyTo":"1400013065-27919-1-git-send-email-cederp@opera.com","subject":"[GUILT v2 20/29] \"guilt graph\": Handle patch names containing quotes.","fromName":"Per Cederqvist","fromEmail":"cederp@opera.com","sentAt":"2014-05-13T20:30:56Z","receivedAt":"2014-05-13T20:30:56Z","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 \"guilt graph\" output.  Otherwise,\nthe \"dot\" file could contain syntax errors.\n\nAdded a test case.\n\nSigned-off-by: Per Cederqvist <cederp@opera.com>\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 924a63e..0857e0d 100755\n--- a/guilt-graph\n+++ b/guilt-graph\n@@ -57,6 +57,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 3d1c61f..c120d4f 100644\n--- a/regression/t-033.out\n+++ b/regression/t-033.out\n@@ -66,3 +66,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 fac081e..9fe1827 100755\n--- a/regression/t-033.sh\n+++ b/regression/t-033.sh\n@@ -50,3 +50,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":"241423","messageId":"1400013065-27919-22-git-send-email-cederp@opera.com","threadId":"36651","inReplyTo":"1400013065-27919-1-git-send-email-cederp@opera.com","subject":"[GUILT v2 21/29] The log.decorate setting should not influence import-commit.","fromName":"Per Cederqvist","fromEmail":"cederp@opera.com","sentAt":"2014-05-13T20:30:57Z","receivedAt":"2014-05-13T20:30:57Z","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>\nSigned-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>\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 45f2404..1da7c8e 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: `git rev-parse \\`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 f41f958..648d009 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; do\n \ttouch -a -m -t \"$TOUCH_DATE\" \"$patch\"\n-- \n1.8.3.1\n"},{"id":"241424","messageId":"1400013065-27919-23-git-send-email-cederp@opera.com","threadId":"36651","inReplyTo":"1400013065-27919-1-git-send-email-cederp@opera.com","subject":"[GUILT v2 22/29] The log.decorate setting should not influence patchbomb.","fromName":"Per Cederqvist","fromEmail":"cederp@opera.com","sentAt":"2014-05-13T20:30:58Z","receivedAt":"2014-05-13T20:30:58Z","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>\nSigned-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>\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":"241427","messageId":"1400013065-27919-24-git-send-email-cederp@opera.com","threadId":"36651","inReplyTo":"1400013065-27919-1-git-send-email-cederp@opera.com","subject":"[GUILT v2 23/29] The log.decorate setting should not influence guilt rebase.","fromName":"Per Cederqvist","fromEmail":"cederp@opera.com","sentAt":"2014-05-13T20:30:59Z","receivedAt":"2014-05-13T20:30:59Z","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>\nSigned-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>\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":"241425","messageId":"1400013065-27919-25-git-send-email-cederp@opera.com","threadId":"36651","inReplyTo":"1400013065-27919-1-git-send-email-cederp@opera.com","subject":"[GUILT v2 24/29] disp no longer processes backslashes.","fromName":"Per Cederqvist","fromEmail":"cederp@opera.com","sentAt":"2014-05-13T20:31:00Z","receivedAt":"2014-05-13T20:31:00Z","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 23cc2da..9947acc 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":"241428","messageId":"1400013065-27919-26-git-send-email-cederp@opera.com","threadId":"36651","inReplyTo":"1400013065-27919-1-git-send-email-cederp@opera.com","subject":"[GUILT v2 25/29] \"guilt push\" now fails when there are no more patches to push.","fromName":"Per Cederqvist","fromEmail":"cederp@opera.com","sentAt":"2014-05-13T20:31:01Z","receivedAt":"2014-05-13T20:31:01Z","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           | 19 ++++++-----\n regression/t-020.out | 89 ++++++++++++++++++++++++++++++++++++++++++++++++++++\n regression/t-020.sh  | 13 +++++++-\n 3 files changed, 113 insertions(+), 8 deletions(-)\n\ndiff --git a/guilt-push b/guilt-push\nindex 67687e7..39c125e 100755\n--- a/guilt-push\n+++ b/guilt-push\n@@ -56,6 +56,12 @@ fi\n patch=\"$1\"\n [ ! -z \"$all\" ] && patch=\"-a\"\n \n+# Treat \"guilt push\" as \"guilt push -n 1\".\n+if [ -z \"$patch\" ]; then\n+\tpatch=1\n+\tnum=t\n+fi\n+\n if [ \"$patch\" = \"-a\" ]; then\n \t# we are supposed to push all patches, get the last one out of\n \t# series\n@@ -65,7 +71,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 +84,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 +110,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":"241426","messageId":"1400013065-27919-27-git-send-email-cederp@opera.com","threadId":"36651","inReplyTo":"1400013065-27919-1-git-send-email-cederp@opera.com","subject":"[GUILT v2 26/29] \"guilt pop\" now fails when there are no more patches to pop.","fromName":"Per Cederqvist","fromEmail":"cederp@opera.com","sentAt":"2014-05-13T20:31:02Z","receivedAt":"2014-05-13T20:31:02Z","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            | 17 +++++++++++------\n regression/t-021.out |  2 ++\n regression/t-021.sh  |  6 ++++++\n regression/t-061.sh  |  6 +++++-\n 4 files changed, 24 insertions(+), 7 deletions(-)\n\ndiff --git a/guilt-pop b/guilt-pop\nindex f0e647f..191313e 100755\n--- a/guilt-pop\n+++ b/guilt-pop\n@@ -49,9 +49,19 @@ fi\n patch=\"$1\"\n [ ! -z \"$all\" ] && patch=\"-a\"\n \n+# Treat \"guilt pop\" as \"guilt pop -n 1\".\n+if [ -z \"$patch\" ]; then\n+\tpatch=1\n+\tnum=t\n+fi\n+\n if [ ! -s \"$applied\" ]; then\n \tdisp \"No patches applied.\"\n-\texit 0\n+\tif [ \"$patch\" = \"-a\" ]; then\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 +78,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..6192f1b 100755\n--- a/regression/t-061.sh\n+++ b/regression/t-061.sh\n@@ -48,7 +48,11 @@ cmd list_files\n \n for i in `seq 5`\n do\n-\tcmd guilt pop\n+\tif [ $i -ge 5 ]; then\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":"241429","messageId":"1400013065-27919-28-git-send-email-cederp@opera.com","threadId":"36651","inReplyTo":"1400013065-27919-1-git-send-email-cederp@opera.com","subject":"[GUILT v2 27/29] Minor testsuite fix.","fromName":"Per Cederqvist","fromEmail":"cederp@opera.com","sentAt":"2014-05-13T20:31:03Z","receivedAt":"2014-05-13T20:31:03Z","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>\nSigned-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>\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 6192f1b..db26e12 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":"241430","messageId":"1400013065-27919-29-git-send-email-cederp@opera.com","threadId":"36651","inReplyTo":"1400013065-27919-1-git-send-email-cederp@opera.com","subject":"[GUILT v2 28/29] Added guilt.reusebranch configuration option.","fromName":"Per Cederqvist","fromEmail":"cederp@opera.com","sentAt":"2014-05-13T20:31:04Z","receivedAt":"2014-05-13T20:31:04Z","isPatch":false,"sender":{"key":"cederp@opera.com","avatar":"https://gravatar.com/avatar/008fe28caedea0ba34042cd5157705267934f4ba7a9b29fb248ae18ec5b3055e?d=mp&s=160"},"body":"When 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                |  28 +++-\n regression/scaffold  |   1 +\n regression/t-062.out | 441 +++++++++++++++++++++++++++++++++++++++++++++++++++\n regression/t-062.sh  | 137 ++++++++++++++++\n 4 files changed, 601 insertions(+), 6 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 9947acc..7c830eb 100755\n--- a/guilt\n+++ b/guilt\n@@ -853,6 +853,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@@ -864,6 +867,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@@ -928,13 +935,22 @@ else\n \tdie \"Unsupported operating system: $UNAME_S\"\n fi\n \n-if [ \"$branch\" = \"$raw_git_branch\" ] && [ -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+if [ -n \"`get_top 2>/dev/null`\" ]; then\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\" ]; then\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; then\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..85596ca\n--- /dev/null\n+++ b/regression/t-062.sh\n@@ -0,0 +1,137 @@\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; then\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`; do\n+\tif [ $i -ge 5 ]; then\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":"241431","messageId":"1400013065-27919-30-git-send-email-cederp@opera.com","threadId":"36651","inReplyTo":"1400013065-27919-1-git-send-email-cederp@opera.com","subject":"[GUILT v2 29/29] Added a short style guide, and Emacs settings.","fromName":"Per Cederqvist","fromEmail":"cederp@opera.com","sentAt":"2014-05-13T20:31:05Z","receivedAt":"2014-05-13T20:31:05Z","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 .dir-locals.el             |  3 +++\n Documentation/Contributing | 15 +++++++++++++++\n 2 files changed, 18 insertions(+)\n create mode 100644 .dir-locals.el\n\ndiff --git a/.dir-locals.el b/.dir-locals.el\nnew file mode 100644\nindex 0000000..50ef2b7\n--- /dev/null\n+++ b/.dir-locals.el\n@@ -0,0 +1,3 @@\n+((nil . ((indent-tabs-mode . t)\n+\t (tab-width . 8)))\n+ (sh-mode . ((sh-basic-offset . 8))))\ndiff --git a/Documentation/Contributing b/Documentation/Contributing\nindex abf3480..0da49d6 100644\n--- a/Documentation/Contributing\n+++ b/Documentation/Contributing\n@@ -4,6 +4,21 @@ Documentation/SubmittingPatches file. :)\n \n 1) Hack on the code a bit\n \n+Please follow this style guide:\n+\n+ - Use tabs for indentation.\n+\n+ - Put \"then\" on the same line as \"if\".\n+\n+ - Follow the style of the existing code, except if it breaks the\n+   above guidlines.\n+\n+ - If you change the code to conform to the style guide, please do so\n+   in a separate commit that does not change anything else.\n+\n+Please check that you change does not break \"make test\".  Please add\n+new testcases for any new functionality, and if you fix a bug.\n+\n 2) Make a patch:\n \n Use \"diff -up\" or \"diff -uprN\" to create patches. Or simply use git to\n-- \n1.8.3.1\n"},{"id":"241433","messageId":"20140513204546.GB11391@thunk.org","threadId":"36651","inReplyTo":"1400013065-27919-1-git-send-email-cederp@opera.com","subject":"Re: [GUILT v2 00/29] Teach guilt import-commit how to create legal patch names, and more","fromName":"Theodore Ts'o","fromEmail":"tytso@mit.edu","sentAt":"2014-05-13T20:45:47Z","receivedAt":"2014-05-13T20:45:47Z","isPatch":false,"sender":{"key":"tytso@mit.edu","avatar":"https://avatars.githubusercontent.com/u/51416?v=4"},"body":"On Tue, May 13, 2014 at 10:30:36PM +0200, 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\nThanks, I ran into this just last night (although I had manually\ncreated the patch file from an e-mail I received instead of using\n\"guilt import-commit\").\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\nWe've been living with the \"origin\" -> \"guilt/origin\" branch change\nfor a year already, and in fact, these days I've gotten used to the\nnew behavior.  Is it really worth it to change the default?\n\n    \t       \t     \t    \t     \t       - Ted\n"},{"id":"241434","messageId":"20140513205443.GB4791@meili.valhalla.31bits.net","threadId":"36651","inReplyTo":"20140513204546.GB11391@thunk.org","subject":"Re: [GUILT v2 00/29] Teach guilt import-commit how to create legal patch names, and more","fromName":"Jeff Sipek","fromEmail":"jeffpc@josefsipek.net","sentAt":"2014-05-13T20:54:44Z","receivedAt":"2014-05-13T20:54:44Z","isPatch":false,"sender":{"key":"jeffpc@josefsipek.net","avatar":null},"body":"On Tue, May 13, 2014 at 04:45:47PM -0400, Theodore Ts'o wrote:\n> On Tue, May 13, 2014 at 10:30:36PM +0200, Per Cederqvist wrote:\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> \n> We've been living with the \"origin\" -> \"guilt/origin\" branch change\n> for a year already, and in fact, these days I've gotten used to the\n> new behavior.  Is it really worth it to change the default?\n\nSo, at first I was skeptical about the branch name prefix change.  I've used\nit for about a year now, and I love it.  When I first read Per's idea to\nchange the default to the old-style, I was a bit sad but I understand the\nmotivation.\n\nI'm open to either mode being the default since it's easy enough for me to\nchange it for me (thanks, ~/.gitconfig) but I think more people should\nbenefit from the added safety against accidental git-push.  (I also like\nbeing able to use guilt/master..master to get only the commits I care\nabout.)  Thoughts?\n\nJeff.\n\n-- \nIntellectuals solve problems; geniuses prevent them\n\t\t- Albert Einstein\n"},{"id":"241435","messageId":"20140513210016.GC4791@meili.valhalla.31bits.net","threadId":"36651","inReplyTo":"1400013065-27919-30-git-send-email-cederp@opera.com","subject":"Re: [GUILT v2 29/29] Added a short style guide, and Emacs settings.","fromName":"Jeff Sipek","fromEmail":"jeffpc@josefsipek.net","sentAt":"2014-05-13T21:00:16Z","receivedAt":"2014-05-13T21:00:16Z","isPatch":false,"sender":{"key":"jeffpc@josefsipek.net","avatar":null},"body":"On Tue, May 13, 2014 at 10:31:05PM +0200, Per Cederqvist wrote:\n> Signed-off-by: Per Cederqvist <cederp@opera.com>\n> ---\n>  .dir-locals.el             |  3 +++\n>  Documentation/Contributing | 15 +++++++++++++++\n>  2 files changed, 18 insertions(+)\n>  create mode 100644 .dir-locals.el\n> \n> diff --git a/.dir-locals.el b/.dir-locals.el\n> new file mode 100644\n> index 0000000..50ef2b7\n> --- /dev/null\n> +++ b/.dir-locals.el\n> @@ -0,0 +1,3 @@\n> +((nil . ((indent-tabs-mode . t)\n> +\t (tab-width . 8)))\n> + (sh-mode . ((sh-basic-offset . 8))))\n\nI'll have to trust you on this one.  All I see is a bunch of cons cells :)\n\n> diff --git a/Documentation/Contributing b/Documentation/Contributing\n> index abf3480..0da49d6 100644\n> --- a/Documentation/Contributing\n> +++ b/Documentation/Contributing\n> @@ -4,6 +4,21 @@ Documentation/SubmittingPatches file. :)\n>  \n>  1) Hack on the code a bit\n>  \n> +Please follow this style guide:\n> +\n> + - Use tabs for indentation.\n> +\n> + - Put \"then\" on the same line as \"if\".\n> +\n> + - Follow the style of the existing code, except if it breaks the\n> +   above guidlines.\n> +\n> + - If you change the code to conform to the style guide, please do so\n> +   in a separate commit that does not change anything else.\n> +\n> +Please check that you change does not break \"make test\".  Please add\n> +new testcases for any new functionality, and if you fix a bug.\n> +\n\nAdding this blurb here is a good idea.  Thanks!\n\nSigned-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>\n\n>  2) Make a patch:\n>  \n>  Use \"diff -up\" or \"diff -uprN\" to create patches. Or simply use git to\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":"241439","messageId":"20140513210644.GD4791@meili.valhalla.31bits.net","threadId":"36651","inReplyTo":"1400013065-27919-5-git-send-email-cederp@opera.com","subject":"Re: [GUILT v2 04/29] Allow \"guilt import-commit\" to run from a dir which contains spaces.","fromName":"Jeff Sipek","fromEmail":"jeffpc@josefsipek.net","sentAt":"2014-05-13T21:06:44Z","receivedAt":"2014-05-13T21:06:44Z","isPatch":false,"sender":{"key":"jeffpc@josefsipek.net","avatar":null},"body":"Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>\n\nOn Tue, May 13, 2014 at 10:30:40PM +0200, 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..f14647c 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: `git rev-parse \\`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: `git rev-parse \\`git_branch\\``\" >&2\n>  \n>  }\n> -- \n> 1.8.3.1\n> \n\n-- \nOnce you have their hardware. Never give it back.\n(The First Rule of Hardware Acquisition)\n"},{"id":"241441","messageId":"20140513211326.GE4791@meili.valhalla.31bits.net","threadId":"36651","inReplyTo":"1400013065-27919-7-git-send-email-cederp@opera.com","subject":"Re: [GUILT v2 06/29] Fix the do_get_patch function.","fromName":"Jeff Sipek","fromEmail":"jeffpc@josefsipek.net","sentAt":"2014-05-13T21:13:27Z","receivedAt":"2014-05-13T21:13:27Z","isPatch":false,"sender":{"key":"jeffpc@josefsipek.net","avatar":null},"body":"On Tue, May 13, 2014 at 10:30:42PM +0200, Per Cederqvist wrote:\n> A patch file consists of:\n> \n> (1) the description\n> (2) optional diffstat\n> (3) the patches\n> \n> When extracting the patch, we only want part 3.  The do_get_patch used\n> to give us part 2 and part 3.  That made for instance this series of\n> operations fail if guilt.diffstat is true:\n> \n>     guilt push empty-1\n>     guilt push empty-2\n>     guilt pop\n>     guilt fold empty-2\n>     guilt pop\n>     guilt push\n\nI would probably include the actual error here.  I got the following (using\npatch names a & b):\n\n$ guilt pop\nNow at a.\n$ guilt fold b\nerror: No changes\n$ guilt pop\nAll patches popped.\n$ guilt pu\nApplying patch..a\nerror: No changes\nTo force apply this patch, use 'guilt push -f'\n\n\nThe diff itself is good.\n\nSigned-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>\n\n> \n> Signed-off-by: Per Cederqvist <cederp@opera.com>\n> ---\n>  guilt | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n> \n> diff --git a/guilt b/guilt\n> index 8701481..3fc524e 100755\n> --- a/guilt\n> +++ b/guilt\n> @@ -334,7 +334,7 @@ do_get_patch()\n>  {\n>  \tawk '\n>  BEGIN{}\n> -/^(diff |---$|--- )/ {patch = 1}\n> +/^(diff |--- )/ {patch = 1}\n>  patch == 1 {print $0}\n>  END{}\n>  ' < \"$1\"\n> -- \n> 1.8.3.1\n> \n\n-- \nI already backed up the [server] once, I can do it again.\n\t\t- a sysadmin threatening to do more frequent backups\n"},{"id":"241444","messageId":"CAP=KgsTvt7btB0EO75UeW2SejeXm9u7nfPLf0J2M+Y2H=u9s5w@mail.gmail.com","threadId":"36651","inReplyTo":"20140513205443.GB4791@meili.valhalla.31bits.net","subject":"Re: [GUILT v2 00/29] Teach guilt import-commit how to create legal patch names, and more","fromName":"Per Cederqvist","fromEmail":"cederp@opera.com","sentAt":"2014-05-13T21:29:55Z","receivedAt":"2014-05-13T21:29:55Z","isPatch":false,"sender":{"key":"cederp@opera.com","avatar":"https://gravatar.com/avatar/008fe28caedea0ba34042cd5157705267934f4ba7a9b29fb248ae18ec5b3055e?d=mp&s=160"},"body":"On Tue, May 13, 2014 at 10:54 PM, Jeff Sipek <jeffpc@josefsipek.net> wrote:\n> On Tue, May 13, 2014 at 04:45:47PM -0400, Theodore Ts'o wrote:\n>> On Tue, May 13, 2014 at 10:30:36PM +0200, Per Cederqvist wrote:\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>>\n>> We've been living with the \"origin\" -> \"guilt/origin\" branch change\n>> for a year already, and in fact, these days I've gotten used to the\n>> new behavior.  Is it really worth it to change the default?\n>\n> So, at first I was skeptical about the branch name prefix change.  I've used\n> it for about a year now, and I love it.  When I first read Per's idea to\n> change the default to the old-style, I was a bit sad but I understand the\n> motivation.\n>\n> I'm open to either mode being the default since it's easy enough for me to\n> change it for me (thanks, ~/.gitconfig) but I think more people should\n> benefit from the added safety against accidental git-push.  (I also like\n> being able to use guilt/master..master to get only the commits I care\n> about.)  Thoughts?\n\nI don't have a strong opinion on which the default value should be.\nThe scenario where it matters, when you run multiple versions of\nguilt against the same directory, is probably very rare in practice.\nIf it is mentioned in the release note that it can be changed if needed,\nthat is probably good enough.\n\n    /ceder\n"},{"id":"241445","messageId":"20140513213024.GF4791@meili.valhalla.31bits.net","threadId":"36651","inReplyTo":"1400013065-27919-8-git-send-email-cederp@opera.com","subject":"Re: [GUILT v2 07/29] Added test cases for \"guilt fold\".","fromName":"Jeff Sipek","fromEmail":"jeffpc@josefsipek.net","sentAt":"2014-05-13T21:30:24Z","receivedAt":"2014-05-13T21:30:24Z","isPatch":false,"sender":{"key":"jeffpc@josefsipek.net","avatar":null},"body":"On Tue, May 13, 2014 at 10:30:43PM +0200, 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> Signed-off-by: Per Cederqvist <cederp@opera.com>\n> ---\n>  regression/t-035.out | 467 +++++++++++++++++++++++++++++++++++++++++++++++++++\n>  regression/t-035.sh  |  62 +++++++\n>  2 files changed, 529 insertions(+)\n>  create mode 100644 regression/t-035.out\n>  create mode 100755 regression/t-035.sh\n>\n...\n> diff --git a/regression/t-035.sh b/regression/t-035.sh\n> new file mode 100755\n> index 0000000..e914b32\n> --- /dev/null\n> +++ b/regression/t-035.sh\n> @@ -0,0 +1,62 @@\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 empty_patch\n> +{\n> +\tcmd guilt new \"empty$1\"\n> +\tfixup_time_info \"empty$1\"\n> +}\n> +\n> +function nonempty_patch\n> +{\n> +\tif [ \"$1\" = -2 ]; then\n> +\t\tmsg=\"Another commit message.\"\n> +\telse\n> +\t\tmsg=\"A commit message.\"\n> +\tfi\n> +\n> +\tcmd guilt new -f -s -m \"$msg\" \"nonempty$1\"\n> +\tfixup_time_info \"nonempty$1\"\n> +}\n> +\n> +for using_diffstat in true false; do\n> +\tcmd git config guilt.diffstat $using_diffstat\n> +\tfor patcha in empty nonempty; do\n> +\t\tfor patchb in empty nonempty; do\n> +\n> +\t\t\tif [ $patcha = $patchb ]\n> +\t\t\tthen\n\nI know that this is before patch 29, but ... style? ;)\n\nOtherwise, looks good.  I like this way better than the unrolled loop in v1\nof this patch.\n\nSigned-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>\n\n\n> +\t\t\t\tsuffixa=-1\n> +\t\t\t\tsuffixb=-2\n> +\t\t\telse\n> +\t\t\t\tsuffixa=\n> +\t\t\t\tsuffixb=\n> +\t\t\tfi\n> +\n> +\t\t\techo \"%% $patcha + $patchb (diffstat=$using_diffstat)\"\n> +\t\t\t${patcha}_patch $suffixa\n> +\t\t\t${patchb}_patch $suffixb\n> +\t\t\tcmd guilt pop\n> +\t\t\tcmd guilt fold $patchb$suffixb\n> +\t\t\tfixup_time_info $patcha$suffixa\n> +\t\t\tcmd list_files\n> +\t\t\tcmd guilt pop\n> +\t\t\tcmd guilt delete -f $patcha$suffixa\n> +\t\t\tcmd list_files\n> +\n> +\t\tdone\n> +\tdone\n> +done\n> -- \n> 1.8.3.1\n> \n\n-- \n*NOTE: This message is ROT-13 encrypted twice for extra protection*\n"},{"id":"241449","messageId":"20140513213659.GH4791@meili.valhalla.31bits.net","threadId":"36651","inReplyTo":"1400013065-27919-20-git-send-email-cederp@opera.com","subject":"Re: [GUILT v2 19/29] Check that \"guilt graph\" works when working on a branch with a comma.","fromName":"Jeff Sipek","fromEmail":"jeffpc@josefsipek.net","sentAt":"2014-05-13T21:36:59Z","receivedAt":"2014-05-13T21:36:59Z","isPatch":false,"sender":{"key":"jeffpc@josefsipek.net","avatar":null},"body":"Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>\n\n\nOn Tue, May 13, 2014 at 10:30:55PM +0200, 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 | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++++\n>  regression/t-033.sh  | 39 +++++++++++++++++++++++++++++++\n>  2 files changed, 104 insertions(+)\n> \n> diff --git a/regression/t-033.out b/regression/t-033.out\n> index 76613f9..3d1c61f 100644\n> --- a/regression/t-033.out\n> +++ b/regression/t-033.out\n> @@ -1,3 +1,68 @@\n>  % setup_repo\n>  % guilt graph\n>  No patch applied.\n> +%% Testing branch a,graph\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> +%% Adding an unrelated file in a new patch. No deps.\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> +%% Changing a file already changed in the first patch adds a dependency.\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 a3a8981..fac081e 100755\n> --- a/regression/t-033.sh\n> +++ b/regression/t-033.sh\n> @@ -3,6 +3,13 @@\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> @@ -11,3 +18,35 @@ cmd setup_repo\n>  # message when no patches are applied.  (An older version of guilt\n>  # used to enter an endless loop in this situation.)\n>  shouldfail guilt graph\n> +\n> +echo \"%% Testing branch a,graph\"\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> +echo \"%% Adding an unrelated file in a new patch. 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> +echo \"%% Changing a file already changed in the first patch adds 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-- \nResearch, n.:\n  Consider Columbus:\n    He didn't know where he was going.\n    When he got there he didn't know where he was.\n    When he got back he didn't know where he had been.\n    And he did it all on someone else's money.\n"},{"id":"241451","messageId":"20140513214114.GI4791@meili.valhalla.31bits.net","threadId":"36651","inReplyTo":"1400013065-27919-26-git-send-email-cederp@opera.com","subject":"Re: [GUILT v2 25/29] \"guilt push\" now fails when there are no more patches to push.","fromName":"Jeff Sipek","fromEmail":"jeffpc@josefsipek.net","sentAt":"2014-05-13T21:41:14Z","receivedAt":"2014-05-13T21:41:14Z","isPatch":false,"sender":{"key":"jeffpc@josefsipek.net","avatar":null},"body":"On Tue, May 13, 2014 at 10:31:01PM +0200, 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           | 19 ++++++-----\n>  regression/t-020.out | 89 ++++++++++++++++++++++++++++++++++++++++++++++++++++\n>  regression/t-020.sh  | 13 +++++++-\n>  3 files changed, 113 insertions(+), 8 deletions(-)\n...\n> diff --git a/regression/t-020.sh b/regression/t-020.sh\n> index 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\nI don't particularly care for the git-log.  Otherwise it looks good.\n\nSigned-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>\n\n\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> -- \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":"241452","messageId":"20140513214419.GJ4791@meili.valhalla.31bits.net","threadId":"36651","inReplyTo":"1400013065-27919-25-git-send-email-cederp@opera.com","subject":"Re: [GUILT v2 24/29] disp no longer processes backslashes.","fromName":"Jeff Sipek","fromEmail":"jeffpc@josefsipek.net","sentAt":"2014-05-13T21:44:19Z","receivedAt":"2014-05-13T21:44:19Z","isPatch":false,"sender":{"key":"jeffpc@josefsipek.net","avatar":null},"body":"On Tue, May 13, 2014 at 10:31:00PM +0200, 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> code %s instead of \"%b\".\n\nMinor nit: \"%s\" (to match \"%b\")\n\nSigned-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>\n\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 23cc2da..9947acc 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-- \nReality is merely an illusion, albeit a very persistent one.\n\t\t- Albert Einstein\n"},{"id":"241453","messageId":"20140513214917.GK4791@meili.valhalla.31bits.net","threadId":"36651","inReplyTo":"1400013065-27919-21-git-send-email-cederp@opera.com","subject":"Re: [GUILT v2 20/29] \"guilt graph\": Handle patch names containing quotes.","fromName":"Jeff Sipek","fromEmail":"jeffpc@josefsipek.net","sentAt":"2014-05-13T21:49:17Z","receivedAt":"2014-05-13T21:49:17Z","isPatch":false,"sender":{"key":"jeffpc@josefsipek.net","avatar":null},"body":"On Tue, May 13, 2014 at 10:30:56PM +0200, Per Cederqvist wrote:\n> Quote quotes with a backslash in the \"guilt graph\" output.  Otherwise,\n> the \"dot\" file could contain syntax errors.\n> \n> Added a test case.\n> \n> Signed-off-by: Per Cederqvist <cederp@opera.com>\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 924a63e..0857e0d 100755\n> --- a/guilt-graph\n> +++ b/guilt-graph\n> @@ -57,6 +57,8 @@ while [ \"$current\" != \"$base\" ]; do\n>  }\"`\n>  \t[ -z \"$pname\" ] && pname=\"?\"\n>  \n> +\tpname=\"`printf \\\"%s\\\" \\\"$pname\\\" | sed 's/\\\"/\\\\\\\\\\\"/g'`\"\n\nSigned-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>\n\n\n> +\n>  \tdisp \"# checking rev $current\"\n>  \tdisp \"\t\\\"$current\\\" [label=\\\"$pname\\\"]\"\n>  \n> diff --git a/regression/t-033.out b/regression/t-033.out\n> index 3d1c61f..c120d4f 100644\n> --- a/regression/t-033.out\n> +++ b/regression/t-033.out\n> @@ -66,3 +66,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> +}\n> diff --git a/regression/t-033.sh b/regression/t-033.sh\n> index fac081e..9fe1827 100755\n> --- a/regression/t-033.sh\n> +++ b/regression/t-033.sh\n> @@ -50,3 +50,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-- \nC is quirky, flawed, and an enormous success.\n\t\t- Dennis M. Ritchie.\n"},{"id":"241454","messageId":"20140513215353.GL4791@meili.valhalla.31bits.net","threadId":"36651","inReplyTo":"1400013065-27919-18-git-send-email-cederp@opera.com","subject":"Re: [GUILT v2 17/29] \"guilt graph\" no longer loops when no patches are applied.","fromName":"Jeff Sipek","fromEmail":"jeffpc@josefsipek.net","sentAt":"2014-05-13T21:53:53Z","receivedAt":"2014-05-13T21:53:53Z","isPatch":false,"sender":{"key":"jeffpc@josefsipek.net","avatar":null},"body":"Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>\n\nOn Tue, May 13, 2014 at 10:30:53PM +0200, 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          |  9 +++++++--\n>  regression/t-033.out |  3 +++\n>  regression/t-033.sh  | 13 +++++++++++++\n>  3 files changed, 23 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..56d0e77 100755\n> --- a/guilt-graph\n> +++ b/guilt-graph\n> @@ -17,8 +17,13 @@ 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\" ]; 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..a3a8981\n> --- /dev/null\n> +++ b/regression/t-033.sh\n> @@ -0,0 +1,13 @@\n> +#!/bin/bash\n> +#\n> +# Test the graph code\n> +#\n> +\n> +source \"$REG_DIR/scaffold\"\n> +\n> +cmd setup_repo\n> +\n> +# Check that \"guilt graph\" gives a proper \"No patch applied\" error\n> +# message when no patches are applied.  (An older version of guilt\n> +# used to enter an endless loop in this situation.)\n> +shouldfail guilt graph\n> -- \n> 1.8.3.1\n> \n\n-- \nReality is merely an illusion, albeit a very persistent one.\n\t\t- Albert Einstein\n"},{"id":"241455","messageId":"20140513215850.GM4791@meili.valhalla.31bits.net","threadId":"36651","inReplyTo":"1400013065-27919-11-git-send-email-cederp@opera.com","subject":"Re: [GUILT v2 10/29] Run test_failed if the exit status of a test script is bad.","fromName":"Jeff Sipek","fromEmail":"jeffpc@josefsipek.net","sentAt":"2014-05-13T21:58:50Z","receivedAt":"2014-05-13T21:58:50Z","isPatch":false,"sender":{"key":"jeffpc@josefsipek.net","avatar":null},"body":"Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>\n\nOn Tue, May 13, 2014 at 10:30:46PM +0200, 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> \n> Signed-off-by: Per Cederqvist <cederp@opera.com>\n> ---\n>  regression/run-tests | 10 +++++++---\n>  1 file changed, 7 insertions(+), 3 deletions(-)\n> \n> diff --git a/regression/run-tests b/regression/run-tests\n> index a10e796..8e0af9f 100755\n> --- a/regression/run-tests\n> +++ b/regression/run-tests\n> @@ -55,11 +55,15 @@ 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\"; then\n> +\t\tERR=false\n> +\telse\n> +\t\tERR=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> -- \n> 1.8.3.1\n> \n\n-- \nReality is merely an illusion, albeit a very persistent one.\n\t\t- Albert Einstein\n"},{"id":"241457","messageId":"20140513220957.GN4791@meili.valhalla.31bits.net","threadId":"36651","inReplyTo":"1400013065-27919-17-git-send-email-cederp@opera.com","subject":"Re: [GUILT v2 16/29] Fix backslash handling when creating names of imported patches.","fromName":"Jeff Sipek","fromEmail":"jeffpc@josefsipek.net","sentAt":"2014-05-13T22:09:57Z","receivedAt":"2014-05-13T22:09:57Z","isPatch":false,"sender":{"key":"jeffpc@josefsipek.net","avatar":null},"body":"On Tue, May 13, 2014 at 10:30:52PM +0200, Per Cederqvist wrote:\n> The 'echo %s' construct sometimes processes escape sequences.  (This\n\n%s?  Should this be $s?\n\nOtherwise, looks good.\n\n> happens, for instance, under Ubuntu 14.04 when /bin/sh is actually\n> dash.)  We don't want that to happen when we are importing commits, so\n> use 'printf %s \"$s\"' instead.\n> \n> (The -E option of bash that explicitly disables backslash expansion is\n> not portable; it is not supported by dash.)\n> \n> Signed-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> \n> diff --git a/guilt-import-commit b/guilt-import-commit\n> index 6260c56..45f2404 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`\n> diff --git a/regression/t-034.out b/regression/t-034.out\n> index 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> -- \n> 1.8.3.1\n> \n\n-- \nI have always wished for my computer to be as easy to use as my telephone;\nmy wish has come true because I can no longer figure out how to use my\ntelephone.\n\t\t- Bjarne Stroustrup\n"},{"id":"241458","messageId":"20140513222304.GO4791@meili.valhalla.31bits.net","threadId":"36651","inReplyTo":"1400013065-27919-27-git-send-email-cederp@opera.com","subject":"Re: [GUILT v2 26/29] \"guilt pop\" now fails when there are no more patches to pop.","fromName":"Jeff Sipek","fromEmail":"jeffpc@josefsipek.net","sentAt":"2014-05-13T22:23:04Z","receivedAt":"2014-05-13T22:23:04Z","isPatch":false,"sender":{"key":"jeffpc@josefsipek.net","avatar":null},"body":"Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>\n\nOn Tue, May 13, 2014 at 10:31:02PM +0200, Per Cederqvist wrote:\n> This is analogous to how \"guilt push\" now fails when there are no more\n> patches to push.  Like push, the \"--all\" argument still succeeds even\n> if there was no need to pop anything.\n> \n> Updated the test suite.\n> \n> Signed-off-by: Per Cederqvist <cederp@opera.com>\n> ---\n>  guilt-pop            | 17 +++++++++++------\n>  regression/t-021.out |  2 ++\n>  regression/t-021.sh  |  6 ++++++\n>  regression/t-061.sh  |  6 +++++-\n>  4 files changed, 24 insertions(+), 7 deletions(-)\n> \n> diff --git a/guilt-pop b/guilt-pop\n> index f0e647f..191313e 100755\n> --- a/guilt-pop\n> +++ b/guilt-pop\n> @@ -49,9 +49,19 @@ fi\n>  patch=\"$1\"\n>  [ ! -z \"$all\" ] && patch=\"-a\"\n>  \n> +# Treat \"guilt pop\" as \"guilt pop -n 1\".\n> +if [ -z \"$patch\" ]; then\n> +\tpatch=1\n> +\tnum=t\n> +fi\n> +\n>  if [ ! -s \"$applied\" ]; then\n>  \tdisp \"No patches applied.\"\n> -\texit 0\n> +\tif [ \"$patch\" = \"-a\" ]; then\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 +78,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\n> diff --git a/regression/t-021.out b/regression/t-021.out\n> index 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.\n> diff --git a/regression/t-021.sh b/regression/t-021.sh\n> index 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\n> diff --git a/regression/t-061.sh b/regression/t-061.sh\n> index 1411baa..6192f1b 100755\n> --- a/regression/t-061.sh\n> +++ b/regression/t-061.sh\n> @@ -48,7 +48,11 @@ cmd list_files\n>  \n>  for i in `seq 5`\n>  do\n> -\tcmd guilt pop\n> +\tif [ $i -ge 5 ]; then\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> -- \n> 1.8.3.1\n> \n\n-- \nLinux, n.:\n  Generous programmers from around the world all join forces to help\n  you shoot yourself in the foot for free. \n"},{"id":"241482","messageId":"CAP=KgsTDXkVEpKDVwqhbjY7hGLe97htDjBmiTb-zB7g6WvvKpA@mail.gmail.com","threadId":"36651","inReplyTo":"20140513211326.GE4791@meili.valhalla.31bits.net","subject":"Re: [GUILT v2 06/29] Fix the do_get_patch function.","fromName":"Per Cederqvist","fromEmail":"cederp@opera.com","sentAt":"2014-05-14T08:46:31Z","receivedAt":"2014-05-14T08:46:31Z","isPatch":false,"sender":{"key":"cederp@opera.com","avatar":"https://gravatar.com/avatar/008fe28caedea0ba34042cd5157705267934f4ba7a9b29fb248ae18ec5b3055e?d=mp&s=160"},"body":"On Tue, May 13, 2014 at 11:13 PM, Jeff Sipek <jeffpc@josefsipek.net> wrote:\n\n> On Tue, May 13, 2014 at 10:30:42PM +0200, Per Cederqvist wrote:\n>> A patch file consists of:\n>>\n>> (1) the description\n>> (2) optional diffstat\n>> (3) the patches\n>>\n>> When extracting the patch, we only want part 3.  The do_get_patch used\n>> to give us part 2 and part 3.  That made for instance this series of\n>> operations fail if guilt.diffstat is true:\n>>\n>>     guilt push empty-1\n>>     guilt push empty-2\n>>     guilt pop\n>>     guilt fold empty-2\n>>     guilt pop\n>>     guilt push\n>\n> I would probably include the actual error here.  I got the following (using\n> patch names a & b):\n>\n> $ guilt pop\n> Now at a.\n> $ guilt fold b\n> error: No changes\n> $ guilt pop\n> All patches popped.\n> $ guilt pu\n> Applying patch..a\n> error: No changes\n> To force apply this patch, use 'guilt push -f'\n\nA bit strange.  I see that I made an error in the commands. It should be\n\"guilt new empty-1\" and \"guilt new empty-2\".  The updated example in the\ncommit message looks like this:\n\n    $ guilt new empty-1\n    $ guilt new empty-2\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    fatal: unrecognized input\n    To force apply this patch, use 'guilt push -f'\n\n> The diff itself is good.\n>\n> Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>\n\nUnless you object I'll add this signed-off line even though I'm\nimproving the commit message in preparation for version 3\nof the patch series.\n\n    /ceder\n\n>>\n>> Signed-off-by: Per Cederqvist <cederp@opera.com>\n>> ---\n>>  guilt | 2 +-\n>>  1 file changed, 1 insertion(+), 1 deletion(-)\n>>\n>> diff --git a/guilt b/guilt\n>> index 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>> 1.8.3.1\n>>\n>\n> --\n> I already backed up the [server] once, I can do it again.\n>                 - a sysadmin threatening to do more frequent backups\n"},{"id":"241483","messageId":"CAP=KgsTNP0L98Pdnyd5qZ9422+xGmomcpVVMSAD+2DHRAa0KkA@mail.gmail.com","threadId":"36651","inReplyTo":"20140513213024.GF4791@meili.valhalla.31bits.net","subject":"Re: [GUILT v2 07/29] Added test cases for \"guilt fold\".","fromName":"Per Cederqvist","fromEmail":"cederp@opera.com","sentAt":"2014-05-14T08:49:51Z","receivedAt":"2014-05-14T08:49:51Z","isPatch":false,"sender":{"key":"cederp@opera.com","avatar":"https://gravatar.com/avatar/008fe28caedea0ba34042cd5157705267934f4ba7a9b29fb248ae18ec5b3055e?d=mp&s=160"},"body":"On Tue, May 13, 2014 at 11:30 PM, Jeff Sipek <jeffpc@josefsipek.net> wrote:\n> On Tue, May 13, 2014 at 10:30:43PM +0200, 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>> Signed-off-by: Per Cederqvist <cederp@opera.com>\n>> ---\n>>  regression/t-035.out | 467 +++++++++++++++++++++++++++++++++++++++++++++++++++\n>>  regression/t-035.sh  |  62 +++++++\n>>  2 files changed, 529 insertions(+)\n>>  create mode 100644 regression/t-035.out\n>>  create mode 100755 regression/t-035.sh\n>>\n> ...\n>> diff --git a/regression/t-035.sh b/regression/t-035.sh\n>> new file mode 100755\n>> index 0000000..e914b32\n>> --- /dev/null\n>> +++ b/regression/t-035.sh\n>> @@ -0,0 +1,62 @@\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 empty_patch\n>> +{\n>> +     cmd guilt new \"empty$1\"\n>> +     fixup_time_info \"empty$1\"\n>> +}\n>> +\n>> +function nonempty_patch\n>> +{\n>> +     if [ \"$1\" = -2 ]; then\n>> +             msg=\"Another commit message.\"\n>> +     else\n>> +             msg=\"A commit message.\"\n>> +     fi\n>> +\n>> +     cmd guilt new -f -s -m \"$msg\" \"nonempty$1\"\n>> +     fixup_time_info \"nonempty$1\"\n>> +}\n>> +\n>> +for using_diffstat in true false; do\n>> +     cmd git config guilt.diffstat $using_diffstat\n>> +     for patcha in empty nonempty; do\n>> +             for patchb in empty nonempty; do\n>> +\n>> +                     if [ $patcha = $patchb ]\n>> +                     then\n>\n> I know that this is before patch 29, but ... style? ;)\n>\n> Otherwise, looks good.  I like this way better than the unrolled loop in v1\n> of this patch.\n>\n> Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>\n\nIt is hard to change a habit. :-)\n\nI'll fix this and add your signed-off-by.\n\n    /ceder\n\n>\n>> +                             suffixa=-1\n>> +                             suffixb=-2\n>> +                     else\n>> +                             suffixa=\n>> +                             suffixb=\n>> +                     fi\n>> +\n>> +                     echo \"%% $patcha + $patchb (diffstat=$using_diffstat)\"\n>> +                     ${patcha}_patch $suffixa\n>> +                     ${patchb}_patch $suffixb\n>> +                     cmd guilt pop\n>> +                     cmd guilt fold $patchb$suffixb\n>> +                     fixup_time_info $patcha$suffixa\n>> +                     cmd list_files\n>> +                     cmd guilt pop\n>> +                     cmd guilt delete -f $patcha$suffixa\n>> +                     cmd list_files\n>> +\n>> +             done\n>> +     done\n>> +done\n>> --\n>> 1.8.3.1\n>>\n>\n> --\n> *NOTE: This message is ROT-13 encrypted twice for extra protection*\n"},{"id":"241485","messageId":"CAP=KgsQMRZymUnojGqyZPdKsepfmHvuyUhAkWqrZ_GnybgMqxA@mail.gmail.com","threadId":"36651","inReplyTo":"20140513220957.GN4791@meili.valhalla.31bits.net","subject":"Re: [GUILT v2 16/29] Fix backslash handling when creating names of imported patches.","fromName":"Per Cederqvist","fromEmail":"cederp@opera.com","sentAt":"2014-05-14T08:56:18Z","receivedAt":"2014-05-14T08:56:18Z","isPatch":false,"sender":{"key":"cederp@opera.com","avatar":"https://gravatar.com/avatar/008fe28caedea0ba34042cd5157705267934f4ba7a9b29fb248ae18ec5b3055e?d=mp&s=160"},"body":"On Wed, May 14, 2014 at 12:09 AM, Jeff Sipek <jeffpc@josefsipek.net> wrote:\n> On Tue, May 13, 2014 at 10:30:52PM +0200, Per Cederqvist wrote:\n>> The 'echo %s' construct sometimes processes escape sequences.  (This\n>\n> %s?  Should this be $s?\n\nYes. Will fix that typo in v3 of the patch series.\n\n    /ceder\n\n> Otherwise, looks good.\n>\n>> happens, for instance, under Ubuntu 14.04 when /bin/sh is actually\n>> dash.)  We don't want that to happen when we are importing commits, so\n>> use 'printf %s \"$s\"' instead.\n>>\n>> (The -E option of bash that explicitly disables backslash expansion is\n>> not portable; it is not supported by dash.)\n>>\n>> Signed-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>>\n>> diff --git a/guilt-import-commit b/guilt-import-commit\n>> index 6260c56..45f2404 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>>       # Try to convert the first line of the commit message to a\n>>       # valid patch name.\n>> -     fname=`echo $s | sed -e \"s/&/and/g\" -e \"s/[ :]/_/g\" -e \"s,[/\\\\],-,g\" \\\n>> +     fname=`printf %s \"$s\" | sed -e \"s/&/and/g\" -e \"s/[ :]/_/g\" -e \"s,[/\\\\],-,g\" \\\n>>                       -e \"s/['\\\\[{}]//g\" -e 's/]//g' -e 's/\\*/-/g' \\\n>>                       -e 's/\\?/-/g' -e 's/\\.\\.\\.*/./g' -e 's/^\\.//' \\\n>>                       -e 's/\\.patch$//' -e 's/\\.$//' | tr A-Z a-z`\n>> diff --git a/regression/t-034.out b/regression/t-034.out\n>> index 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>> --\n>> 1.8.3.1\n>>\n>\n> --\n> I have always wished for my computer to be as easy to use as my telephone;\n> my wish has come true because I can no longer figure out how to use my\n> telephone.\n>                 - Bjarne Stroustrup\n"},{"id":"241487","messageId":"CAP=KgsRrtkRZB24CebZsunE=Mc55+NNjoGKLxCPa=KY-GDJ-+w@mail.gmail.com","threadId":"36651","inReplyTo":"20140513214114.GI4791@meili.valhalla.31bits.net","subject":"Re: [GUILT v2 25/29] \"guilt push\" now fails when there are no more patches to push.","fromName":"Per Cederqvist","fromEmail":"cederp@opera.com","sentAt":"2014-05-14T09:27:19Z","receivedAt":"2014-05-14T09:27:19Z","isPatch":false,"sender":{"key":"cederp@opera.com","avatar":"https://gravatar.com/avatar/008fe28caedea0ba34042cd5157705267934f4ba7a9b29fb248ae18ec5b3055e?d=mp&s=160"},"body":"On Tue, May 13, 2014 at 11:41 PM, Jeff Sipek <jeffpc@josefsipek.net> wrote:\n> On Tue, May 13, 2014 at 10:31:01PM +0200, 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           | 19 ++++++-----\n>>  regression/t-020.out | 89 ++++++++++++++++++++++++++++++++++++++++++++++++++++\n>>  regression/t-020.sh  | 13 +++++++-\n>>  3 files changed, 113 insertions(+), 8 deletions(-)\n> ...\n>> diff --git a/regression/t-020.sh b/regression/t-020.sh\n>> index 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> I don't particularly care for the git-log.  Otherwise it looks good.\n>\n> Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>\n\nIn my defense, I was just continuing the pattern already\nestablished in that file. Anyhow, I'll add a new commit to\nthe patch series that removes all \"git log -p\" from all tests.\n(They are present in both t-020.sh and t-021.sh.)\n\n    /ceder\n\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>> -     if [ $n -ge 0 ]; then\n>> +     if [ $n -gt 0 ]; then\n>>               cmd guilt push -n $n\n>>       else\n>>               shouldfail guilt push -n $n\n>> --\n>> 1.8.3.1\n>>\n>\n> --\n> Evolution, 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":"241490","messageId":"CAP=KgsSi2DHvgKhpXPYRgQcnsRvP2UWva5u_V4DEnLEP-q6zQg@mail.gmail.com","threadId":"36651","inReplyTo":"CAP=KgsTvt7btB0EO75UeW2SejeXm9u7nfPLf0J2M+Y2H=u9s5w@mail.gmail.com","subject":"Re: [GUILT v2 00/29] Teach guilt import-commit how to create legal patch names, and more","fromName":"Per Cederqvist","fromEmail":"cederp@opera.com","sentAt":"2014-05-14T09:49:39Z","receivedAt":"2014-05-14T09:49:39Z","isPatch":false,"sender":{"key":"cederp@opera.com","avatar":"https://gravatar.com/avatar/008fe28caedea0ba34042cd5157705267934f4ba7a9b29fb248ae18ec5b3055e?d=mp&s=160"},"body":"On Tue, May 13, 2014 at 11:29 PM, Per Cederqvist <cederp@opera.com> wrote:\n> On Tue, May 13, 2014 at 10:54 PM, Jeff Sipek <jeffpc@josefsipek.net> wrote:\n>> On Tue, May 13, 2014 at 04:45:47PM -0400, Theodore Ts'o wrote:\n>>> On Tue, May 13, 2014 at 10:30:36PM +0200, Per Cederqvist wrote:\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>>>\n>>> We've been living with the \"origin\" -> \"guilt/origin\" branch change\n>>> for a year already, and in fact, these days I've gotten used to the\n>>> new behavior.  Is it really worth it to change the default?\n>>\n>> So, at first I was skeptical about the branch name prefix change.  I've used\n>> it for about a year now, and I love it.  When I first read Per's idea to\n>> change the default to the old-style, I was a bit sad but I understand the\n>> motivation.\n>>\n>> I'm open to either mode being the default since it's easy enough for me to\n>> change it for me (thanks, ~/.gitconfig) but I think more people should\n>> benefit from the added safety against accidental git-push.  (I also like\n>> being able to use guilt/master..master to get only the commits I care\n>> about.)  Thoughts?\n>\n> I don't have a strong opinion on which the default value should be.\n> The scenario where it matters, when you run multiple versions of\n> guilt against the same directory, is probably very rare in practice.\n> If it is mentioned in the release note that it can be changed if needed,\n> that is probably good enough.\n>\n>     /ceder\n\nI will change the default value to false in the next version of the patch\nseries, unless there are objections.  I plan to send it to the list Friday\nmorning.\n\n    /ceder\n"},{"id":"241498","messageId":"20140514130639.GA1582@meili.valhalla.31bits.net","threadId":"36651","inReplyTo":"CAP=KgsQMRZymUnojGqyZPdKsepfmHvuyUhAkWqrZ_GnybgMqxA@mail.gmail.com","subject":"Re: [GUILT v2 16/29] Fix backslash handling when creating names of imported patches.","fromName":"Jeff Sipek","fromEmail":"jeffpc@josefsipek.net","sentAt":"2014-05-14T13:06:39Z","receivedAt":"2014-05-14T13:06:39Z","isPatch":false,"sender":{"key":"jeffpc@josefsipek.net","avatar":null},"body":"On Wed, May 14, 2014 at 10:56:18AM +0200, Per Cederqvist wrote:\n> On Wed, May 14, 2014 at 12:09 AM, Jeff Sipek <jeffpc@josefsipek.net> wrote:\n> > On Tue, May 13, 2014 at 10:30:52PM +0200, Per Cederqvist wrote:\n> >> The 'echo %s' construct sometimes processes escape sequences.  (This\n> >\n> > %s?  Should this be $s?\n> \n> Yes. Will fix that typo in v3 of the patch series.\n\nok, Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>\n\n>     /ceder\n> \n> > Otherwise, looks good.\n> >\n> >> happens, for instance, under Ubuntu 14.04 when /bin/sh is actually\n> >> dash.)  We don't want that to happen when we are importing commits, so\n> >> use 'printf %s \"$s\"' instead.\n> >>\n> >> (The -E option of bash that explicitly disables backslash expansion is\n> >> not portable; it is not supported by dash.)\n> >>\n> >> Signed-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> >>\n> >> diff --git a/guilt-import-commit b/guilt-import-commit\n> >> index 6260c56..45f2404 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> >>       # Try to convert the first line of the commit message to a\n> >>       # valid patch name.\n> >> -     fname=`echo $s | sed -e \"s/&/and/g\" -e \"s/[ :]/_/g\" -e \"s,[/\\\\],-,g\" \\\n> >> +     fname=`printf %s \"$s\" | sed -e \"s/&/and/g\" -e \"s/[ :]/_/g\" -e \"s,[/\\\\],-,g\" \\\n> >>                       -e \"s/['\\\\[{}]//g\" -e 's/]//g' -e 's/\\*/-/g' \\\n> >>                       -e 's/\\?/-/g' -e 's/\\.\\.\\.*/./g' -e 's/^\\.//' \\\n> >>                       -e 's/\\.patch$//' -e 's/\\.$//' | tr A-Z a-z`\n> >> diff --git a/regression/t-034.out b/regression/t-034.out\n> >> index 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> >> --\n> >> 1.8.3.1\n> >>\n> >\n> > --\n> > I have always wished for my computer to be as easy to use as my telephone;\n> > my wish has come true because I can no longer figure out how to use my\n> > telephone.\n> >                 - Bjarne Stroustrup\n\n-- \nReal Programmers consider \"what you see is what you get\" to be just as bad a\nconcept in Text Editors as it is in women. No, the Real Programmer wants a\n\"you asked for it, you got it\" text editor -- complicated, cryptic,\npowerful, unforgiving, dangerous.\n"},{"id":"241499","messageId":"20140514130715.GB1582@meili.valhalla.31bits.net","threadId":"36651","inReplyTo":"CAP=KgsRrtkRZB24CebZsunE=Mc55+NNjoGKLxCPa=KY-GDJ-+w@mail.gmail.com","subject":"Re: [GUILT v2 25/29] \"guilt push\" now fails when there are no more patches to push.","fromName":"Jeff Sipek","fromEmail":"jeffpc@josefsipek.net","sentAt":"2014-05-14T13:07:15Z","receivedAt":"2014-05-14T13:07:15Z","isPatch":false,"sender":{"key":"jeffpc@josefsipek.net","avatar":null},"body":"On Wed, May 14, 2014 at 11:27:19AM +0200, Per Cederqvist wrote:\n> On Tue, May 13, 2014 at 11:41 PM, Jeff Sipek <jeffpc@josefsipek.net> wrote:\n> > On Tue, May 13, 2014 at 10:31:01PM +0200, 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           | 19 ++++++-----\n> >>  regression/t-020.out | 89 ++++++++++++++++++++++++++++++++++++++++++++++++++++\n> >>  regression/t-020.sh  | 13 +++++++-\n> >>  3 files changed, 113 insertions(+), 8 deletions(-)\n> > ...\n> >> diff --git a/regression/t-020.sh b/regression/t-020.sh\n> >> index 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> > I don't particularly care for the git-log.  Otherwise it looks good.\n> >\n> > Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>\n> \n> In my defense, I was just continuing the pattern already\n> established in that file. Anyhow, I'll add a new commit to\n> the patch series that removes all \"git log -p\" from all tests.\n> (They are present in both t-020.sh and t-021.sh.)\n\nSounds good.  Thanks,\n\nJeff.\n\n>     /ceder\n> \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> >> -     if [ $n -ge 0 ]; then\n> >> +     if [ $n -gt 0 ]; then\n> >>               cmd guilt push -n $n\n> >>       else\n> >>               shouldfail guilt push -n $n\n> >> --\n> >> 1.8.3.1\n> >>\n> >\n> > --\n> > Evolution, 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\n-- \nUNIX is user-friendly ... it's just selective about who its friends are\n"},{"id":"241508","messageId":"20140514155324.GE1582@meili.valhalla.31bits.net","threadId":"36651","inReplyTo":"1400013065-27919-29-git-send-email-cederp@opera.com","subject":"Re: [GUILT v2 28/29] Added guilt.reusebranch configuration option.","fromName":"Jeff Sipek","fromEmail":"jeffpc@josefsipek.net","sentAt":"2014-05-14T15:53:24Z","receivedAt":"2014-05-14T15:53:24Z","isPatch":false,"sender":{"key":"jeffpc@josefsipek.net","avatar":null},"body":"On Tue, May 13, 2014 at 10:31:04PM +0200, Per Cederqvist wrote:\n> When the option is true (the default), Guilt does not create a new Git\n> branch when patches are applied.  This way, you can switch between\n> Guilt 0.35 and the current version of Guilt with no issues.\n> \n> At a future time, maybe a year after Guilt with guilt.reusebranch\n> support is released, the default should be changed to \"false\" to take\n> advantage of the ability to use a separate Git branch when patches are\n> applied.\n> \n> Signed-off-by: Per Cederqvist <cederp@opera.com>\n> ---\n>  guilt                |  28 +++-\n>  regression/scaffold  |   1 +\n>  regression/t-062.out | 441 +++++++++++++++++++++++++++++++++++++++++++++++++++\n>  regression/t-062.sh  | 137 ++++++++++++++++\n>  4 files changed, 601 insertions(+), 6 deletions(-)\n>  create mode 100644 regression/t-062.out\n>  create mode 100755 regression/t-062.sh\n...\n> diff --git a/guilt b/guilt\n> index 9947acc..7c830eb 100755\n> --- a/guilt\n> +++ b/guilt\n...\n> @@ -928,13 +935,22 @@ else\n>  \tdie \"Unsupported operating system: $UNAME_S\"\n>  fi\n>  \n> -if [ \"$branch\" = \"$raw_git_branch\" ] && [ -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> +if [ -n \"`get_top 2>/dev/null`\" ]; then\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\" ]; then\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; then\n> +\t\told_style_prefix=true\n> +\telse\n> +\t\told_style_prefix=false\n> +\tfi\n\nI don't know if this is a good idea or not, but:\n\n\told_style_prefix=\"$reuse_branch\"\n\n>  fi\n>  \n>  _main \"$@\"\n> diff --git a/regression/scaffold b/regression/scaffold\n> index 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\n...\n> diff --git a/regression/t-062.sh b/regression/t-062.sh\n> new file mode 100755\n> index 0000000..85596ca\n> --- /dev/null\n> +++ b/regression/t-062.sh\n> @@ -0,0 +1,137 @@\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\nduplicate list_files & for-each-ref\n\n> +\n> +for i in `seq 5`; do\n> +\tif [ $i -ge 5 ]; then\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\nWhat exactly is the right thing?  no-op since the above loop poped\neverything?  (I'd make the comment say what the \"right thing\" is.)\n\nJeff.\n\n-- \nIn personal conversations with technical people, I call myself a hacker. But\nwhen I'm talking to journalists I just say \"programmer\" or something like\nthat.\n\t\t- Linus Torvalds\n"},{"id":"241511","messageId":"20140514171040.GF1582@meili.valhalla.31bits.net","threadId":"36651","inReplyTo":"1400013065-27919-9-git-send-email-cederp@opera.com","subject":"Re: [GUILT v2 08/29] Added more test cases for \"guilt new\": empty patches.","fromName":"Jeff Sipek","fromEmail":"jeffpc@josefsipek.net","sentAt":"2014-05-14T17:10:41Z","receivedAt":"2014-05-14T17:10:41Z","isPatch":false,"sender":{"key":"jeffpc@josefsipek.net","avatar":null},"body":"On Tue, May 13, 2014 at 10:30:44PM +0200, Per Cederqvist wrote:\n> Test that empty patches are handled correctly, both with and without\n> the guilt.diffstat configuration option.\n> \n> Signed-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> \n> diff --git a/regression/t-020.out b/regression/t-020.out\n> index 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...\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\nI'm a bit confused about the above.  It looks like contents of an empty\npatch with an empty diffstat.  But the only time I see a cat in the .sh file\nis when you rewrite... oh I got it.  I'll comment about it by the 'cat'.\n\n...\n> diff --git a/regression/t-020.sh b/regression/t-020.sh\n> index 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\ncat > .git/.../empty.patch <<EOF\n...\nEOF\n\nOtherwise, you'll just cat the existing patch and that's it.\n\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> -- \n> 1.8.3.1\n> \n\n-- \nFact: 23.6% of all statistics are generated randomly.\n"},{"id":"241534","messageId":"CAP=KgsRoi0P0zYYPD+aZX0FYi7eXL6cY5w-Y+rVJfjBhrhd+Ww@mail.gmail.com","threadId":"36651","inReplyTo":"20140514171040.GF1582@meili.valhalla.31bits.net","subject":"Re: [GUILT v2 08/29] Added more test cases for \"guilt new\": empty patches.","fromName":"Per Cederqvist","fromEmail":"cederp@opera.com","sentAt":"2014-05-14T20:38:08Z","receivedAt":"2014-05-14T20:38:08Z","isPatch":false,"sender":{"key":"cederp@opera.com","avatar":"https://gravatar.com/avatar/008fe28caedea0ba34042cd5157705267934f4ba7a9b29fb248ae18ec5b3055e?d=mp&s=160"},"body":"On Wed, May 14, 2014 at 7:10 PM, Jeff Sipek <jeffpc@josefsipek.net> wrote:\n> On Tue, May 13, 2014 at 10:30:44PM +0200, Per Cederqvist wrote:\n>> Test that empty patches are handled correctly, both with and without\n>> the guilt.diffstat configuration option.\n>>\n>> Signed-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>>\n>> diff --git a/regression/t-020.out b/regression/t-020.out\n>> index 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> ...\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>\n> I'm a bit confused about the above.  It looks like contents of an empty\n> patch with an empty diffstat.  But the only time I see a cat in the .sh file\n> is when you rewrite... oh I got it.  I'll comment about it by the 'cat'.\n>\n> ...\n>> diff --git a/regression/t-020.sh b/regression/t-020.sh\n>> index 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>> +     cmd guilt pop\n>> +     touch -a -m -t \"$TOUCH_DATE\" \".git/patches/master/$1\"\n>> +     cmd 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>\n> cat > .git/.../empty.patch <<EOF\n> ...\n> EOF\n>\n> Otherwise, you'll just cat the existing patch and that's it.\n\nYes. The intent was to modify empty.patch.  This is a bit\nembarrassing, since it should have been obvious from\nthe output of \"git log -p\" that the modification didn't work\nas I intended. :-)\n\nI'll fix in the v3 series.\n\n    /ceder\n\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>> --\n>> 1.8.3.1\n>>\n>\n> --\n> Fact: 23.6% of all statistics are generated randomly.\n"},{"id":"241648","messageId":"CAP=KgsR66gX6WduCE8-GXDF7qZ=zV=X_CjLRh-PRb7CJoRTqjA@mail.gmail.com","threadId":"36651","inReplyTo":"20140514155324.GE1582@meili.valhalla.31bits.net","subject":"Re: [GUILT v2 28/29] Added guilt.reusebranch configuration option.","fromName":"Per Cederqvist","fromEmail":"cederp@opera.com","sentAt":"2014-05-15T07:37:05Z","receivedAt":"2014-05-15T07:37:05Z","isPatch":false,"sender":{"key":"cederp@opera.com","avatar":"https://gravatar.com/avatar/008fe28caedea0ba34042cd5157705267934f4ba7a9b29fb248ae18ec5b3055e?d=mp&s=160"},"body":"On Wed, May 14, 2014 at 5:53 PM, Jeff Sipek <jeffpc@josefsipek.net> wrote:\n> On Tue, May 13, 2014 at 10:31:04PM +0200, Per Cederqvist wrote:\n>> When the option is true (the default), Guilt does not create a new Git\n>> branch when patches are applied.  This way, you can switch between\n>> Guilt 0.35 and the current version of Guilt with no issues.\n>>\n>> At a future time, maybe a year after Guilt with guilt.reusebranch\n>> support is released, the default should be changed to \"false\" to take\n>> advantage of the ability to use a separate Git branch when patches are\n>> applied.\n>>\n>> Signed-off-by: Per Cederqvist <cederp@opera.com>\n>> ---\n>>  guilt                |  28 +++-\n>>  regression/scaffold  |   1 +\n>>  regression/t-062.out | 441 +++++++++++++++++++++++++++++++++++++++++++++++++++\n>>  regression/t-062.sh  | 137 ++++++++++++++++\n>>  4 files changed, 601 insertions(+), 6 deletions(-)\n>>  create mode 100644 regression/t-062.out\n>>  create mode 100755 regression/t-062.sh\n> ...\n>> diff --git a/guilt b/guilt\n>> index 9947acc..7c830eb 100755\n>> --- a/guilt\n>> +++ b/guilt\n> ...\n>> @@ -928,13 +935,22 @@ else\n>>       die \"Unsupported operating system: $UNAME_S\"\n>>  fi\n>>\n>> -if [ \"$branch\" = \"$raw_git_branch\" ] && [ -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>> +if [ -n \"`get_top 2>/dev/null`\" ]; then\n>> +     # If there is at least one pushed patch, we set\n>> +     # old_style_prefix according to how it was pushed.  It is only\n>> +     # possible to change the prefix style while no patches are\n>> +     # applied.\n>> +     if [ \"$branch\" = \"$raw_git_branch\" ]; then\n>> +             old_style_prefix=true\n>> +     else\n>> +             old_style_prefix=false\n>> +     fi\n>>  else\n>> -    old_style_prefix=false\n>> +     if $reuse_branch; then\n>> +             old_style_prefix=true\n>> +     else\n>> +             old_style_prefix=false\n>> +     fi\n>\n> I don't know if this is a good idea or not, but:\n>\n>         old_style_prefix=\"$reuse_branch\"\n\nIt saves a few lines. I'll use that construct in v3.\n\n>>  fi\n>>\n>>  _main \"$@\"\n>> diff --git a/regression/scaffold b/regression/scaffold\n>> index e4d7487..e4d2f35 100644\n>> --- a/regression/scaffold\n>> +++ b/regression/scaffold\n>> @@ -93,6 +93,7 @@ function setup_git_repo\n>>       git config log.date default\n>>       git config log.decorate no\n>>       git config guilt.diffstat false\n>> +     git config guilt.reusebranch false\n>>  }\n>>\n>>  function setup_guilt_repo\n> ...\n>> diff --git a/regression/t-062.sh b/regression/t-062.sh\n>> new file mode 100755\n>> index 0000000..85596ca\n>> --- /dev/null\n>> +++ b/regression/t-062.sh\n>> @@ -0,0 +1,137 @@\n> ...\n\nHidden here was a broken comment.  The new one at the start\nof the file will say:\n\n# Test that the guilt.reusebranch=true setting works.\n\nThis entire file is mostly a copy of t-061.sh, but slightly\nadjusted to use guilt.reusebranch=true.  I'm not sure it\ncovers all that should be tested. On the other hand, I'm\nnot sure how much that setting needs to be tested.\n\n>> +function fixup_time_info\n>> +{\n>> +     touch -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> duplicate list_files & for-each-ref\n\nFixed.\n\n>> +\n>> +for i in `seq 5`; do\n>> +     if [ $i -ge 5 ]; then\n>> +             shouldfail guilt pop\n>> +     else\n>> +             cmd guilt pop\n>> +     fi\n>> +     cmd git for-each-ref\n>> +     cmd guilt push\n>> +     cmd git for-each-ref\n>> +     cmd guilt pop\n>> +     cmd git for-each-ref\n>> +done\n>> +\n>> +# Check that \"pop -a\" does the right thing.\n>\n> What exactly is the right thing?  no-op since the above loop poped\n> everything?  (I'd make the comment say what the \"right thing\" is.)\n\nI'll rephrase that block of code like this:\n\n# Check that \"pop -a\" properly pops all patches.\ncmd guilt push -a\ncmd git for-each-ref\ncmd guilt pop -a\ncmd git for-each-ref\n\nIs that more clear? The test pushes all patches, checks that they\nare applied, removes them, checks that it worked.\n\n> Jeff.\n>\n> --\n> In personal conversations with technical people, I call myself a hacker. But\n> when I'm talking to journalists I just say \"programmer\" or something like\n> that.\n>                 - Linus Torvalds\n"},{"id":"241684","messageId":"20140515142949.GB2735@meili.valhalla.31bits.net","threadId":"36651","inReplyTo":"CAP=KgsR66gX6WduCE8-GXDF7qZ=zV=X_CjLRh-PRb7CJoRTqjA@mail.gmail.com","subject":"Re: [GUILT v2 28/29] Added guilt.reusebranch configuration option.","fromName":"Jeff Sipek","fromEmail":"jeffpc@josefsipek.net","sentAt":"2014-05-15T14:29:50Z","receivedAt":"2014-05-15T14:29:50Z","isPatch":false,"sender":{"key":"jeffpc@josefsipek.net","avatar":null},"body":"On Thu, May 15, 2014 at 09:37:05AM +0200, Per Cederqvist wrote:\n> On Wed, May 14, 2014 at 5:53 PM, Jeff Sipek <jeffpc@josefsipek.net> wrote:\n> > On Tue, May 13, 2014 at 10:31:04PM +0200, Per Cederqvist wrote:\n...\n> >> +\n> >> +for i in `seq 5`; do\n> >> +     if [ $i -ge 5 ]; then\n> >> +             shouldfail guilt pop\n> >> +     else\n> >> +             cmd guilt pop\n> >> +     fi\n> >> +     cmd git for-each-ref\n> >> +     cmd guilt push\n> >> +     cmd git for-each-ref\n> >> +     cmd guilt pop\n> >> +     cmd git for-each-ref\n> >> +done\n> >> +\n> >> +# Check that \"pop -a\" does the right thing.\n> >\n> > What exactly is the right thing?  no-op since the above loop poped\n> > everything?  (I'd make the comment say what the \"right thing\" is.)\n> \n> I'll rephrase that block of code like this:\n> \n> # Check that \"pop -a\" properly pops all patches.\n> cmd guilt push -a\n> cmd git for-each-ref\n> cmd guilt pop -a\n> cmd git for-each-ref\n> \n> Is that more clear? The test pushes all patches, checks that they\n> are applied, removes them, checks that it worked.\n\nYeah.\n\nThanks,\n\nJeff.\n\n-- \nNT is to UNIX what a doughnut is to a particle accelerator.\n"},{"id":"241796","messageId":"20140515224658.GA1334@meili.valhalla.31bits.net","threadId":"36651","inReplyTo":"1400013065-27919-13-git-send-email-cederp@opera.com","subject":"Re: [GUILT v2 12/29] \"guilt header\": more robust header selection.","fromName":"Jeff Sipek","fromEmail":"jeffpc@josefsipek.net","sentAt":"2014-05-15T22:46:58Z","receivedAt":"2014-05-15T22:46:58Z","isPatch":false,"sender":{"key":"jeffpc@josefsipek.net","avatar":null},"body":"On Tue, May 13, 2014 at 10:30:48PM +0200, Per Cederqvist wrote:\n> If you run something like \"guilt header '.*'\" the command would crash,\n> because the grep comand that tries to ensure that the patch exist\n> would detect a match, but the later code expected the match to be\n> exact.\n> \n> Fixed by comparing exact strings.\n> \n> And as a creeping feature \"guilt header\" will now try to use the\n> supplied patch name as an unachored regexp if no exact match was\n> found.  If the regexp yields a unique match, it is used; if more than\n> one patch matches, the names of all patches are listed and the command\n> fails.  (Exercise left to the reader: generalized this so that \"guilt\n> push\" also accepts a unique regular expression.)\n> \n> Signed-off-by: Per Cederqvist <cederp@opera.com>\n> ---\n>  guilt-header | 28 +++++++++++++++++++++++++---\n>  1 file changed, 25 insertions(+), 3 deletions(-)\n> \n> diff --git a/guilt-header b/guilt-header\n> index 41e00cc..4701b31 100755\n> --- a/guilt-header\n> +++ b/guilt-header\n> @@ -45,10 +45,32 @@ 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; do\n> +\tif [ \"$x\" = \"$patch\" ]; then\n> +\t\tfound_patch=\"$patch\"\n> +\t\tbreak\n> +\tfi\n> +done < \"$full_series\"\n\nWe have to use a temp file instead of a 'get_full_series | while read x; do ...'\nbecause that'd create a subshell, correct?\n\n> +if [ -z \"$found_patch\" ]; 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 ]; then\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 ]; then\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\nDo we not delete $full_series?\n\n>  \n>  # FIXME: warn if we're editing an applied patch\n>  \n> -- \n> 1.8.3.1\n> \n\n-- \nOpenIndiana ibdm: 8 cores, 12 GB RAM\n"},{"id":"241797","messageId":"20140515224749.GB1334@meili.valhalla.31bits.net","threadId":"36651","inReplyTo":"1400013065-27919-14-git-send-email-cederp@opera.com","subject":"Re: [GUILT v2 13/29] Check that \"guilt header '.*'\" fails.","fromName":"Jeff Sipek","fromEmail":"jeffpc@josefsipek.net","sentAt":"2014-05-15T22:47:49Z","receivedAt":"2014-05-15T22:47:49Z","isPatch":false,"sender":{"key":"jeffpc@josefsipek.net","avatar":null},"body":"Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>\n\nOn Tue, May 13, 2014 at 10:30:49PM +0200, Per Cederqvist wrote:\n> 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> \n> diff --git a/regression/t-028.out b/regression/t-028.out\n> index 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\n> diff --git a/regression/t-028.sh b/regression/t-028.sh\n> index 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> -- \n> 1.8.3.1\n> \n\n-- \nSi hoc legere scis nimium eruditionis habes.\n"},{"id":"241801","messageId":"20140515230017.GC1334@meili.valhalla.31bits.net","threadId":"36651","inReplyTo":"1400013065-27919-15-git-send-email-cederp@opera.com","subject":"Re: [GUILT v2 14/29] Use \"git check-ref-format\" to validate patch names.","fromName":"Jeff Sipek","fromEmail":"jeffpc@josefsipek.net","sentAt":"2014-05-15T23:00:18Z","receivedAt":"2014-05-15T23:00:18Z","isPatch":false,"sender":{"key":"jeffpc@josefsipek.net","avatar":null},"body":"On Tue, May 13, 2014 at 10:30:50PM +0200, Per Cederqvist wrote:\n> The valid_patchname now lets \"git check-ref-format\" do its job instead\n> of trying (and failing) to implement the same rules.  See\n> git-check-ref-format(1) for a list of the rules.\n> \n> Refer to the git-check-ref-format(1) man page in the error messages\n> produced when valid_patchname indicates that the name is bad.\n> \n> Added testcases that breaks most of the rules in that man-page.\n> \n> Git version 1.8.5 no longer allows the single character \"@\" as a\n> branch name.  Guilt always rejects that name, for increased\n> compatibility.\n\nVery nice.\n\nSigned-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>\n\n\n> Signed-off-by: Per Cederqvist <cederp@opera.com>\n> ---\n>  guilt                |  21 ++-\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, 446 insertions(+), 23 deletions(-)\n> \n> diff --git a/guilt b/guilt\n> index 3fc524e..23cc2da 100755\n> --- a/guilt\n> +++ b/guilt\n> @@ -132,14 +132,19 @@ 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\"; then\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\" = \"@\" ]; then\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()\n> diff --git a/guilt-fork b/guilt-fork\n> index 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\n> diff --git a/guilt-import b/guilt-import\n> index 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\n> diff --git a/guilt-new b/guilt-new\n> index 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\n> diff --git a/regression/t-025.out b/regression/t-025.out\n> index 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\n> diff --git a/regression/t-025.sh b/regression/t-025.sh\n> index 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\n> diff --git a/regression/t-032.out b/regression/t-032.out\n> index 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> -- \n> 1.8.3.1\n> \n\n-- \nHumans were created by water to transport it upward.\n"},{"id":"241849","messageId":"20140515232112.GD1334@meili.valhalla.31bits.net","threadId":"36651","inReplyTo":"1400013065-27919-16-git-send-email-cederp@opera.com","subject":"Re: [GUILT v2 15/29] Produce legal patch names in guilt-import-commit.","fromName":"Jeff Sipek","fromEmail":"jeffpc@josefsipek.net","sentAt":"2014-05-15T23:21:12Z","receivedAt":"2014-05-15T23:21:12Z","isPatch":false,"sender":{"key":"jeffpc@josefsipek.net","avatar":null},"body":"On Tue, May 13, 2014 at 10:30:51PM +0200, Per Cederqvist wrote:\n> Try harder to create patch names that adhere to the rules in\n> git-check-ref-format(1) when deriving a patch name from the commit\n> message.  Verify that the derived name using \"git check-ref-format\",\n> and as a final fallback simply use the patch name \"x\" (to ensure that\n> the code is future-proof in case new rules are added in the future).\n> \n> Always append a \".patch\" suffix to the patch name.\n> \n> Added test cases.\n\nAlso very nice.\n\nThanks,\n\nJeff.\n\nSigned-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>\n\n-- \nWe have joy, we have fun, we have Linux on a Sun...\n"},{"id":"241871","messageId":"CAP=KgsRmmmUOoasPGpJ12RRBXQxu07FbELHbQw38-=DM6MfW3w@mail.gmail.com","threadId":"36651","inReplyTo":"20140515224658.GA1334@meili.valhalla.31bits.net","subject":"Re: [GUILT v2 12/29] \"guilt header\": more robust header selection.","fromName":"Per Cederqvist","fromEmail":"cederp@opera.com","sentAt":"2014-05-16T09:51:37Z","receivedAt":"2014-05-16T09:51:37Z","isPatch":false,"sender":{"key":"cederp@opera.com","avatar":"https://gravatar.com/avatar/008fe28caedea0ba34042cd5157705267934f4ba7a9b29fb248ae18ec5b3055e?d=mp&s=160"},"body":"On Fri, May 16, 2014 at 12:46 AM, Jeff Sipek <jeffpc@josefsipek.net> wrote:\n> On Tue, May 13, 2014 at 10:30:48PM +0200, Per Cederqvist wrote:\n>> If you run something like \"guilt header '.*'\" the command would crash,\n>> because the grep comand that tries to ensure that the patch exist\n>> would detect a match, but the later code expected the match to be\n>> exact.\n>>\n>> Fixed by comparing exact strings.\n>>\n>> And as a creeping feature \"guilt header\" will now try to use the\n>> supplied patch name as an unachored regexp if no exact match was\n>> found.  If the regexp yields a unique match, it is used; if more than\n>> one patch matches, the names of all patches are listed and the command\n>> fails.  (Exercise left to the reader: generalized this so that \"guilt\n>> push\" also accepts a unique regular expression.)\n>>\n>> Signed-off-by: Per Cederqvist <cederp@opera.com>\n>> ---\n>>  guilt-header | 28 +++++++++++++++++++++++++---\n>>  1 file changed, 25 insertions(+), 3 deletions(-)\n>>\n>> diff --git a/guilt-header b/guilt-header\n>> index 41e00cc..4701b31 100755\n>> --- a/guilt-header\n>> +++ b/guilt-header\n>> @@ -45,10 +45,32 @@ 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>> -     die \"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; do\n>> +     if [ \"$x\" = \"$patch\" ]; then\n>> +             found_patch=\"$patch\"\n>> +             break\n>> +     fi\n>> +done < \"$full_series\"\n>\n> We have to use a temp file instead of a 'get_full_series | while read x; do ...'\n> because that'd create a subshell, correct?\n\nYes. Also (and probably less importantly) we sometimes need to run grep on\nthe same output (see the creation of TMP_MATCHES below) and it would\nbe a bit wasteful to run get_full_series twice. (The assumption is that it is\ncheaper to create a temp file than to recompute the value. I have not measured\nthis, though.)\n\n>> +if [ -z \"$found_patch\" ]; then\n>> +     TMP_MATCHES=`get_tmp_file series`\n>> +     grep \"$patch\" < \"$full_series\" > \"$TMP_MATCHES\"\n>> +     nr=`wc -l < $TMP_MATCHES`\n>> +     if [ $nr -gt 1 ]; then\n>> +             echo \"$patch does not uniquely identify a patch. Did you mean any of these?\" >&2\n>> +             sed 's/^/  /' \"$TMP_MATCHES\" >&2\n>> +             rm -f \"$TMP_MATCHES\"\n>> +             exit 1\n>> +     elif [ $nr -eq 0 ]; then\n>> +             rm -f \"$TMP_MATCHES\"\n>> +             die \"Patch $patch is not in the series\"\n>> +     fi\n>> +     found_patch=`cat $TMP_MATCHES`\n>> +     rm -f \"$TMP_MATCHES\"\n>>  fi\n>> +patch=\"$found_patch\"\n>\n> Do we not delete $full_series?\n\nGood catch. Will fix in the next version of the series.\n\nI'll also rename the variable $TMP_FULL_SERIES to adhere\nto the apparent coding style. (But I will not fix guilt-patchbomb\nthat uses $dir as a temporary variable.)\n\n    /ceder\n\n>>\n>>  # FIXME: warn if we're editing an applied patch\n>>\n>> --\n>> 1.8.3.1\n>>\n>\n> --\n> OpenIndiana ibdm: 8 cores, 12 GB RAM\n"},{"id":"241881","messageId":"20140516125501.GA1770@meili.valhalla.31bits.net","threadId":"36651","inReplyTo":"CAP=KgsRmmmUOoasPGpJ12RRBXQxu07FbELHbQw38-=DM6MfW3w@mail.gmail.com","subject":"Re: [GUILT v2 12/29] \"guilt header\": more robust header selection.","fromName":"Jeff Sipek","fromEmail":"jeffpc@josefsipek.net","sentAt":"2014-05-16T12:55:01Z","receivedAt":"2014-05-16T12:55:01Z","isPatch":false,"sender":{"key":"jeffpc@josefsipek.net","avatar":null},"body":"On Fri, May 16, 2014 at 11:51:37AM +0200, Per Cederqvist wrote:\n> On Fri, May 16, 2014 at 12:46 AM, Jeff Sipek <jeffpc@josefsipek.net> wrote:\n> > On Tue, May 13, 2014 at 10:30:48PM +0200, Per Cederqvist wrote:\n> >> If you run something like \"guilt header '.*'\" the command would crash,\n> >> because the grep comand that tries to ensure that the patch exist\n> >> would detect a match, but the later code expected the match to be\n> >> exact.\n> >>\n> >> Fixed by comparing exact strings.\n> >>\n> >> And as a creeping feature \"guilt header\" will now try to use the\n> >> supplied patch name as an unachored regexp if no exact match was\n> >> found.  If the regexp yields a unique match, it is used; if more than\n> >> one patch matches, the names of all patches are listed and the command\n> >> fails.  (Exercise left to the reader: generalized this so that \"guilt\n> >> push\" also accepts a unique regular expression.)\n> >>\n> >> Signed-off-by: Per Cederqvist <cederp@opera.com>\n> >> ---\n> >>  guilt-header | 28 +++++++++++++++++++++++++---\n> >>  1 file changed, 25 insertions(+), 3 deletions(-)\n> >>\n> >> diff --git a/guilt-header b/guilt-header\n> >> index 41e00cc..4701b31 100755\n> >> --- a/guilt-header\n> >> +++ b/guilt-header\n> >> @@ -45,10 +45,32 @@ 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> >> -     die \"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; do\n> >> +     if [ \"$x\" = \"$patch\" ]; then\n> >> +             found_patch=\"$patch\"\n> >> +             break\n> >> +     fi\n> >> +done < \"$full_series\"\n> >\n> > We have to use a temp file instead of a 'get_full_series | while read x; do ...'\n> > because that'd create a subshell, correct?\n> \n> Yes. Also (and probably less importantly) we sometimes need to run grep on\n> the same output (see the creation of TMP_MATCHES below) and it would\n> be a bit wasteful to run get_full_series twice. (The assumption is that it is\n> cheaper to create a temp file than to recompute the value. I have not measured\n> this, though.)\n\nI think this is a fair assumption.\n\n> >> +if [ -z \"$found_patch\" ]; then\n> >> +     TMP_MATCHES=`get_tmp_file series`\n> >> +     grep \"$patch\" < \"$full_series\" > \"$TMP_MATCHES\"\n> >> +     nr=`wc -l < $TMP_MATCHES`\n> >> +     if [ $nr -gt 1 ]; then\n> >> +             echo \"$patch does not uniquely identify a patch. Did you mean any of these?\" >&2\n> >> +             sed 's/^/  /' \"$TMP_MATCHES\" >&2\n> >> +             rm -f \"$TMP_MATCHES\"\n> >> +             exit 1\n> >> +     elif [ $nr -eq 0 ]; then\n> >> +             rm -f \"$TMP_MATCHES\"\n> >> +             die \"Patch $patch is not in the series\"\n> >> +     fi\n> >> +     found_patch=`cat $TMP_MATCHES`\n> >> +     rm -f \"$TMP_MATCHES\"\n> >>  fi\n> >> +patch=\"$found_patch\"\n> >\n> > Do we not delete $full_series?\n> \n> Good catch. Will fix in the next version of the series.\n> \n> I'll also rename the variable $TMP_FULL_SERIES to adhere\n> to the apparent coding style. (But I will not fix guilt-patchbomb\n> that uses $dir as a temporary variable.)\n\nOk.\n\nThanks,\n\nJeff.\n\n-- \n*NOTE: This message is ROT-13 encrypted twice for extra protection*\n"}]}