-
Notifications
You must be signed in to change notification settings - Fork 346
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FR: Pushing and fetching arbitrary refs #4388
Comments
Some previous discussions:
For 2, we might want to introduce command namespace for plumbing commands so |
This is also nice for GitHub (refs like |
Thanks Yuya, I forgot about those discussions. For a subcommand, |
Heya! I was the one who originally prompted the discussion on Discord - I have a few thoughts to put here too :)
This seems interesting to me, although I note that it wouldn't quite solve the gerrit/agit/radicle/idk use-case in a nice way, at least for pushes. That's because so-called "magic refs" do weird things on the server - you always push to That said: my use-case only particularly cares about pulls, and I generally think that they are more widely useful. The
This is probably true, and is a shame. No matter how hard we try to make it so refs aren't exposed unless you're using the feature (hide the refs/foo/... prefix if foo is heads, etc.), probably it at least makes the documentation more confusing if you don't know what a ref is.
To me it would be
Additionally, if I do want to push to arbitrary refs...
I'm sure that I could write a hacky bash function to workaround these issues (using the underlying git repo and a lot of duct tape) and go on my way... call it |
Is your feature request related to a problem? Please describe.
Currently, there is no way to use
jj
to push or fetch an arbitrary ref from the remote. This causes problems for e.g. Gerrit as discussed on Discord.On one hand, this reinforces the desire for Gerrit support, #4387, but separately it would be nice to support something for the general case.
Describe the solution you'd like
I can think of 2 possible solutions:
Here's a possible interface for option 2. It's different enough from regular
fetch/push
that I think it deserves separate commands:jj git fetch-ref [--remote REMOTE] REF_NAME [branch_name]
would fetch an arbitrary ref and optionally create a branch at the newly fetched commit for easier reference later. This new local branch wouldn't track anything. It'd just be a bookmark :).jj git push-ref <--force|--expected-at COMMIT_ID> [--remote REMOTE] REVISION REF_NAME
Both 1 and 2 have disadvantages. 1 adds complexity to the UI and the model. I'm not sure whether or not 2. is better than telling people to co-locate the repo and use
git fetch/git push
.In any case, I'm curious what people think should be done here.
The text was updated successfully, but these errors were encountered: