Thread (14 messages) flat view 14 messages, 3 authors, 2016-06-15

Re: [PATCH v12 11/11] Documentation: add documentation for 'git interpret-trailers'

From: Christian Couder <hidden>
Date: 2016-06-15 23:01:47

On Mon, Jun 30, 2014 at 1:57 PM, Jakub Narębski [off-list ref] wrote:
Christian Couder wrote:
quoted
+------------
+
+* Configure a 'sign' trailer with a command to automatically add a
+  'Signed-off-by: ' with the author information only if there is no
+  'Signed-off-by: ' already, and show how it works:
++
+------------
+$ git config trailer.sign.key "Signed-off-by: "
+$ git config trailer.sign.ifmissing add
+$ git config trailer.sign.ifexists doNothing
+$ git config trailer.sign.command 'echo "$(git config user.name) <$(git
config user.email)>"'
+$ git interpret-trailers <<EOF
+> EOF

How to configure git-interpret-trailers command so that it follow
current rules for DCO:
* Signed-off-by: is always at bottom; we can have
  signoff+signoff+ack+signoff
* Signed-off-by: can repeat itself with the same author;
  this denotes steps in coming up with current version of the patch.
* but we shouldn't repeat the same signoff one after another
Right now something like: signoff+signoff+ack+signoff is not supported.

It could be, if someone implements more options for the
"trailer.<token>.where" config variable. Right now the only options
are "after" and "before", but it could be possible to have "end" and
"start" too. And maybe "end" should be the default instead of "after".

When I first worked on this series I was under the impression that
people wanted to group all the trailers with the same token together.
So we want to allow this:

  Signed-off-by: A U Thor [off-list ref]
  Signed-off-by: Joe R. Hacker [off-list ref]
  Acked-by: D E Veloper [off-list ref]
  Signed-off-by: C O Mitter [off-list ref]

but prevent this

  Signed-off-by: C O Mitter [off-list ref]
  Signed-off-by: C O Mitter [off-list ref]
This can be prevented by using "addIfDifferentNeighbor", for example like this:

$ git config trailer.sign.ifexists addIfDifferentNeighbor

So I think the full config for what you want would be something like:

$ git config trailer.sign.key "Signed-off-by: "
$ git config trailer.sign.ifmissing add
$ git config trailer.sign.ifexists addIfDifferentNeighbor
$ git config trailer.sign.where end
$ git config trailer.sign.command 'echo "$(git config user.name)
<$(git config user.email)>"'

$ git config trailer.ack.key "Acked-by: "
$ git config trailer.ack.ifmissing add
$ git config trailer.ack.ifexists addIfDifferentNeighbor
$ git config trailer.ack.where end

Best,
Christian.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help