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:
- Re-design our branches (soon to be called bookmarks) to support tracking an arbitrary ref on a remote. This probably would imply having to support tracking different refs on different remotes, tracking remote branches of a different name, and perhaps tracking multiple refs per remote.
- Set up simple commands to push and fetch arbitrary refs unsafely, either permanently or until we can implement 1 or think of a better solution.
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.
Is your feature request related to a problem? Please describe.
Currently, there is no way to use
jjto 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/pushthat 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_NAMEBoth 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.