threads / discuss / 11726

stgit: managing signed-off-by lines

Subject: stgit: managing signed-off-by lines

## tl;dr

7 messages between Jan 24, 2008 and Jan 25, 2008.

replies: 6people: 2as markdown or json

Jon Smirl· Jan 24, 2008, 20:27 UTC · lore

If I import a series of patches from one of my trees into another, stgit preserves the signed-off-by lines like you would expect it to. When I export these patches it adds a signed-off-by line for myself again like you would expect it to. But adding this line on export needs to checks and make sure that my name isn't already in the signed-off-by list, without this check I have to manually remove my name when it gets duplicated.

-- 
Jon Smirl
jonsmirl@gmail.com
Karl Hasselström· Jan 25, 2008, 08:38 UTC · re: Jon Smirl · lore

Re: stgit: managing signed-off-by lines

On 2008-01-24 15:27:17 -0500, Jon Smirl wrote:
Show 7 quoted lines
> If I import a series of patches from one of my trees into another,
> stgit preserves the signed-off-by lines like you would expect it to.
> When I export these patches it adds a signed-off-by line for myself
> again like you would expect it to. But adding this line on export
> needs to checks and make sure that my name isn't already in the
> signed-off-by list, without this check I have to manually remove my
> name when it gets duplicated.
What command are you using to export patches?

IIRC, all commands that have --sign and --ack flags already to check for duplicates. But if you do something like have your sign-off line in the template the export command uses, that would lead to duplicates.

-- 
Karl Hasselström, kha@treskal.com
      www.treskal.com/kalle
Jon Smirl· Jan 25, 2008, 13:34 UTC · re: Karl Hasselström · lore

Re: stgit: managing signed-off-by lines

On 1/25/08, Karl Hasselström <kha@treskal.com> wrote:
Show 11 quoted lines
> On 2008-01-24 15:27:17 -0500, Jon Smirl wrote:
>
> > If I import a series of patches from one of my trees into another,
> > stgit preserves the signed-off-by lines like you would expect it to.
> > When I export these patches it adds a signed-off-by line for myself
> > again like you would expect it to. But adding this line on export
> > needs to checks and make sure that my name isn't already in the
> > signed-off-by list, without this check I have to manually remove my
> > name when it gets duplicated.
>
> What command are you using to export patches?

I am using "stg export" from one branch and then "stg import -s" on another. After I import the patch and do 'stg edit' on it, it has the signed-off-by line in it. When it is export from that branch the signed-off-by get added again.

You don't want to strip the signed-off-by lines on import, they may be from other people. I would think that on export you could look and see if my signed-off-by line is already on the patch before adding it again.

I might be able to handle this better by rebasing my master from both linus/master and my branch containing these i2c patches that are taking so long to get in. That would avoid the import/export step. But then I can't edit the patches directly on my master branch.

Show 10 quoted lines
>
> IIRC, all commands that have --sign and --ack flags already to check
> for duplicates. But if you do something like have your sign-off line
> in the template the export command uses, that would lead to
> duplicates.
>
> --
> Karl Hasselström, kha@treskal.com
>       www.treskal.com/kalle
>
-- 
Jon Smirl
jonsmirl@gmail.com
Karl Hasselström· Jan 25, 2008, 14:30 UTC · re: Jon Smirl · lore

Re: stgit: managing signed-off-by lines

On 2008-01-25 08:34:53 -0500, Jon Smirl wrote:
Show 13 quoted lines
> On 1/25/08, Karl Hasselström <kha@treskal.com> wrote:
>
> > What command are you using to export patches?
>
> I am using "stg export" from one branch and then "stg import -s" on
> another. After I import the patch and do 'stg edit' on it, it has
> the signed-off-by line in it. When it is export from that branch the
> signed-off-by get added again.
>
> You don't want to strip the signed-off-by lines on import, they may
> be from other people. I would think that on export you could look
> and see if my signed-off-by line is already on the patch before
> adding it again.

I haven't set up my templates to add sign-offs on export; instead, I give --sign to "stg import". This always does the right thing:

  1. It's smart enough to notice if my sign-off is already there, and
     don't add another copy.
  2. My sign-off is propagated even if the patches are transferred by
     pulling instead of by email or "stg export".

For patches that I write myself (so that they are never "stg import"ed), I add the sign-off manually in the commit message, with the aid of this elisp snippet:

  (defun sign-off ()
    "Insert sign-off line."
    (interactive)
    (git-append-sign-off (git-get-committer-name) (git-get-committer-email))))

Adding the sign-off conditionally in "stg mail" and "stg export", as you suggest, could of course be done. But that would have to be command line options, since the template system can't really express that kind of transformation.

-- 
Karl Hasselström, kha@treskal.com
      www.treskal.com/kalle
Jon Smirl· Jan 25, 2008, 14:43 UTC · re: Karl Hasselström · lore

Re: stgit: managing signed-off-by lines

On 1/25/08, Karl Hasselström <kha@treskal.com> wrote:
Show 24 quoted lines
> On 2008-01-25 08:34:53 -0500, Jon Smirl wrote:
>
> > On 1/25/08, Karl Hasselström <kha@treskal.com> wrote:
> >
> > > What command are you using to export patches?
> >
> > I am using "stg export" from one branch and then "stg import -s" on
> > another. After I import the patch and do 'stg edit' on it, it has
> > the signed-off-by line in it. When it is export from that branch the
> > signed-off-by get added again.
> >
> > You don't want to strip the signed-off-by lines on import, they may
> > be from other people. I would think that on export you could look
> > and see if my signed-off-by line is already on the patch before
> > adding it again.
>
> I haven't set up my templates to add sign-offs on export; instead, I
> give --sign to "stg import". This always does the right thing:
>
>   1. It's smart enough to notice if my sign-off is already there, and
>      don't add another copy.
>
>   2. My sign-off is propagated even if the patches are transferred by
>      pulling instead of by email or "stg export".

Yes, I added Signed-of-by to the export and mail templates. I did it six months ago and I had forgotten. I can fix this by just removing it from the export template. I've learned to use 'stg mail' now and it is the only way I publicly expose patches. It works to just add the Signed-off-by at the email stage.

Longer term you may want to add a de-dupe check for the signed-off-by lines that gets called in all contexts.

Show 19 quoted lines
>
> For patches that I write myself (so that they are never "stg
> import"ed), I add the sign-off manually in the commit message, with
> the aid of this elisp snippet:
>
>   (defun sign-off ()
>     "Insert sign-off line."
>     (interactive)
>     (git-append-sign-off (git-get-committer-name) (git-get-committer-email))))
>
> Adding the sign-off conditionally in "stg mail" and "stg export", as
> you suggest, could of course be done. But that would have to be
> command line options, since the template system can't really express
> that kind of transformation.
>
> --
> Karl Hasselström, kha@treskal.com
>       www.treskal.com/kalle
>
-- 
Jon Smirl
jonsmirl@gmail.com
Karl Hasselström· Jan 25, 2008, 15:40 UTC · re: Jon Smirl · lore

Re: stgit: managing signed-off-by lines

On 2008-01-25 09:43:51 -0500, Jon Smirl wrote:
> Longer term you may want to add a de-dupe check for the
> signed-off-by lines that gets called in all contexts.

Mmm. You mean some kind of sanity check filter that's applied after the template? I guess we could do that, but it feels like that kind of approach could easily get out of hand.

-- 
Karl Hasselström, kha@treskal.com
      www.treskal.com/kalle
Karl Hasselström· Jan 25, 2008, 14:34 UTC · re: Jon Smirl · lore

Re: stgit: managing signed-off-by lines

On 2008-01-25 08:34:53 -0500, Jon Smirl wrote:
> I am using "stg export" from one branch and then "stg import -s" on
> another. After I import the patch and do 'stg edit' on it, it has
> the signed-off-by line in it.
Pass --sign to "stg import" to add the sob line automatically.
-- 
Karl Hasselström, kha@treskal.com
      www.treskal.com/kalle

← back to recent threads