difficulty creating PR #377
Labels
No Label
kind/breaking
kind/bug
kind/build
kind/dependency
kind/deployment
kind/docs
kind
enhancement
kind
feature
kind/proposal
kind
question
kind
refactor
kind/security
kind/testing
kind/translation
priority/critical
priority/high
priority/low
priority/medium
reviewed/duplicate
reviewed/invalid
reviewed/wontfix
skip-changelog
status/blocked
status/has-backport
status/has-pull
status/needs-backport
status/needs-feedback
status/needs-reviews
status/wip
upstream/gitea
upstream/sdk
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: gitea/tea#377
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
hi.
I have user X owning repo A and user Y owning
repo B. X and Y are both gitea created users.
the aim is for X to create a PR on B.
I do 'tea login add ..Y ...'
then I initiate the PR creation from a clone of A.
it succeeds but the PR is created against A/X!
to close this PR I have to do another 'tea login add' for X!
why is the PR created on the source repo and not the target repo?
I think I could really use an example of use.
From the tea homepage example for 'tea pulls ...'
I think now that the local repo in $PWD, --repo, --remote are ways to specify the repo to open the PR against.
but that leaves how to specify the source repo and branch to be merged.
so what's left? only these options!:
... no mention of the donor repo name!
... is 'base' referring to the target branch?
... is 'head' referring to the donor branch?
Hi, yeah the docs need some improvements (a PR for that would be very welcome :)
Right:
--repo
is used to specify the repo you want to create the PR in. This is autoselected when you are in a local git dir, where themaster
branch has a gitea remote configured.--remote
is used to select another gitea repo based on a different remote in the local repoBecause you cloned X's fork, so the remote of
main
/master
branch points to the fork A, not source B. So (as described above for--repo
), the fork is selected by tea. Two ways to fix this:set the remote to upstream in your git repo:
set the right repo ad hoc.
--head
can be omitted, if you currently have that branch checked out.Setting main branch remote to the upstream repo as in (1) generally helps a lot with defaults in tea.
Yes. Note a major omission from the docs:
If head branch comes from a different repo, you can specify that by prefixing the branch name with the username (
--head X:mybranch
)When you want to create a PR as X in user Y's repo, you should only need one login for X, no need for login Y.
Hi,
thanks for the rapid response!
If I do
I get
I'm not intending to track an upstream branch with 'mybranch' - I do want 'mybranch' to fast-forward
master on Y/B.
I get:
..with my current directory the clone of the fork of the target repo and with 'mybranch' the current one.
I have tried --base Y:master and --base master also, with same result.
Sorry I should have tested the commands I gave you ;)
For (1), the correct command is
For (2) I can confirm the errors, this should work & is a bug (#378).
aside: tea really needs a testsuite so regressions like these don't happen all the time. (and we probably should simplify the flags a bit, as usability doesn't grow with more flags #379 ;)
Sure, but tea determines the default gitea repo based on the remote the local
master
branch is tracking, that's why we want a different upstream for master for pull requests.Hi,
with revised commands for 1. followed by
I get
'mybranch' had been pushed to the X gitea repo
from a clone.
I cannot otherwise guess what it cannot find!
It probably fails to look up the base repo.
What does
tea open
do when called in the repo dir? It should open http://localhost:3000/Y/B. If that gives a 404, your upstream remote url should be different.it complains about
http://http/localhost:3000/Y/B
while the remote appears in .git/config
as
http://localhost:3000/Y/B
if I change it to
localhost:3000/Y/B
the output becomes:
http://http/localhost:3000/3000/Y
!This is really odd, and I can't reproduce it.
Can you post the (sanitized!) content of your
~/.config/tea/config.yml
? (tea login edit
)Thanks for your patience :)
I assume you have
http/localhost:3000
as login url instead ofhttp://localhost:3000
in config.ymlI don't know what you mean - tea seems to me
as if it is munging a perfectly fine remote
string into something screwy.
hold on, it's probably my having done something dumb! ...
I'm not suggesting waiting on a full confession!
Only that often one's issues turn out to be self-inflicted.
does my config.yaml yield any clues?
That config looks totally fine. I'm a bit stumped how tea came to generate these broken URLs, given that the inputs (login url, remote url) seem to be well formed.
I didn't ask so far what tea version you used? (as I can't reproduce with 0.7.0 and current master branch..)
I'm using 0.7.0
I've created a B here then, since not possible to fork a repo from one's own account, cloned it locally
then pushed it to an empty repo A on here.
the .git/config in the local copy of A (is this now any different from a clone of a fork?) is:
and when I do a
tea open
in that cloneI see the munging:
Does anything look wrong about this config?
(of course this is being done through one user ident but I'll create a 2nd if necessary)
thanks!
does the --description argument work for you? where I can get a PR created is between different branches on the same repo, and this argument seems to have no effect here.
@progman this was fixed in #371 but isn't released yet
Your
.git/config
also looks all good to me. I really don't get how this would be happening. Does this happen on a different machine for you as well?I'll close this, feel free to reach out if you still have questions. tea 0.8.0 was released in the meantime