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

Squash in PR with co-authored #31980

Closed
trofim24 opened this issue Sep 4, 2024 · 6 comments · Fixed by #33020
Closed

Squash in PR with co-authored #31980

trofim24 opened this issue Sep 4, 2024 · 6 comments · Fixed by #33020
Labels
Milestone

Comments

@trofim24
Copy link

trofim24 commented Sep 4, 2024

Description

  • Create Pull Request with 1 commit from another author
  • Click Create Squash commit by another gitea account
  • Delete all template message and leave only new line
  • Click Create Squash commit

commit message contains deleted lines

See video -
https://github.com/user-attachments/assets/60cc083b-c629-4c6a-b818-5fc99fca6dc4

Example of PR - https://demo.gitea.com/trofim24/test-bug/pulls/1

Gitea Version

1.22.1

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

No response

Git Version

1.23.0+dev-460-ga366af4b7a

Operating System

macos

How are you running Gitea?

using https://demo.gitea.com/

Database

None

@hiifong
Copy link
Member

hiifong commented Dec 5, 2024

I tried many times, but I only reproduced it once. I think it might be caused by cache. Can you reproduce the issue again?

@trofim24
Copy link
Author

@hiifong
I reproduced this problem now on latest gitea version in incognito mode. It's not cache
Commit and PR must be from one user
Squash must do another user with delete all template message and leave only new line
View new video

Version: 1.23.0+dev-789-g18061af490

Screen.Recording.2024-12-16.at.10.48.50.AM.mov

@hiifong
Copy link
Member

hiifong commented Dec 16, 2024

@hiifong I reproduced this problem now on latest gitea version in incognito mode. It's not cache Commit and PR must be from one user Squash must do another user with delete all template message and leave only new line View new video

Version: 1.23.0+dev-789-g18061af490

Screen.Recording.2024-12-16.at.10.48.50.AM.mov

Thank you for your report

@hiifong
Copy link
Member

hiifong commented Dec 28, 2024

ADD_CO_COMMITTER_TRAILERS: true: Add co-authored-by and co-committed-by trailers to merge commit messages if committer does not match author.

Based on my review of the documentation, it appears that ADD_CO_COMMITTER_TRAILERS is enabled by default, which doesn't seem to be a bug. If you prefer not to have co-author and co-committer information in the commit message, you may consider disabling the ADD_CO_COMMITTER_TRAILERS option. If you have any further questions, please feel free to continue the discussion.

@trofim24
Copy link
Author

@hiifong I think, this different behavior depending on who creates Pull Request seems like a bug.

  • Commit creates User1. PR and Squash with delete all template message and leave only new line creates User2. Commit message doesn't contain deleted lines.
  • Commit and PR creates User1. Squash with delete all template message and leave only new line creates User2. Commit message contains deleted lines.

@hiifong
Copy link
Member

hiifong commented Dec 28, 2024

@hiifong I think, this different behavior depending on who creates Pull Request seems like a bug.

  • Commit creates User1. PR and Squash with delete all template message and leave only new line creates User2. Commit message doesn't contain deleted lines.
  • Commit and PR creates User1. Squash with delete all template message and leave only new line creates User2. Commit message contains deleted lines.

Maybe #33020 can fix this bug

@lunny lunny added this to the 1.23.0 milestone Dec 30, 2024
lunny pushed a commit that referenced this issue Dec 30, 2024
Fix: #31980

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
GiteaBot pushed a commit to GiteaBot/gitea that referenced this issue Dec 30, 2024
…3020)

Fix: go-gitea#31980

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants