Closed arusahni closed 4 years ago
Hello, I would like to implement this feature. I have a minimal working implementation on my fork but I have a couple of questions:
Hi! Thanks for taking this one.
origin
, while in case 3, origin
may not be my "primary".
origin
remote for their private github repo, and gh
for their public github. Someone submits a PR to that repo. I'd like to check out the PR for that repo, but git-req
currently uses origin
.git-req --set-primary-remote <remote_name>
pr/{mr}
number, we could do {remote_name}/{branch_name}
.Backwards compatibility is an interesting concern. I wonder if it would make sense to make this opt-in (for now) with a --editable
flag for the case of checkout out a PR from a satellite repo.
Thoughts? Now that I've teased this out, it sounds like there are probably multiple tickets here.
So, from what I get, I think these can be two different modifications. The first one is to allow pulling a PR from a non default (non 'origin') remote name, while the second one is to have a settings entry that tells what the default remote name would be.
And as for the branch's naming convention, that means we would have something like: origin/pr/42
for a PR tracking origin and a upstream/pr/42
for a PR tracking a upstream? I like the idea, but if we had only pr/42
for when pulling from the default (e.g. origin) and upstream/pr/42
for when pulling from a upstream
named remote, and I think this is enough to making this change backwards compatible and I think it's still intuitive.
After merging #38 and #42, all that remains is:
Update the get_default_remote
function to read the set value.
a. If no value is set, try to infer using the existing logic (the existing remote name if only one, else origin)
b. set the default remote
2.. Provide an interface to change the default (via CLI flags)
It'd be great to be able to support these use-cases:
origin
, and instead use something else.Todo: