gitea
gitea copied to clipboard
The direct modification on the PR causes the loss of the derived information.
Description
The up repo https://example.com/a/crm
, and Bob fork it https://example.com/bob/crm
, he commit something and create pull request for PR#59 https://example.com/a/crm/pulls/59
I review it
git fetch up pull/59/head:pr59
git checkout pr59
And fix something
git commit -m 'fix some bug'
Then push to PR#59
git push up pr57:pull/57/head
I can find my commit in https://example.com/a/crm/pulls/59/commits
, But can not merge this pr,
the error message This pull request is broken due to missing fork information.
.
Gitea Version
1.20.2
Can you reproduce the bug on the Gitea demo site?
Yes
Log Gist
No response
Screenshots
No response
Git Version
2.39.2
Operating System
MacOS 13.4
How are you running Gitea?
run in docker
Database
MySQL
And fix something
git commit -m 'fix some bug'
Then push to PR#59
git push up pr57:pull/57/head
Wait, you shouldn't do this, pull/57/head
is a branch to track the head branch of the PR, you should push to Bob's branch.
My question: does GitHub support pushing to pull/*/head
?
I repeated the steps you provided above on github:
-
git push origin pr1:pull/1/head
but it creates a new branch rather than modifying the
pull/1
-
git push origin pr1:refs/pull/1/head
When I made it clear that I wanted to changepull/1
, github rejected my push
So at least, we need to refuse the push.
So i need to git remote add bob https://example.com/bob/crm
, and git push to bob dev branch?
So i need to
git remote add bob https://example.com/bob/crm
, and git push to bob dev branch?
Right
So i need to
git remote add bob https://example.com/bob/crm
, and git push to bob dev branch?Right
Bob create pull request a/crm:main
from bob/crm:dev1
When i try
$ git fetch up pull/119/head:dev1
$ git checkout dev1
$ git remote add bob https://example.com/bob/crm.git
and
$ git push bob dev1
remote: Repository not found
fatal: repository 'https://example.com/bob/crm.git/' not found
I am sure checked Allow edits from maintainers by default
and can see Update branch by merge
button in pulls#119.
git remote add bob https://example.com/bob/crm.git
git fetch bob dev1
git checkout dev1
fix & add &commit
git push bob dev1
Work directly on the bob's repo, not the up
.
git remote add bob https://example.com/bob/crm.git git fetch bob dev1 git checkout dev1 fix & add &commit git push bob dev1
Work directly on the bob's repo, not the
up
.
I got the same error
$ git fetch bob dev1
remote: Repository not found
fatal: repository 'https://example.com/bob/crm.git/' not found
$ git remote -v
up https://example.com/a/crm.git (fetch)
up https://example.com/a/crm.git (push)
bob https://example.com/bob/crm.git (fetch)
bob https://example.com/bob/crm.git (push)
The issue is that after allowing maintainers to edit is checked on GitHub, it will automatically add the maintainers as collaborators to Bob's repository, so the maintainers have permissions. But on Gitea, Bob needs to manually add collaborators to his own forked repository, otherwise even though Bob has checked "Allow maintainers to edit", the maintainers won't have permission to modify the PR branch despite that.
The direct push to git push pr57:pull/57/head
should be deny from Gitea side. It should be only changed by Gitea itself.