gitea icon indicating copy to clipboard operation
gitea copied to clipboard

Squash in PR with co-authored

Open trofim24 opened this issue 1 year ago • 3 comments

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

trofim24 avatar Sep 04 '24 20:09 trofim24

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

hiifong avatar Dec 05 '24 15:12 hiifong

@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

https://github.com/user-attachments/assets/f48a44be-6ce3-4f53-bbdc-52c7f4938033

trofim24 avatar Dec 16 '24 07:12 trofim24

@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 avatar Dec 16 '24 16:12 hiifong

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.

hiifong avatar Dec 28 '24 06:12 hiifong

@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.

trofim24 avatar Dec 28 '24 07:12 trofim24

@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

hiifong avatar Dec 28 '24 07:12 hiifong