-
- Notifications
You must be signed in to change notification settings - Fork 6.2k
Add Pull Request merge options - Ignore white-space for conflict checking, Rebase, Squash merge #3188
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
Add Pull Request merge options - Ignore white-space for conflict checking, Rebase, Squash merge #3188
Conversation
Codecov Report
@@ Coverage Diff @@ ## master #3188 +/- ## ========================================== + Coverage 34.62% 34.86% +0.24% ========================================== Files 277 278 +1 Lines 40298 40506 +208 ========================================== + Hits 13952 14122 +170 - Misses 24298 24299 +1 - Partials 2048 2085 +37
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And maybe splited two PRs for quick review.
models/migrations/v54.go Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need sess.Begin()
@lunny how do you mean to split them? |
@lunny fixed |
Fair and early notice: please add tests (at some point, I understand it's a WIP right now) |
@lafriks When I do a squash, the author of the squashed commit is Perhaps we should include authorship check in our tests? |
@ethantkoenig when squashing author is set as PR poster (as theoretically there could be multiple commit authors) |
@lafriks |
Tried again, same thing happened. Let me know if you aren't able to reproduce |
@ethantkoenig it is same as currently with merge commit. It uses
So you have probably set for user to keep email address private. |
You're right, good catch |
I'm out of ideas how to preserve commit info in PR when merged with squash or rebase :( As there is no merge commit to reference. Especially for squash merge as original commits are lost completely when PR head branch is deleted. |
Looks like github does that by keeping commit info in |
I think it is ready for review now, please test it and comment :) |
Automatically adding all commit messages to extended commit message for squash should be implemented as other PR to not make this PR even bigger |
aab0620
to f53d612
Compare There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally looks good, mostly nits
integrations/pull_merge_test.go Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: use models.MergeStyle
models/pull.go Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: This check is unnecessary, pr.LoadIssue()
already does it
models/pull.go Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe MergeStyleMerge
would be better?
options/locale/locale_en-US.ini Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This pull request can not be merged as no merge options are enabled.
routers/api/v1/repo/pull.go Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: This is check unnecessary, since pr.Merge
already checks the provided mergeStyle
.
models/pull.go Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use .GetUnit(..)
, so we don't unnecessarily ignore an error.
options/locale/locale_en-US.ini Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Pull Request -> pull request
options/locale/locale_en-US.ini Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: whitespaces -> whitespace
models/pull.go Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pr.HeadRepo
may not always loaded, I think that is why CI is failing.
integrations/pull_merge_test.go Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it's not too hard, could we check that the merge itself was successful, (that a commit was created, that correct merge style was used, etc.)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lafriks Is this doable?
models/pull.go Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this is not the right place, but shouldn't this functionality be moved to the "git" module ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably that would be better place but as it was there already that should be done in other PR
03bfe37
to 60b2092
Compare @ethantkoenig can I merge? as now approvals also count as LG-TM :) |
@ethantkoenig oh, ok will add that next year :)) |
@lafriks is there one still waiting a change? |
@lunny yes @ethantkoenig wants more tests |
@lafriks @ethantkoenig I think we can merge this and @lafriks could take another PR to add tests. |
okay |
@lunny @ethantkoenig ok, I will improve tests in other PR |
When visiting a repos `/settings/units` page, highlight the active tab properly: "Add more..." if the tab is displayed, or "Settings" otherwise. Fixes go-gitea#3188. Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu> (cherry picked from commit 65ed86e)
Fixes #712
Add Pull Request merge options:
Tasks:
Fix wrong display of merged PR commits and changes- should be implemented as separate PR (issue Keep merged PR info in hidden branch #3222)Screenshots:
