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
44.61k stars 5.45k forks source link

Can't change branch in pull request #13684

Closed f1mishutka closed 3 years ago

f1mishutka commented 3 years ago

Hello!

I can't change branch in PR after PR was created. Please take a look at this short screencast to see how it looks like: https://mttm.ml/16

Details:

Thank you!

lunny commented 3 years ago

Could you confirm that is this still a problem?

f1mishutka commented 3 years ago

Could you confirm that is this still a problem?

Yes

Just checked it with Gitea 1.13.1 and nothing has changed, bug is still there.

6543 commented 3 years ago

@f1mishutka do you mean base ore head branch? Video show head-branch

Can you give us the stack trace of the 500 issue? you most likely have to make error logging more verbose: https://docs.gitea.io/en-us/logging-configuration/

parnic-sks commented 3 years ago

We are seeing this on our repo as well. I got setup to compile and run gitea myself and it looks like we get stuck (or at least spend a lot of time) in func (c *Commit) HasPreviousCommit() since it recursively calls HasPreviousCommit for each of a commit's parents. VSCode shows tens of thousands of calls to git.exe -c credential.helper= -c protocol.version=2 -c filter.lfs.required= -c filter.lfs.smudge= -c filter.lfs.clean= cat-file --batch

Instead of recursively checking all parents, could this function be replaced with a single call to git merge-base --is-ancestor or is it more complicated than that?

zeripath commented 3 years ago

@parnic-sks OMG HasPreviousCommit is terrible! I'm sorry I missed that!

PR incoming

zeripath commented 3 years ago

hmm... actually I suspect that this may be the cause of the problems on 1.13 too so maybe I should just replace the function entirely even for the go-git variant.

f1mishutka commented 3 years ago

Confirmed: v1.13.3 fixed this issue.

Thank you!