-
Notifications
You must be signed in to change notification settings - Fork 699
git: add git colocate command #7392
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
base: main
Are you sure you want to change the base?
Conversation
416a7c2
to
32ef2c8
Compare
979a10e
to
0fe12f1
Compare
Is there any impact on existing workspaces or clones? (not sure if there are pointers to .git or defined remotes that would be "not found") |
Sorry, when you say that Also, are you saying that you'd prefer to merge #4833 rather than this version? I'm sorry I had not seen that existing PR. |
I don't think it affects existing workspaces, since they refer to the .jj/repo folder, I believe, which is still there. |
You aren't doing it, as the PR now has three commits, when it only should be one (there should be no, PR suggestions commit and the final rework also only should exist while the approach is discussed). Because the project doesn't squash merge commits and only rebases them.
I'm pretty sure @cormacrelf won't mind if you resubmit that patch for him which would finally land this. |
0fe12f1
to
7a6cffe
Compare
This new command lets you turn a non co-located git repo into a co-located repo or vice-versa (by using the --enable and --disable flags). The command simply implements the instructions found in https://github.com/jj-vcs/jj/blob/main/docs/git-compatibility.md#converting-a-repo-into-a-co-located-repo If you don't pass any flags the command shows the current co-location state and suggests of how to change it.
7a6cffe
to
a95813a
Compare
OK. I actually prefer to do what you suggest but I was worried it could cause issues with GitHub's comment tracking. I've just pushed a new version which squashes the 3 commits into one.
I don't mind which one of the two PRs is merged, but if
OK. Actually I prefer doing what you suggest (since it is so natural when using jj) but I was worried it might cause problems with GitHub's PR comment tracking. I just squashed all 3 changes, updated the commit message to indicate that it fixes #4624 and pushed this new version.
I don't mind which PR is merged as long as one is merged, but if #4833 is preferable I think it'd be best if the original author got it through. |
That PR was never finalized, which is unfortunate, but is something quite common when the contributor switches to something else or doesn't have time to work on it anymore. This PR also adds a way to de-colocate the repository, that the previous one didn't have. I there a specific reason to prefer the previous one? |
It contains the start for colocated workspaces and is overall simpler by not having the |
I had not considered the jj workspace / git worktree integration which I guess would be nice. No reason why it could not be added later. It's true that #4833 is a smaller change than this PR but I guess part of the reason is that it does not support undoing the co-location. Also, even though I initially proposed a similar interface for colocating a repo as what is proposed by #4833, (i.e. a simple Honestly, I'm a little worried that unless someone makes a decision either way, both PRs will get stuck and none of them will land anytime soon. |
In terms of the justification for this, we should consider that colocated repos will likely become the default in the October release. (#7213) So I assume the need for turning a non-colocated repo into a colocated one after the fact will be much smaller. How about the other way around? Will there be lots of people wanting to turn their default-colocated repos into non-colocated ones? I don't know. |
These requests are rare if you look through the Discord and GH discussions, so I'd prefer the simpler interface and defer the |
In that case, do we need this command at all if colocated repos become the default? |
yes, since it is a useful helper in its own, since I assume there will be a bunch of people who'll want to try out the 'native' experience and switch back. |
This new command lets you turn a non colocated git repo into a colocated repo and back (by passing and --undo flag). The command simply implements the instructions found in https://github.com/jj-vcs/jj/blob/main/docs/git-compatibility.md#converting-a-repo-into-a-co-located-repo.
Checklist
If applicable:
CHANGELOG.md
README.md
,docs/
,demos/
)cli/src/config-schema.json
)