git add Signed-off-by line using format.signoff not working

config, format, git

Solution

Update for Git 2.14.x/2.15: as I mentioned in "Git - Detect if commit is signed off programmatically", you will be able to parse a commit message trailer for `Signed-off-By` line.

"`git interpret-trailers`" has been taught a "`--parse`" and a few other options to make it easier for scripts to grab existing trailer lines from a commit log message.

See stefanct's answer for `commit-msg` client-side hook which would use `git interpret-trailers`.

Original answer (2013)

`format.signoff` is about patch (as illustrated, for instance, in this patch):

format.signoff

A boolean value which lets you enable the -s/--signoff option of `format-patch` by default

It has no bearing on `git commit -s`.

In other words, you don't have to signoff every commit, but when you are publishing them as patch for others to use (as in "git: submitting patches"), then you should sign them.

For the exact signification of `Signed-of-by`, see "What is the Sign Off feature in Git for?".

Problem

My client git version is 1.7.0.4. I want to automatically add a "Signed-off-by" line for the committer at the end of the commit log message when commit a message. - When I set `git config --global format.signoff true`, and run `git commit -m "modify something"`, I see no "Signed-off-by" in `git log`. - If I use `git commit -m -s "modify something"`, then "Signed-off-by" does show in `git log`. Can anyone help?

Original source

Related problems