Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow signing commits by other authors when rewriting them #5408

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Wuestengecko
Copy link

Hi! I want to try and get the ball rolling on a fix for #4561, so here's a first shot at it. This simply adds another boolean flag sign-foreign, which upgrades SignBehavior::Own to Force. As such, it's a very non-invasive change.

The code in this PR is working fine for me locally, but I haven't really looked into automated tests yet.

One proposed alternative is to change it to a sign variable that takes one of these behavior names. This would require migration or deprecation of the previous sign-all flag, which I haven't figured out how it works yet :)

Please let me know what you think about this. I'm also happy to change to a different approach (although it might take me a while, as I'm new to this codebase).

Checklist

If applicable:

  • I have updated CHANGELOG.md
  • I have updated the documentation (README.md, docs/, demos/)
  • I have updated the config schema (cli/src/config-schema.json)
  • I have added tests to cover my changes

The 'signing.sign-all' setting only applies to own commits (i.e. where
the author email equals the `user.email`). However, some environments
require all commits to be signed, no matter who authored them. To
address this need, this commit introduces the additional setting
`signing.sign-foreign`, which - in combination with `sign-all` - will
ensure that these commits will be signed with the user's configured
signing key when rewriting them.
@Wuestengecko Wuestengecko changed the title sign: Add 'sign-foreign' to also sign foreign commits with 'sign-all' Allow signing commits by other authors when rewriting them Jan 20, 2025
@martinvonz
Copy link
Member

Thanks!

One proposed alternative is to change it to a sign variable that takes one of these behavior names.

I just added more support for that idea (as you've probably seen already).

This would require migration or deprecation of the previous sign-all flag, which I haven't figured out how it works yet :)

Yuya just added better support for that in #5298, so you can probably look at the changes in that PR to figure out what to do.

@yuja
Copy link
Contributor

yuja commented Jan 21, 2025

#5298

I have unsent patches to rename+update config values. Maybe I need to push them first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants