# [RFE] Add config option to always add --signoff to git commit

2 messages from 2025-04-10 to 2025-04-10. Participants: Oliver Gondža, Junio C Hamano.
Thread: https://gitlist.dev/t/63276

## Oliver Gondža, 2025-04-10 07:54

Subject: [RFE] Add config option to always add --signoff to git commit
Message-ID: <ac87b389-2bf8-4c2e-aecd-9e86f65ca8c1@gmail.com>
URL: https://gitlist.dev/e/ac87b389-2bf8-4c2e-aecd-9e86f65ca8c1%40gmail.com

```
Hello, I would lide to propose an enhancement.

As a user, I need several repositories to have my commits both gpg 
signed, and their messages decorated with the `Signed-off-by:` trailer. 
This is a requirement to have the contribution accepted by respective 
communities.

The first part is easy to achieve using `commit.gpgsign=true`, but the 
latter, not so much.

Caveats with current feature set:

- Passing `--signoff`/`-s` every time is easy to forget. Even more so 
when some commits can be done by external tools (IDEs doing git pull 
with merge, etc.)

- Creating Git alias almost get there, but one cannot override what `git 
commit` does. So one have to remember to use the alias, that is error prone.

- Using custom hooks to pre-prepare the message is a bit more elaborate. 
Scales poorly with growing number of repositories requiring signoff. Can 
collide with other hooks touching the message for some other reason.

Possible courses of action:

- Introduce new config option `commit.signoff`, that would be 
independent of `commit.gpgsign`. It would simply cause `git commit` to 
always behave like `git commit --signoff`.

- Add 3rd possible value to `commit.gpgsign` to both sign and add trailer.

- Change `commit.gpgsign` semantics to always add the `Signed-off-by:` 
trailer if set to true. Likely have compatibility implications.

- Train developers to never forget `--signoff`/`-s`, befriend `git 
rebase --signoff` :-/

I appreciate any feedback. Thanks!
-- 
oliver


```

## Junio C Hamano, 2025-04-10 11:54

Subject: Re: [RFE] Add config option to always add --signoff to git commit
Message-ID: <xmqqo6x4p6z2.fsf@gitster.g>
URL: https://gitlist.dev/e/xmqqo6x4p6z2.fsf%40gitster.g
In-Reply-To: <ac87b389-2bf8-4c2e-aecd-9e86f65ca8c1@gmail.com>

```
Oliver Gondža <ogondza@gmail.com> writes:

> I appreciate any feedback. Thanks!

This is almost as old as Git itself.  Perhaps start from these places?

https://lore.kernel.org/git/Pine.LNX.4.63.0611281426311.30004@wbgn013.biozentrum.uni-wuerzburg.de/
https://lore.kernel.org/git/7veiw69p26.fsf@gitster.siamese.dyndns.org/
https://lore.kernel.org/git/cfa40ca5-98a1-fc9c-9ccc-f14b81119e60@gmail.com/

```
