go-gitea / gitea

Git with a cup of tea! Painless self-hosted all-in-one software development service, including Git hosting, code review, team collaboration, package registry and CI/CD
https://gitea.com
MIT License
45.14k stars 5.49k forks source link

PR can't be merged after manual conflict resolution #283

Closed JetpackDuba closed 7 years ago

JetpackDuba commented 7 years ago

Description

If I do a PR with conflicts, gitea says that I have to merge branch manually ( This pull request can't be merged automatically because there are conflicts. ). I've done it but the message does not disappear. I closed the PR, then reopened it and now if I go to the merge request I get the following message everytime:

The conflict checking is still in progress, please refresh page in few moments.

seleccion_009

Steps to reproduce

Bwko commented 7 years ago

I'm able to semi reproduce this bug. My Gitea keeps nagging about:

This pull request can't be merged automatically because there are conflicts.

I'll look into this.

JetpackDuba commented 7 years ago

If you don't close it, you'll get this message. If you close it and then reopen it, The conflict checking is still in progress, please refresh page in few moments. will appear

Bwko commented 7 years ago

I've opened & closed the PR multiple times: conflict

Was you PR relatively large?

lunny commented 7 years ago

I can't reproduce it. Any more clues?

strk commented 7 years ago

Check the logs, I bet you got a panic in a goroutine (saw that happening) so some parts of the code are just waiting for something that will never happen (hearing back from the goroutine). It would help if panic messages were included in the logs but they only go to either stdout or stderr (I'm not sure which one).

So my suggestion is:

strk commented 7 years ago

See #210 for the missing stderr/stdout redirection

JetpackDuba commented 7 years ago

I've tried it again in a windows pc and I get the same behavior as @Bwko

This pull request can't be merged automatically because there are conflicts.

I'm testing this with small PR

Bwko commented 7 years ago

So the behavior is the same on Linux (I'm on Linux) & Windows. At least we need to show a message that this PR has been merged.

JetpackDuba commented 7 years ago

@strk I'm getting an error when restarting Gitea in my Linux Mint: imagen

Entrada desconocida (Spanish) -> Unknown input

gogs.log.zip

I can share with you my Database and repos (They are just test repos) if it's necessary to debug it

Bwko commented 7 years ago

If you could share your repo it would help us a lot. Googling the git apply error points me to a whitespace error. Are there any whitespace 'like' characters in your reppo/PR?

JetpackDuba commented 7 years ago

@Bwko oke! Tonight I will attach my repo, I'm not at home atm

JetpackDuba commented 7 years ago

DB SQL backup and my repo: Gitea.zip User: test@gmail.com Password: TestTest If you need something else I'll try to help!

Bwko commented 7 years ago

@aeab13 Thanks for your help :+1: The bug somehow only exists in your repo (on my machine it sometimes shows the same error). But when I switch back to my own installation I'm not able to reproduce this bug.

bkcsoft commented 7 years ago

Title changed to clarity

JetpackDuba commented 7 years ago

@bkcsoft thanks for changing the title! @Bwko thanks to you! I've reinstalled my OS and I'll try again to create a PR with conflicts to try to reproduce it again.

PD: Does this issue still need more feedback? (I'm talking about the label)

Bwko commented 7 years ago

@aeab13 Could you check if #368 fixes your issue?

JetpackDuba commented 7 years ago

@Bwko I'll test it tonight!

JetpackDuba commented 7 years ago

I'm having some problems with mysql in my machine. I'll test tomorrow the changes :s Sorry!

JetpackDuba commented 7 years ago

I've tested changes in #368 The message The conflict checking is still in progress, please refresh page in few moments. has disappeared but I'm still getting This pull request can't be merged automatically because there are conflicts. after manual merge and I can't see commits and changed files. So the problem is still the same with different message :p EDIT: I can't see commits and changed file in the selected pull request only if I close it and reopen it. spectacle bz3630

EDIT2: I've checked the PR again and now I can see commit and files changed but still getting the same message

Bwko commented 7 years ago

@aeab13 Thanks for testing. My PR fixed the bug that was causing the The conflict checking is still in progress, please refresh page in few moments. error.

I haven't found a good solution on how to mark the conflicting PR as merged. So for now I don't know how to solve this issue :worried: Maybe someone else has any idea?

JetpackDuba commented 7 years ago

I would like to try to fix it but I haven't got time to do that right now :s If it is not fixed in a month or so, I'll try. Thanks for trying it @Bwko ! :D

lunny commented 7 years ago

@aeab13, if you have no time, could you give some idea about where the problem is?

lunny commented 7 years ago

move this to 1.1 and feel free to change it back if someone has good idea.

grissiom commented 7 years ago

@lunny I think git merge-base --is-ancestor will help you to detect whether a PR has been merged manually or not. I a PR has already been merged, git merge-base --is-ancestor pull/x/head HEAD will return 0. If the PR has not been merged, it will return 1.

lunny commented 7 years ago

@Bwko could you try to send another PR followed @grissiom 's advice?

Bwko commented 7 years ago

@lunny & @grissiom I'll take a look at that

Bwko commented 7 years ago

I'm almost done with this :smile: Do we want to automatically set a PR to merged or do we want to show a message that this PR was manually merged?

lunny commented 7 years ago

How github do that?

andreynering commented 7 years ago

I think GitHub marks as merged.

Bwko commented 7 years ago

@aeab13 Could you test #719?

JetpackDuba commented 7 years ago

I'll do it tomorrow!

Bwko commented 7 years ago

@aeab13 Any updates on this issue? :roll_eyes:

JetpackDuba commented 7 years ago

Sorry, I am having some issues with my computer and I can't test it right now. I am sorry :/