{"thread":{"id":"11560","subject":"Signing by StGIT broken","startedAt":"2008-01-10T02:53:16Z","lastAt":"2008-01-18T03:51:53Z","messageCount":4,"participants":["Pavel Roskin","Karl Hasselström"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"64893","messageId":"1199933596.21499.15.camel@dv","threadId":"11560","inReplyTo":null,"subject":"Signing by StGIT broken","fromName":"Pavel Roskin","fromEmail":"proski@gnu.org","sentAt":"2008-01-10T02:53:16Z","receivedAt":"2008-01-10T02:53:16Z","isPatch":false,"sender":{"key":"proski@gnu.org","avatar":null},"body":"Hello!\n\n\"stg edit --sign\" is not working anymore.  It was working in version\n0.14.\n\n$ stg edit --sign\nChecking for changes in the working directory ... done\nUpdating patch \"id123\" ... Traceback (most recent call last):\n  File \"/home/proski/bin/stg\", line 43, in <module>\n    main()\n  File \"home/proski/lib/python2.5/site-packages/stgit/main.py\", line 278, in main\n  File \"home/proski/lib/python2.5/site-packages/stgit/commands/edit.py\", line 235, in func\n  File \"home/proski/lib/python2.5/site-packages/stgit/commands/edit.py\", line 93, in __update_patch\n  File \"home/proski/lib/python2.5/site-packages/stgit/commands/common.py\", line 469, in parse_patch\n  File \"home/proski/lib/python2.5/site-packages/stgit/commands/common.py\", line 359, in __split_descr_diff\nAttributeError: 'NoneType' object has no attribute 'split'\n\ngit-bisect reports this:\n\na08e424021d32bf93ee7bb13ed0a9d7313367660 is first bad commit\ncommit a08e424021d32bf93ee7bb13ed0a9d7313367660\nAuthor: Karl HasselstrÃ¶m <kha@treskal.com>\nDate:   Thu Dec 13 00:13:55 2007 +0100\n\n    Make generic --message/--file/--save-template flags\n    \n    And let \"stg edit\" use them.\n    \n    Signed-off-by: Karl HasselstrÃ¶m <kha@treskal.com>\n\n:040000 040000 0c9317423123d328e8bf03866c08fa458808dce4 9195692410c3ed8171f2f799a8e3efd101a89a14 M      stgit\n\n\nI suspect this part:\n\n- elif options.file:\n- __update_patch(pname, options.file, options)\n+ elif any([options.message, options.authname, options.authemail,\n+ options.authdate, options.commname, options.commemail,\n+ options.sign_str]):\n+ out.start('Updating patch \"%s\"' % pname)\n+ __update_patch(pname, options.message, options)\n+ out.done()\n\noptions.message is passed even if it's None and something else (like\noptions.sign_str) is defined.\n\n-- \nRegards,\nPavel Roskin\n"},{"id":"64910","messageId":"20080110074252.GA18629@diana.vm.bytemark.co.uk","threadId":"11560","inReplyTo":"1199933596.21499.15.camel@dv","subject":"Re: Signing by StGIT broken","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2008-01-10T07:42:52Z","receivedAt":"2008-01-10T07:42:52Z","isPatch":false,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"On 2008-01-09 21:53:16 -0500, Pavel Roskin wrote:\n\n> \"stg edit --sign\" is not working anymore. It was working in version\n> 0.14.\n\nThanks for the report and the detailed analysis. I'll write a test and\nfix it (but not quite immediately, so feel free to beat me to it).\n\n-- \nKarl Hasselström, kha@treskal.com\n      www.treskal.com/kalle\n"},{"id":"65122","messageId":"1200113883.26841.18.camel@rd","threadId":"11560","inReplyTo":"20080110074252.GA18629@diana.vm.bytemark.co.uk","subject":"Re: Signing by StGIT broken","fromName":"Pavel Roskin","fromEmail":"proski@gnu.org","sentAt":"2008-01-12T04:58:03Z","receivedAt":"2008-01-12T04:58:03Z","isPatch":false,"sender":{"key":"proski@gnu.org","avatar":null},"body":"On Thu, 2008-01-10 at 08:42 +0100, Karl Hasselström wrote:\n> On 2008-01-09 21:53:16 -0500, Pavel Roskin wrote:\n> \n> > \"stg edit --sign\" is not working anymore. It was working in version\n> > 0.14.\n> \n> Thanks for the report and the detailed analysis. I'll write a test and\n> fix it (but not quite immediately, so feel free to beat me to it).\n\nThe fix below appears to work (thus making it a self-signing patch :))\nbut with my modest Python experience it absolutely needs to be reviewed.\nI don't even know how to wrap the long line without making it look\nmisleading.\n\nNo testsuite fixes, sorry.  But the existing testsuite passes.\n\n\nFix \"stg edit --sign\"\n\nSigned-off-by: Pavel Roskin <proski@gnu.org>\n---\n\n stgit/commands/edit.py |    5 ++++-\n 1 files changed, 4 insertions(+), 1 deletions(-)\n\n\ndiff --git a/stgit/commands/edit.py b/stgit/commands/edit.py\nindex b9699d5..650d5a3 100644\n--- a/stgit/commands/edit.py\n+++ b/stgit/commands/edit.py\n@@ -90,7 +90,10 @@ def __update_patch(pname, text, options):\n     bottom = patch.get_bottom()\n     top = patch.get_top()\n \n-    message, author_name, author_email, author_date, diff = parse_patch(text)\n+    if text:\n+        message, author_name, author_email, author_date, diff = parse_patch(text)\n+    else:\n+        message = author_name = author_email = author_date = diff = None\n \n     out.start('Updating patch \"%s\"' % pname)\n \n\n-- \nRegards,\nPavel Roskin\n"},{"id":"65818","messageId":"20080118035153.GA12149@diana.vm.bytemark.co.uk","threadId":"11560","inReplyTo":"1200113883.26841.18.camel@rd","subject":"Re: Signing by StGIT broken","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2008-01-18T03:51:53Z","receivedAt":"2008-01-18T03:51:53Z","isPatch":false,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"On 2008-01-11 23:58:03 -0500, Pavel Roskin wrote:\n\n> On Thu, 2008-01-10 at 08:42 +0100, Karl Hasselström wrote:\n>\n> > On 2008-01-09 21:53:16 -0500, Pavel Roskin wrote:\n> >\n> > > \"stg edit --sign\" is not working anymore. It was working in version\n> > > 0.14.\n> >\n> > Thanks for the report and the detailed analysis. I'll write a test\n> > and fix it (but not quite immediately, so feel free to beat me to\n> > it).\n>\n> The fix below appears to work (thus making it a self-signing patch\n> :)) but with my modest Python experience it absolutely needs to be\n> reviewed. I don't even know how to wrap the long line without making\n> it look misleading.\n\nIt works by virtue of avoiding passing None to parse_patch(), which\nexpects a string object. So the fix is correct.\n\nThere are two ways to do line breaking in Python:\n\n  1. Break the line between a pair of parentheses. That way, the\n     parser knows that the line can't possibly end here:\n\n       foo(1, 2, 3,\n           4, 5, 6)\n\n       x = { 'foo': 5,\n             'bar': 17 }\n\n  2. As a last resort, you can end a line with backslash:\n\n       x = 1 + 2 + 3 \\\n           + 4 + 5 + 6\n\n     But you should never use this. Insert a pair of otherwise\n     redundant parentheses instead:\n\n       x = (1 + 2 + 3\n            + 4 + 5 + 6)\n\n-- \nKarl Hasselström, kha@treskal.com\n      www.treskal.com/kalle\n"}]}