# [StGit PATCH] Add an empty line before signed-off-by

3 messages from 2007-03-09 to 2007-03-12. Participants: Robin Rosenberg, Catalin Marinas.
Thread: https://gitlist.dev/t/7169

## Robin Rosenberg, 2007-03-09 23:00

Subject: [StGit PATCH] Add an empty line before signed-off-by
Message-ID: <20070309225959.20959.32505.stgit@lathund.dewire.com>
URL: https://gitlist.dev/e/20070309225959.20959.32505.stgit%40lathund.dewire.com

```
Default to the standard convention of having an empty line
before the Signed-off line when addign a signature using the
--sign option.

Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
---

 stgit/commands/refresh.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/stgit/commands/refresh.py b/stgit/commands/refresh.py
index 4cf09ae..dbcb757 100644
--- a/stgit/commands/refresh.py
+++ b/stgit/commands/refresh.py
@@ -108,7 +108,7 @@ def func(parser, options, args):
         options.authname, options.authemail = name_email(options.author)
 
     if options.sign:
-        sign_str = 'Signed-off-by'
+        sign_str = '\nSigned-off-by'
         if options.ack:
             raise CmdException, '--ack and --sign were both specified'
     elif options.ack:

```

## Catalin Marinas, 2007-03-12 16:25

Subject: Re: [StGit PATCH] Add an empty line before signed-off-by
Message-ID: <b0943d9e0703120925k17fb9cabt6b43e371433dfc9b@mail.gmail.com>
URL: https://gitlist.dev/e/b0943d9e0703120925k17fb9cabt6b43e371433dfc9b%40mail.gmail.com
In-Reply-To: <20070309225959.20959.32505.stgit@lathund.dewire.com>

```
On 09/03/07, Robin Rosenberg <robin.rosenberg@dewire.com> wrote:
> Default to the standard convention of having an empty line
> before the Signed-off line when addign a signature using the
> --sign option.

I mainly use this option to counter-sign an existing patch, in which
case there is no need for a new line. Maybe we need StGIT to be
smarter and check whether the patch was already signed.

-- 
Catalin

```

## Robin Rosenberg, 2007-03-12 21:13

Subject: Re: [StGit PATCH] Add an empty line before signed-off-by
Message-ID: <200703122213.21298.robin.rosenberg@dewire.com>
URL: https://gitlist.dev/e/200703122213.21298.robin.rosenberg%40dewire.com
In-Reply-To: <b0943d9e0703120925k17fb9cabt6b43e371433dfc9b@mail.gmail.com>

```

    Default to the standard convention of having an empty line
    before the Signed-off line when addign a signature using the
    --sign option. 

    Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
--

måndag 12 mars 2007 17:25 skrev Catalin Marinas:
> On 09/03/07, Robin Rosenberg <robin.rosenberg@dewire.com> wrote:
> > Default to the standard convention of having an empty line
> > before the Signed-off line when addign a signature using the
> > --sign option.
> 
> I mainly use this option to counter-sign an existing patch, in which
> case there is no need for a new line. Maybe we need StGIT to be
> smarter and check whether the patch was already signed.

Ok, here's a smarter version

-- robin

diff --git a/stgit/stack.py b/stgit/stack.py
index feb77e3..681da5e 100644
--- a/stgit/stack.py
+++ b/stgit/stack.py
@@ -734,7 +734,12 @@ class Series(StgitObject):
             committer_email = patch.get_commemail()

         if sign_str:
-            descr = '%s\n%s: %s <%s>\n' % (descr.rstrip(), sign_str,
+            descr = descr.rstrip()
+            if descr.find("\nSigned-off-by") < 0:
+                if descr.find("\nAcked-by") < 0:
+                    descr = descr + "\n"
+
+            descr = '%s\n%s: %s <%s>\n' % (descr, sign_str,
                                            committer_name, committer_email)

         bottom = patch.get_bottom()

```
