-
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
FR: Add option to only push "current" branch #246
Comments
I'm curious what your workflow is in which you have multiple active branches but don't want to push all of them? I'm thinking that the desire to not do so is based on deficiencies in the tooling, and that secretly people would want to sync all their branches, if only it were safer and easier. This is kind of like the fossil autosync workflow: https://www.fossil-scm.org/home/doc/trunk/www/concepts.wiki#workflow. At Facebook, we had something called "commit cloud" which synced all live heads across all machines, which is something I really miss and would like to recreate in git-branchless one day. jj is uniquely suited to syncing everything all the time because, unlike any other VCS solutions on the market that I'm aware of, it can address and resolve conflicts in branch moves, not just commit contents. So it would be "safe" to sync all your branches all the time and resolve conflicts later, unlike in e.g. Git, where you wouldn't want to force-push over the remote branch if it's diverged from yours. |
There are 2 cases where this comes into play (which I suppose you could think of as "tooling deficiencies"):
Bonus 2.5. - I don't encounter this scenario very often, but sometimes when there is ongoing discussion on a PR, I may prefer to wait with pushing updates to it that might confuse reviewers. As you say, if tooling were better, having all my work synced automatically would be great, but as long as that isn't the case, and some of the "deficient" tooling is out of my control, I still very much prefer to have control over what gets pushed and when. [1] The issue here is a combination of having branches in a repo visible to "everyone", and our corporate policy that doesn't allow forking (even for internal repos), so you basically everyone's WIP branches which is... not ideal. |
(Following the discussion here.)
Currently,
jj git push
either pushes all branches, or a single named branch (when used with the--branch
flag). It would be convenient if there was a way to only push the "current" branch. The "use case" here is just my personal preference - at any point in time I usually have multiple "active" branches, and I rarely want to push all of them at the same time. However, having to specify the branch name every time can get a little annoying (contrast this withgit push
orhg uc
).Implementation-wise, one option would be querying which branches point to the current commit, and only pushing that (potentially returning an error if more than one point to the same commit).
The text was updated successfully, but these errors were encountered: