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

Cannot merge Pullrequest with commits but without changes #6870

Closed
2 of 7 tasks
jambalaja9 opened this issue May 7, 2019 · 10 comments · Fixed by #7920
Closed
2 of 7 tasks

Cannot merge Pullrequest with commits but without changes #6870

jambalaja9 opened this issue May 7, 2019 · 10 comments · Fixed by #7920
Labels
type/enhancement An improvement of existing functionality

Comments

@jambalaja9
Copy link

Description

This error always occurs while fixing a mergeconflict on a protected branch.

In the Example:
The protected branch is "master" for continuous development.
We release some software from the "hotfix"-branch. (also protected)
To fix bugs we use feature-branches and merge these with pullrequests into "master" and "hotfix".

There are constellations that changes for "hotfix" should not come into "master".
But we want to merge the feature-branch into both protected-branches, that other developers don't see these commits when merging their own pullrequest.

When mergeconflicts occur, we merge "master" into the feature-branch.
So we are merging the protected-branch "master" into the feature-branch "feature_for_master" to solve the mergeconflicts or undo the changes manually.

After that the pullrequest shows some commits (done in the feature-branches), but there are no changes left to bring into "master".
Now gitea doesn't allow to merge the pullrequest due to a mergeconflict.

Screenshots

image

@lafriks
Copy link
Member

lafriks commented May 7, 2019

Why would you want to merge PR with no actual changes?

@jambalaja9
Copy link
Author

Hi lafriks,
if i don't merge the PR into master my changes for hotfix will be merged into master with the next PR of another developer.

hotfix: this ist the productive softwareversion
master: this code will be used for the next release

Usually we create a feature-branch from "hotfix", fix a bug for "hotfix" on this feature-branch and merge it into "hotfix" and into "master". In this case the changes should not come into "master". If we don't merge into "master" the next developer will get my commit in his feature-branch and will merge it into "master".

@saitho
Copy link
Contributor

saitho commented May 23, 2019

Having no changes means that both master and the pull request are the same. So there is no need to merge the branches, as merging would do nothing. ;)

However I do agree that the note that there are merge conflicts is a bit misleading when there are no actual changes that can be merged. Maybe we should fix that message.

@jambalaja9
Copy link
Author

Yes, I agree. There will no changes be done. But "master" still doesn't know about the commits done for the "hotfix" and undone in the feature-branch for "master".
So, if another developer starts a feature-branch from "hotfix", he will bring my commits into "master" when he creates a PR from his feature-branch into "master".
To prevent that, the first PR without real changes should be merged.

@lunny lunny added the reviewed/wontfix The problem described in this issue/fixed in this pull request is not a problem we will fix label Jun 6, 2019
@stale
Copy link

stale bot commented Aug 5, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.

@stale stale bot added the issue/stale label Aug 5, 2019
@saitho
Copy link
Contributor

saitho commented Aug 12, 2019

To prevent that, the first PR without real changes should be merged.

Stumbled upon the same issue right now.

Earlier I said:

Having no changes means that both master and the pull request are the same.

Which is incorrect. Even merges that do not contain changes should be merged in order to avoid having diverging branches because commits are missing in others.

@stale stale bot removed the issue/stale label Aug 12, 2019
@jambalaja9
Copy link
Author

That's the point. ;)

Even merges that do not contain changes should be merged in order to avoid having diverging branches because commits are missing in others.

@lafriks
Copy link
Member

lafriks commented Aug 20, 2019

I wonder does github or gitlab allow merging such PR?

@jambalaja9
Copy link
Author

Bitbucket does. But i'm not sure if github or gitlab allows it.

@typeless
Copy link
Contributor

typeless commented Aug 20, 2019

The stderr logged from git apply is unrecognized input.
I guess it's due to an empty patch file. Maybe we can skip the git apply check if the patch file is empty?

Edit: I can confirm from the integration test that the patch file is indeed empty.

@lunny lunny added type/enhancement An improvement of existing functionality and removed reviewed/wontfix The problem described in this issue/fixed in this pull request is not a problem we will fix labels Aug 21, 2019
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type/enhancement An improvement of existing functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants