Skip to content

Squash merge messages contain information about all commits by default. #35247

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

Draft
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

hiifong
Copy link
Member

@hiifong hiifong commented Aug 11, 2025

This behavior is basically the same as GitHub, except for the dividing line I added.

screenshot:

image image image image

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Aug 11, 2025
@github-actions github-actions bot added modifies/translation modifies/go Pull requests that update Go code modifies/templates This PR modifies the template files modifies/migrations labels Aug 11, 2025
@hiifong hiifong closed this Aug 11, 2025
@lunny lunny added this to the 1.25.0 milestone Aug 11, 2025
@wxiaoguang
Copy link
Contributor

Please split preparePullViewReviewAndMerge into small functions, but not introduce a new preparePullViewSquashMergeMsg to call everywhere.

And it needs tests to cover the changed logic (although old code doesn't have enough tests, new code should have when the logic is complex)

@wxiaoguang
Copy link
Contributor

This part seems not right, Co-xxx should be at the end.

image

@hiifong
Copy link
Member Author

hiifong commented Aug 11, 2025

This part seems not right, Co-xxx should be at the end.

image

Done.

image

@hiifong
Copy link
Member Author

hiifong commented Aug 11, 2025

Let me spend some time researching how to add tests.

@silverwind
Copy link
Member

image

Style nit: there should be no empty line between such metadata lines.

@hiifong hiifong marked this pull request as draft August 15, 2025 03:26
* main:
  [skip ci] Updated translations via Crowdin
  Fix LFS range size header response (go-gitea#35277)
  Skip "parentsigned" check when the repo is empty (go-gitea#35292)
  [skip ci] Updated translations via Crowdin
  Fix GitHub release assets URL validation (go-gitea#35287)
  nix flake use go1.25 (go-gitea#35288)
  go1.25.0 (go-gitea#35262)
commitsBuilder := strings.Builder{}
for _, c := range compareInfo.Commits {
commitsBuilder.WriteString("* ")
commitsBuilder.WriteString(c.CommitMessage)
Copy link
Contributor

Choose a reason for hiding this comment

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

The same problem:

Image

Copy link
Member Author

Choose a reason for hiding this comment

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

In this case, I would consider it an abuse of commit messages. I believe that squash merge should be an independent feature branch, and I find it hard to believe that every commit message contains so much information. Therefore, I consider this to be an extreme scenario.

Copy link
Member

Choose a reason for hiding this comment

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

I’ve submitted f37de47 to address the issue. This isn’t an uncommon case—many commits include multi-line messages. Do you know how GitHub handles this?

Copy link
Member Author

@hiifong hiifong Aug 19, 2025

Choose a reason for hiding this comment

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

ref: hiifong/squash-test@beaa913

GitHub's squash merge does not include the PR description, and there seems to be no limit on the length of the commit message.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. modifies/go Pull requests that update Go code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants