From: "Oliver Gondža" <ogondza@gmail.com>
To: git@vger.kernel.org
Subject: [RFE] Add config option to always add --signoff to git commit
Date: Thu, 10 Apr 2025 09:54:09 +0200 [thread overview]
Message-ID: <ac87b389-2bf8-4c2e-aecd-9e86f65ca8c1@gmail.com> (raw)
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
next reply other threads:[~2025-04-10 7:54 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-10 7:54 Oliver Gondža [this message]
2025-04-10 11:54 ` [RFE] Add config option to always add --signoff to git commit Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ac87b389-2bf8-4c2e-aecd-9e86f65ca8c1@gmail.com \
--to=ogondza@gmail.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).