PR is not able to merge, without any conflict #2156

Closed
opened 2025-11-02 04:25:31 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @nemoinho on GitHub (Aug 7, 2018).

Description

If a new PR is opended gitea creates a patch-file. This patch-file is updated whenever the PR is updated.

But if the target is changed the patch-file is not updated.

This leads to a bad situation because gitea checks if it can apply the path-file to the target-branch and decides by that outcome if the PR-view offers a link to merge the PR.

In short, after the target-branch applies changes which are part of a PR suddenly this PR becomes invalid and there is actually no reason for that.

A typical workaround is to use git commit --amend --no-edit && git push --force-with-lease but this has several downsides and is not friendly to use and hard especially for beginners.


The expected behaviour is that the patch-file is updated whenever either the base-branch or the target-branch is updated.

Originally created by @nemoinho on GitHub (Aug 7, 2018). - Gitea version (or commit ref): [59b10e6](https://github.com/go-gitea/gitea/tree/59b10e66f757441e8c74532f30740bf4a96e9ac1) - Git version: any - Operating system: any - Database: any - Can you reproduce the bug at https://try.gitea.io: - [X] Yes https://try.gitea.io/nemoinho/DEMO/pulls/2 - [ ] No - [ ] Not relevant ## Description If a new PR is opended gitea [creates a patch-file](https://github.com/go-gitea/gitea/blob/6e64f9db8eb889f9cc7e8c9576b2f9c89750927e/routers/repo/pull.go#L828). This patch-file is updated [whenever the PR is updated](https://github.com/go-gitea/gitea/blob/6e64f9db8eb889f9cc7e8c9576b2f9c89750927e/models/update.go#L83). But if the target is changed the patch-file is not updated. This leads to a bad situation because gitea checks if it can apply the path-file to the target-branch and [decides](https://github.com/go-gitea/gitea/blob/6e64f9db8eb889f9cc7e8c9576b2f9c89750927e/templates/repo/issue/view_content/pull.tmpl#L35) by [that outcome](https://github.com/go-gitea/gitea/blob/6e64f9db8eb889f9cc7e8c9576b2f9c89750927e/models/pull.go#L713-L720) if the PR-view offers a link to merge the PR. In short, after the target-branch applies changes which are part of a PR suddenly this PR becomes invalid and there is actually no reason for that. A typical workaround is to use `git commit --amend --no-edit && git push --force-with-lease` but this has several downsides and is not friendly to use and hard especially for beginners. --- The expected behaviour is that the patch-file is updated whenever either the base-branch or the target-branch is updated.
GiteaMirror added the issue/confirmedtype/enhancement labels 2025-11-02 04:25:31 -06:00
Author
Owner

@stale[bot] commented on GitHub (Jan 14, 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[bot] commented on GitHub (Jan 14, 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.
Author
Owner

@stale[bot] commented on GitHub (Feb 20, 2019):

This issue has been automatically closed because of inactivity. You can re-open it if needed.

@stale[bot] commented on GitHub (Feb 20, 2019): This issue has been automatically closed because of inactivity. You can re-open it if needed.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#2156