-
Notifications
You must be signed in to change notification settings - Fork 355
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
jj init --git-repo=.
creates divergent branches if local and remote git refs diverge
#1862
Comments
jj init --git-repo=.
creates divergent branches if local and remote divergejj init --git-repo=.
creates divergent branches if local and remote git refs diverge
I'm beginning to think that with our current branch model, what jj does here might be, er, a feature (sorry!). We're talking about
The question is whether The problem is that If instead of creating a conflict, jj set I also had an interesting discussion with @yuja around https://discord.com/channels/968932220549103686/969829516539228222/1128850385256321085 about how this relates to #1734 and how we might want to change the branching model to allow jj to be more intelligent here. |
What I had is a few experimental branches in my work git repo very often divergent with the remote because git-branchless sync rebased them, and I got this when I finally did jj init. Yeah as I've said in the initial discord comment, when making the repro I kind of understood that from jjs point of view this does actually make some sense, even if slightly unintuitive So I guess this depends on the branching model change, if it's left unchanged this behavior does make sense - although we may want to document that. |
I lean towards considering this is a bug. Under the current branching model, all remote branches are considered to be kept in sync with the local counterparts. So it's probably better for
If we strictly follow this, missing git local branches become deleted in jj world. This would be too confusing, and the step (3) will need to be adjsted:
If we implement some variant of #1734, maybe we can remove the step (3) and leave missing branches as non-tracking:
(For non-tracking->tracking transition in #1734, I agree with #1862 (comment).) |
Wait. |
Forgive me, because it has been a long time, but: what does |
In hg, branch names are stored in each commit metadata. Bookmarks are close to git refs, but there are no remote-tracking stuff. iirc conflict resolution is manual step (something like divergent bookmark is renamed to |
If the existing git repo contains local and remote branches of the same name, one of the remote branches is probably a tracking remote branch. Let's show a hint how to set up tracking branches. The tracking state could be derived from .git/config, but doing that automatically might cause another issue like jj-vcs#1862, which could have been mitigated by git.auto-local-branch = false.
If the existing git repo contains local and remote branches of the same name, one of the remote branches is probably a tracking remote branch. Let's show a hint how to set up tracking branches. The tracking state could be derived from .git/config, but doing that automatically might cause another issue like #1862, which could have been mitigated by git.auto-local-branch = false.
As far as I can see in the chat, there's no objection to changing the default, and git.auto-local-branch = false is generally preferred. docs/branches.md isn't updated as it would otherwise conflict with jj-vcs#2625. I think the "Remotes" section will need a non-trivial rewrite. jj-vcs#1136, jj-vcs#1862
As far as I can see in the chat, there's no objection to changing the default, and git.auto-local-branch = false is generally preferred. docs/branches.md isn't updated as it would otherwise conflict with jj-vcs#2625. I think the "Remotes" section will need a non-trivial rewrite. jj-vcs#1136, jj-vcs#1862
Description
Steps to Reproduce the Problem
Expected Behavior
My expectation was that the branch
main
would only point tomain@git
Actual Behavior
Branch main diverges, pointing to both
main@git
andmain@origin
Specifications
jj 0.7.0-152a0683e25c16f0ef57ee20a723755748b696e3
The text was updated successfully, but these errors were encountered: