-
Notifications
You must be signed in to change notification settings - Fork 319
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
Support pushing to a specific git refspec #2098
base: main
Are you sure you want to change the base?
Conversation
8d28c07
to
fbbeb2f
Compare
Example: ``` jj git push --refspec refs/for/master ``` This is useful for code review tools like gerrit which expect the developer to be able to push to arbitrary namespaces.
I'm not sure how I feel about this. My main problem is how it would interact with the existing options we have for When pushing multiple branches, I'd be surprised if anything other than Gerrit would accept multiple branches being pushed into a single other branch/ref. I've previously proposed (on Discord only, I think) a separate command for pushing a single branch to another name on the remote. It might look something like |
I'm a little confused about how this would work with respect to remote-tracking branches for This is less problematic with respect to |
I was thinking that this wouldn't do anything with remote-tracking branches. Do you see any problems with that? |
The main think I'm worried about, I guess, is that if you What should happen to remote-tracking branches depends on whether we want "moved" or "conflicted" in that situation, and on what we want to happen in other situations where the user does the pushing and/or fetching more than once. On second thought, |
I think the main use case is for letting you create a few commits on top of |
|
True. |
I'll rewrite this patch to address what has been talked about here.
Something like this would also be needed to get the basic gerrit support started |
Why is that needed? I'm not saying it's not, I probably just don't know enough about Gerrit. |
The way someone interacts with gerrit changes is through a ref:
So, being able to grab a ref and interact with it is important |
Also github has those readonly PR refs I mentioned too |
I was actually getting things backwards before. There's a mixup keeps happening when I think about fetching & remote-tracking branches. On third thought, I now think that the only reasonable thing to do is to have Why I think
|
In that scenario, new position of the remote-tracking For Gerrit use case, I think this kind of stuff wouldn't matter since |
The motivation for this change was Gerrit, but that will ideally be subsumbed by #2845, avoiding most of the nits and UX problems we've talked about here — though we could address them another time, I firmly believe this way forward is much better for Gerrit support. |
I have recently been playing around with Radicle, which is a decentralized git source forge. It takes advantage of pushing to specific refspecs for features like creating patches. I haven't used Gerrit, from what I gather it probably does something similar. The Radicle documentation for this can be found here: https://radicle.xyz/guides/user#working-with-patches |
FWIW, my workflow involves no local branches. I simply have the following alias in my bashrc to do all my github PRs.
So I write something like I'd be a fan of anything that allows me to use jj to achieve this, since this is a little awkward. I'd like something along the lines of |
Primarily for basic gerrit interop