{"thread":{"id":"7169","subject":"[StGit PATCH] Add an empty line before signed-off-by","startedAt":"2007-03-09T23:00:41Z","lastAt":"2007-03-12T21:13:20Z","messageCount":3,"participants":["Robin Rosenberg","Catalin Marinas"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"36696","messageId":"20070309225959.20959.32505.stgit@lathund.dewire.com","threadId":"7169","inReplyTo":null,"subject":"[StGit PATCH] Add an empty line before signed-off-by","fromName":"Robin Rosenberg","fromEmail":"robin.rosenberg@dewire.com","sentAt":"2007-03-09T23:00:41Z","receivedAt":"2007-03-09T23:00:41Z","isPatch":true,"sender":{"key":"robin.rosenberg@dewire.com","avatar":"https://avatars.githubusercontent.com/u/46357?v=4"},"body":"Default to the standard convention of having an empty line\nbefore the Signed-off line when addign a signature using the\n--sign option.\n\nSigned-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>\n---\n\n stgit/commands/refresh.py |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/stgit/commands/refresh.py b/stgit/commands/refresh.py\nindex 4cf09ae..dbcb757 100644\n--- a/stgit/commands/refresh.py\n+++ b/stgit/commands/refresh.py\n@@ -108,7 +108,7 @@ def func(parser, options, args):\n         options.authname, options.authemail = name_email(options.author)\n \n     if options.sign:\n-        sign_str = 'Signed-off-by'\n+        sign_str = '\\nSigned-off-by'\n         if options.ack:\n             raise CmdException, '--ack and --sign were both specified'\n     elif options.ack:\n"},{"id":"36917","messageId":"b0943d9e0703120925k17fb9cabt6b43e371433dfc9b@mail.gmail.com","threadId":"7169","inReplyTo":"20070309225959.20959.32505.stgit@lathund.dewire.com","subject":"Re: [StGit PATCH] Add an empty line before signed-off-by","fromName":"Catalin Marinas","fromEmail":"catalin.marinas@gmail.com","sentAt":"2007-03-12T16:25:45Z","receivedAt":"2007-03-12T16:25:45Z","isPatch":true,"sender":{"key":"catalin.marinas@gmail.com","avatar":null},"body":"On 09/03/07, Robin Rosenberg <robin.rosenberg@dewire.com> wrote:\n> Default to the standard convention of having an empty line\n> before the Signed-off line when addign a signature using the\n> --sign option.\n\nI mainly use this option to counter-sign an existing patch, in which\ncase there is no need for a new line. Maybe we need StGIT to be\nsmarter and check whether the patch was already signed.\n\n-- \nCatalin\n"},{"id":"36961","messageId":"200703122213.21298.robin.rosenberg@dewire.com","threadId":"7169","inReplyTo":"b0943d9e0703120925k17fb9cabt6b43e371433dfc9b@mail.gmail.com","subject":"Re: [StGit PATCH] Add an empty line before signed-off-by","fromName":"Robin Rosenberg","fromEmail":"robin.rosenberg@dewire.com","sentAt":"2007-03-12T21:13:20Z","receivedAt":"2007-03-12T21:13:20Z","isPatch":true,"sender":{"key":"robin.rosenberg@dewire.com","avatar":"https://avatars.githubusercontent.com/u/46357?v=4"},"body":"\n    Default to the standard convention of having an empty line\n    before the Signed-off line when addign a signature using the\n    --sign option. \n\n    Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>\n--\n\nmåndag 12 mars 2007 17:25 skrev Catalin Marinas:\n> On 09/03/07, Robin Rosenberg <robin.rosenberg@dewire.com> wrote:\n> > Default to the standard convention of having an empty line\n> > before the Signed-off line when addign a signature using the\n> > --sign option.\n> \n> I mainly use this option to counter-sign an existing patch, in which\n> case there is no need for a new line. Maybe we need StGIT to be\n> smarter and check whether the patch was already signed.\n\nOk, here's a smarter version\n\n-- robin\n\ndiff --git a/stgit/stack.py b/stgit/stack.py\nindex feb77e3..681da5e 100644\n--- a/stgit/stack.py\n+++ b/stgit/stack.py\n@@ -734,7 +734,12 @@ class Series(StgitObject):\n             committer_email = patch.get_commemail()\n\n         if sign_str:\n-            descr = '%s\\n%s: %s <%s>\\n' % (descr.rstrip(), sign_str,\n+            descr = descr.rstrip()\n+            if descr.find(\"\\nSigned-off-by\") < 0:\n+                if descr.find(\"\\nAcked-by\") < 0:\n+                    descr = descr + \"\\n\"\n+\n+            descr = '%s\\n%s: %s <%s>\\n' % (descr, sign_str,\n                                            committer_name, committer_email)\n\n         bottom = patch.get_bottom()\n"}]}