Signed-off-by vs Reviewed-by
Hi,
Some projects like LibreOffice don't use Signed-off-by, instead usually use Gerrit for code review, and reviewers add a Reviewed-by line when they are OK with a patch. In this workflow it's a bit unfortunate that adding a Signed-off-by line is just a command-line switch, but adding a Reviewed-by line is more complex.
Is there anything in git that could help this situation? I didn't see any related config option; I wonder if a patch would be accepted to make the "Signed-off-by" line configurable, or there is a better way.
Like, would a patch that adds e.g. a core.signedOffString configuration option to make the string customizable welcome?
Thanks,
Miklos
Quoted 11 lines · Miklos Vajna
Hi,
Some projects like LibreOffice don't use Signed-off-by, instead usually use Gerrit for code review, and reviewers add a Reviewed-by line when they are OK with a patch. In this workflow it's a bit unfortunate that adding a Signed-off-by line is just a command-line switch, but adding a Reviewed-by line is more complex.
Is there anything in git that could help this situation? I didn't see any related config option; I wonder if a patch would be accepted to make the "Signed-off-by" line configurable, or there is a better way.
There's git-interpret-trailers, which can do the heavy lifting of adding it in the right place. But I don't know how you'd want to trigger it; it would depend on the workflow that people use to add their signoff in the first place. I don't think there is anything as easy as "git commit --amend -s", but I'm not all that familiar with the interpret-trailers code.
-Peff
Quoted 14 lines · Jeff King
Quoted 11 lines · Miklos Vajna
Hi,
Some projects like LibreOffice don't use Signed-off-by, instead usually use Gerrit for code review, and reviewers add a Reviewed-by line when they are OK with a patch. In this workflow it's a bit unfortunate that adding a Signed-off-by line is just a command-line switch, but adding a Reviewed-by line is more complex.
Is there anything in git that could help this situation? I didn't see any related config option; I wonder if a patch would be accepted to make the "Signed-off-by" line configurable, or there is a better way.
Quoted 6 lines
There's git-interpret-trailers, which can do the heavy lifting of adding it in the right place. But I don't know how you'd want to trigger it; it would depend on the workflow that people use to add their signoff in the first place. I don't think there is anything as easy as "git commit --amend -s", but I'm not all that familiar with the interpret-trailers code.
The plan was to make it possible for many commands, like commit, cherry-pick, am, and so on, to accept "--trailer ..." options and to pass them to interpret-trailers that would process them. I remember starting working on that and sending some patches at one point...
Quoted 11 lines · Miklos Vajna
Hi,
Some projects like LibreOffice don't use Signed-off-by, instead usually use Gerrit for code review, and reviewers add a Reviewed-by line when they are OK with a patch. In this workflow it's a bit unfortunate that adding a Signed-off-by line is just a command-line switch, but adding a Reviewed-by line is more complex.
Is there anything in git that could help this situation? I didn't see any related config option; I wonder if a patch would be accepted to make the "Signed-off-by" line configurable, or there is a better way.
Actually there is a "related" config option format.signOff (more about this in Documentation/config.txt) which is a boolean.
But that will only enable the "-s" by default.
Quoted 2 lines
Like, would a patch that adds e.g. a core.signedOffString configuration option to make the string customizable welcome?
Are you suggesting to use a different email address for commiting, signing off and reviewing?
Quoted 3 lines
Thanks,
Miklos
Hi,
Quoted 2 lines · Pranit Bauva
Are you suggesting to use a different email address for commiting, signing off and reviewing?
Let's say project A has a workflow where patch authors and maintainers add a "Signed-off-by: A B <[email protected]>" line. This is well-supported by git, various commands have a -s option to add that line.
However, if project B has a workflow where patch authors add no such line, and reviewers add a "Reviewed-by: A B <[email protected]>" line, then you have to add that line manually when you do a review.
I suggest to give a bit more support to this workflow in git. One way of doing that would be to make the Signed-off-by string configurable. I can look into implementing that, but first I wanted to discuss the idea here on the list -- perhaps there is a better way to support that. :-)
Typing that line (including copy&pasting your name + email all the time) is a bit boring.
Regards,
Miklos
Hi,
Quoted 5 lines · Miklos Vajna
Hi,
Quoted 2 lines · Pranit Bauva
Are you suggesting to use a different email address for commiting, signing off and reviewing?
Quoted 7 lines
Let's say project A has a workflow where patch authors and maintainers add a "Signed-off-by: A B <[email protected]>" line. This is well-supported by git, various commands have a -s option to add that line.
However, if project B has a workflow where patch authors add no such line, and reviewers add a "Reviewed-by: A B <[email protected]>" line, then you have to add that line manually when you do a review.
When making the string configurable, would it be a good idea to support more than one sign-off strings? For instance, often patches here in Git have both a Signed-Off and a Reviewed-by line. What would you suggest for such a case?
Regards,
Sidhant
Quoted 12 lines · Sidhant Sharma
Hi,
Quoted 9 lines · Miklos Vajna
Hi,
Quoted 2 lines · Pranit Bauva
Are you suggesting to use a different email address for commiting, signing off and reviewing?
Let's say project A has a workflow where patch authors and maintainers add a "Signed-off-by: A B <[email protected]>" line. This is well-supported by git, various commands have a -s option to add that line.
Quoted 7 lines
Quoted 3 lines
However, if project B has a workflow where patch authors add no such line, and reviewers add a "Reviewed-by: A B <[email protected]>" line, then you have to add that line manually when you do a review.
When making the string configurable, would it be a good idea to support more than one sign-off strings? For instance, often patches here in Git have both a Signed-Off and a Reviewed-by line. What would you suggest for such a case?
"git interpret-trailers" supports many kinds of trailers. There were a lot of related discussions/bikeshedding when it was designed and worked on.
Quoted 2 lines · Miklos Vajna
Typing that line (including copy&pasting your name + email all the time) is a bit boring.
I think the last message from Christian in the thread points at the right direction in the future.
The internal "parse the existing trailer block and manipulate it by adding, conditionally adding, replacing and deleting it" logic was done as an experimental "interpret-trailers" program, but polishing it (both its design and implementation) and integrating it to the front-line programs (e.g. "git commit") hasn't been done.
As to the last step of "integration", we cannot use short-and-sweet single letter options like '-s' (for sign-off) for each and every custom trailer different projects use for their own purpose (as there are only 26 of the lowercase ASCII alphabet letters), so the most general syntax for the option has to become "--trailer <arg>" or some variation of it, and at that point "-s" would look like a short-hand for "--trailer signed-off-by".
Quoted 7 lines · Junio C Hamano
As to the last step of "integration", we cannot use short-and-sweet single letter options like '-s' (for sign-off) for each and every custom trailer different projects use for their own purpose (as there are only 26 of the lowercase ASCII alphabet letters), so the most general syntax for the option has to become "--trailer <arg>" or some variation of it, and at that point "-s" would look like a short-hand for "--trailer signed-off-by".
I can imagine it would be useful to give one short-and-sweet to "add my standard trailers", where that standard set is defined in the config file. But that is just a guess; I do not personally have a workflow where such standard trailers exist, beyond the normal s-o-b.
-Peff
Quoted 10 lines · Jeff King
Quoted 7 lines · Junio C Hamano
As to the last step of "integration", we cannot use short-and-sweet single letter options like '-s' (for sign-off) for each and every custom trailer different projects use for their own purpose (as there are only 26 of the lowercase ASCII alphabet letters), so the most general syntax for the option has to become "--trailer <arg>" or some variation of it, and at that point "-s" would look like a short-hand for "--trailer signed-off-by".
Quoted 4 lines
I can imagine it would be useful to give one short-and-sweet to "add my standard trailers", where that standard set is defined in the config file. But that is just a guess; I do not personally have a workflow where such standard trailers exist, beyond the normal s-o-b.
Yup, I agree; I meant by "some variation of it" to cover such an arrangement ;-)
Hi,
Quoted 5 lines · Junio C Hamano
The internal "parse the existing trailer block and manipulate it by adding, conditionally adding, replacing and deleting it" logic was done as an experimental "interpret-trailers" program, but polishing it (both its design and implementation) and integrating it to the front-line programs (e.g. "git commit") hasn't been done.
I had a look at interpret-trailers, and one use-case I miss is: being able to define a trailer type, but only add it when asked explicitly.
Example:
----
$ git config trailer.review.key "Reviewed-by: " $ git config trailer.review.command 'echo "$(git config user.name) <$(git config user.email)>"' $ echo foo|git interpret-trailers foo
$ echo foo|git interpret-trailers --trailer review foo
----
I can imagine e.g. a new configuration vaulue named trailer.<token>.ifMissing explicit, and when that's set, the trailer would be only added if it's spelled out explicitly using '--trailer <token>'.
Does this sound like a good idea, or did I miss some way how this is already possible? :-)
Quoted 7 lines
As to the last step of "integration", we cannot use short-and-sweet single letter options like '-s' (for sign-off) for each and every custom trailer different projects use for their own purpose (as there are only 26 of the lowercase ASCII alphabet letters), so the most general syntax for the option has to become "--trailer <arg>" or some variation of it, and at that point "-s" would look like a short-hand for "--trailer signed-off-by".
Hmm, I think the above has to be implemented first, otherwise it'll be hard to make "-s" an alias of "--trailer signed-off-by". (I mean having git understand what "signed-off-by" is, still adding it conditionally.)
Regards,
Miklos