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

Improve squash merge commit author and co-author with private emails #22977

Merged
merged 4 commits into from
Mar 10, 2023

Conversation

brechtvl
Copy link
Contributor

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.

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 techknowlogick added the type/enhancement An improvement of existing functionality label Feb 23, 2023
@techknowlogick techknowlogick added this to the 1.20.0 milestone Feb 23, 2023
Copy link
Member

@techknowlogick techknowlogick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR :)
LGTM, just need to confirm it doesn't potentially leak private emails from web interface prior to approval.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Feb 24, 2023
@brechtvl
Copy link
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.

@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Mar 7, 2023
@techknowlogick
Copy link
Member

Thanks for your patience @brechtvl 🙏

@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Mar 10, 2023
@lunny lunny added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Mar 10, 2023
@techknowlogick techknowlogick merged commit d647e74 into go-gitea:main Mar 10, 2023
@techknowlogick techknowlogick removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label 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)
@brechtvl brechtvl deleted the blender-hidden-email-squash branch March 11, 2023 11:29
@go-gitea go-gitea locked and limited conversation to collaborators May 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/enhancement An improvement of existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants