Skip to content

Error while rebasing PR with conflicts #4078

Closed
@apricote

Description

@apricote
[Macaron] 2018-05-29 22:29:47: Started POST /apricote/rebase-conflict/pulls/1/merge for [::1]
[git-module] /home/julian/.gitea/repositories/apricote/rebase-conflict.git: git -c filter.lfs.required= -c filter.lfs.smudge= -c filter.lfs.clean= tag -l --sort=-v:refname
[git-module] /home/julian/.gitea/repositories/apricote/rebase-conflict.git: git -c filter.lfs.required= -c filter.lfs.smudge= -c filter.lfs.clean= for-each-ref --format=%(refname) refs/heads/
[git-module] stdout:
refs/heads/feature
refs/heads/master

[git-module] /home/julian/.gitea/repositories/apricote/rebase-conflict.git: git -c filter.lfs.required= -c filter.lfs.smudge= -c filter.lfs.clean= show-ref --verify refs/heads/master
[git-module] stdout:
4db6af38e879d59d87863ddeadc00d516cf9d4e3 refs/heads/master

[Macaron] 2018-05-29 22:29:47: Completed POST /apricote/rebase-conflict/pulls/1/merge 404 Not Found in 695.886888ms

Description

I am trying to merge a pull request with the "Rebase and Merge" style. The pull request UI shows me that "[t]his pull request can be merged automatically". When I now click the button, an error page 500 is shown with the message "An error has occurred : git rebase [/home/julian/.gitea/repositories/apricote/rebase-conflict.git -> /home/julian/go/src/code.gitea.io/gitea/data/tmp/local-repo/merge-249575514.git]: error: Failed to merge in the changes." and the PR did not get merged.

I think this bug is happening because the PullRequestStatusMergeable is set when the sum of all commits is auto-mergeable, this makes sense and works for the normal merge and also squashing. But because rebasing will merge in every commit on its own, any conflict that arises will immediately stop the (automatic) rebase.

You can check out the example repository at try.gitea.io/apricote/rebase-conflict, if you fork it to your own account and try to rebase the feature onto the master branch the error should surface.

This error also happens if using the proposed "rebase and merge (--no-ff)" feature in #4052.

Screenshots

rebase_1
rebase_2

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions