{"thread":{"id":"63276","subject":"[RFE] Add config option to always add --signoff to git commit","startedAt":"2025-04-10T07:54:12Z","lastAt":"2025-04-10T11:54:28Z","messageCount":2,"participants":["Oliver Gondža","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"515940","messageId":"ac87b389-2bf8-4c2e-aecd-9e86f65ca8c1@gmail.com","threadId":"63276","inReplyTo":null,"subject":"[RFE] Add config option to always add --signoff to git commit","fromName":"Oliver Gondža","fromEmail":"ogondza@gmail.com","sentAt":"2025-04-10T07:54:09Z","receivedAt":"2025-04-10T07:54:12Z","isPatch":false,"sender":{"key":"ogondza@gmail.com","avatar":null},"body":"Hello, I would lide to propose an enhancement.\n\nAs a user, I need several repositories to have my commits both gpg \nsigned, and their messages decorated with the `Signed-off-by:` trailer. \nThis is a requirement to have the contribution accepted by respective \ncommunities.\n\nThe first part is easy to achieve using `commit.gpgsign=true`, but the \nlatter, not so much.\n\nCaveats with current feature set:\n\n- Passing `--signoff`/`-s` every time is easy to forget. Even more so \nwhen some commits can be done by external tools (IDEs doing git pull \nwith merge, etc.)\n\n- Creating Git alias almost get there, but one cannot override what `git \ncommit` does. So one have to remember to use the alias, that is error prone.\n\n- Using custom hooks to pre-prepare the message is a bit more elaborate. \nScales poorly with growing number of repositories requiring signoff. Can \ncollide with other hooks touching the message for some other reason.\n\nPossible courses of action:\n\n- Introduce new config option `commit.signoff`, that would be \nindependent of `commit.gpgsign`. It would simply cause `git commit` to \nalways behave like `git commit --signoff`.\n\n- Add 3rd possible value to `commit.gpgsign` to both sign and add trailer.\n\n- Change `commit.gpgsign` semantics to always add the `Signed-off-by:` \ntrailer if set to true. Likely have compatibility implications.\n\n- Train developers to never forget `--signoff`/`-s`, befriend `git \nrebase --signoff` :-/\n\nI appreciate any feedback. Thanks!\n-- \noliver\n\n"},{"id":"515956","messageId":"xmqqo6x4p6z2.fsf@gitster.g","threadId":"63276","inReplyTo":"ac87b389-2bf8-4c2e-aecd-9e86f65ca8c1@gmail.com","subject":"Re: [RFE] Add config option to always add --signoff to git commit","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2025-04-10T11:54:25Z","receivedAt":"2025-04-10T11:54:28Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Oliver Gondža <ogondza@gmail.com> writes:\n\n> I appreciate any feedback. Thanks!\n\nThis is almost as old as Git itself.  Perhaps start from these places?\n\nhttps://lore.kernel.org/git/Pine.LNX.4.63.0611281426311.30004@wbgn013.biozentrum.uni-wuerzburg.de/\nhttps://lore.kernel.org/git/7veiw69p26.fsf@gitster.siamese.dyndns.org/\nhttps://lore.kernel.org/git/cfa40ca5-98a1-fc9c-9ccc-f14b81119e60@gmail.com/\n"}]}