Improve squash merge commit author and co-author with private emails#22977
Merged
techknowlogick merged 4 commits intoMar 10, 2023
Conversation
When emails addresses are private, squash merges always use @noreply.localhost for the author of the squash commit. And the author is redundantly added as a co-author in the commit message. Also without private mails, the redundant co-author is possible when committing with a signature that's different than the user full name and primary email. Now try to find a commit by the same user in the list of commits, and prefer the signature from that over one constructed from the account settings.
techknowlogick
requested changes
Feb 24, 2023
techknowlogick
left a comment
Member
There was a problem hiding this comment.
Thanks for the PR :)
LGTM, just need to confirm it doesn't potentially leak private emails from web interface prior to approval.
Contributor
Author
|
Thanks. And to state the obvious, the signature used in commits is already public information and preserved when using a merge commit or rebase as the merge style. So using it for the squash case as well does not expose private information. |
techknowlogick
approved these changes
Mar 7, 2023
Member
|
Thanks for your patience @brechtvl 🙏 |
lunny
reviewed
Mar 9, 2023
lunny
approved these changes
Mar 10, 2023
zjjhot
added a commit
to zjjhot/gitea
that referenced
this pull request
Mar 10, 2023
* giteaofficial/main: Improve squash merge commit author and co-author with private emails (go-gitea#22977) Fix broken Chroma CSS styles (go-gitea#23174) Add gradle samples in maven doc of packages (go-gitea#23374) Fix and move "Use this template" button (go-gitea#23398) [skip ci] Updated translations via Crowdin Add init file for Ubuntu (go-gitea#23362) Rename `canWriteUnit` to `canWriteProjects` (go-gitea#23386) Fix pull request update showing too many commits with multiple branches (go-gitea#22856) Fix incorrect NotFound conditions in org/projects.go (go-gitea#23384) Refactor merge/update git command calls (go-gitea#23366) Redirect to project again after editing it (go-gitea#23326) Add Gitea Community Code of Conduct (go-gitea#23188)
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When emails addresses are private, squash merges always use
@noreply.localhostfor the author of the squash commit. And the author is redundantly added as a co-author in the commit message.Also without private mails, the redundant co-author is possible when committing with a signature that's different than the user full name and primary email.
Now try to find a commit by the same user in the list of commits, and prefer the signature from that over one constructed from the account settings.