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

Fix push message behavior #33215

Merged
merged 15 commits into from
Jan 17, 2025
Merged

Conversation

changchaishi
Copy link
Contributor

@changchaishi changchaishi commented Jan 11, 2025

Fixes #32769 by the logic from pr #33192

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jan 11, 2025
@pull-request-size pull-request-size bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jan 11, 2025
@github-actions github-actions bot added modifies/go Pull requests that update Go code modifies/templates This PR modifies the template files labels Jan 11, 2025
@changchaishi changchaishi marked this pull request as draft January 11, 2025 08:10
@changchaishi
Copy link
Contributor Author

Extract/create a common function called GetBranchDivergingInfo, it can serve two main targets:

  • Sync Fork feature (Merge Upstream)
  • Recently Push Branch (Pull Request message)
GetBranchDivergenceInfo Base Branch Head Branch
Sync Fork (Merge Up stream) base's defaultBranch fork repo's branch
Recently Push Branch PR fork repo's branch / base's non-defaultBranch base's defaultBranch

This combination allows us to determine the divergence between the two branches interchangeably.

For the correct behavior for a recently pushed branch, the branch must be ahead of default by some commits.

@changchaishi changchaishi marked this pull request as ready for review January 13, 2025 09:49
@changchaishi changchaishi marked this pull request as draft January 13, 2025 09:49
@changchaishi changchaishi force-pushed the fix_push_message_behavior branch 5 times, most recently from 9163ded to fd45c52 Compare January 14, 2025 02:41
@changchaishi changchaishi marked this pull request as ready for review January 14, 2025 03:09
@changchaishi changchaishi marked this pull request as draft January 14, 2025 04:34
@changchaishi changchaishi force-pushed the fix_push_message_behavior branch from fd45c52 to e4e7766 Compare January 14, 2025 05:37
@changchaishi changchaishi marked this pull request as ready for review January 14, 2025 06:04
@github-actions github-actions bot removed the modifies/templates This PR modifies the template files label Jan 15, 2025
@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 Jan 15, 2025
@lunny lunny added the backport/v1.23 This PR should be backported to Gitea 1.23 label Jan 15, 2025
@lunny lunny added this to the 1.24.0 milestone Jan 15, 2025
@wxiaoguang wxiaoguang removed the backport/v1.23 This PR should be backported to Gitea 1.23 label Jan 16, 2025
@github-actions github-actions bot added the modifies/templates This PR modifies the template files label Jan 16, 2025
@wxiaoguang wxiaoguang requested a review from lunny January 17, 2025 13:40
@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 Jan 17, 2025
@lunny lunny added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Jan 17, 2025
@lunny lunny enabled auto-merge (squash) January 17, 2025 19:11
@lunny lunny merged commit 55e0756 into go-gitea:main Jan 17, 2025
26 checks passed
@GiteaBot GiteaBot removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Jan 17, 2025
wxiaoguang pushed a commit to wxiaoguang/gitea that referenced this pull request Jan 18, 2025
Fixes go-gitea#32769 by the logic from pr go-gitea#33192

---------

Co-authored-by: wxiaoguang <[email protected]>
# Conflicts:
#	services/repository/merge_upstream.go
@wxiaoguang wxiaoguang added backport/done All backports for this PR have been created backport/manual No power to the bots! Create your backport yourself! backport/v1.23 This PR should be backported to Gitea 1.23 labels Jan 18, 2025
@wxiaoguang
Copy link
Contributor

1.23 lacks "reqctx" support, manually backported: Fix push message behavior (#33215) #33317

wxiaoguang added a commit that referenced this pull request Jan 19, 2025
Backport #33215

Manually resolved "reqctx" conflict

---------

Co-authored-by: Chai-Shi <[email protected]>
zjjhot added a commit to zjjhot/gitea that referenced this pull request Jan 20, 2025
* giteaofficial/main:
  [skip ci] Updated licenses and gitignores
  Fix typo in documentation of GetBranchNames() (go-gitea#33330)
  Fix Account linking page (go-gitea#33325)
  Fix parentCommit invalid memory address or nil pointer dereference. (go-gitea#33204)
  Make tracked time representation display as hours (go-gitea#33315)
  [skip ci] Updated translations via Crowdin
  [skip ci] Updated translations via Crowdin
  Fix push message behavior (go-gitea#33215)
  Add golang back to nix dev environment and pin v1.23 (go-gitea#33275)
  Trivial fixes (go-gitea#33304)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/done All backports for this PR have been created backport/manual No power to the bots! Create your backport yourself! backport/v1.23 This PR should be backported to Gitea 1.23 lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. modifies/go Pull requests that update Go code modifies/templates This PR modifies the template files size/L Denotes a PR that changes 100-499 lines, ignoring generated files. type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New pull request notification will show wrong branch in a special case
4 participants