-
Notifications
You must be signed in to change notification settings - Fork 365
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: Running jj workspace forget
on the main workspace should make another workspace the main one.
#5271
Comments
What is the current behavior of forgetting the main workspace? It deletes the colocated |
It disassociates the current (or main) working copy from the repo. Nothing should be deleted, but the result would be a bit surprising. We can at least show a warning (with hint to
I wouldn't expect the "main" workspace carries to random place by fwiw, it might be better to force user to explicitly specify the workspace to forget (with |
@umnikos Can you clarify how it makes it easy to accidentally delete your git store? I didn't follow. |
@arxanas example:
|
I see, so it doesn't delete the Git store directly, but only enables it in certain workflows. Some other ideas:
|
Makes sense. The main risk I see is that it would delete ignored files (which we don't normally delete).
That's also what Yuya suggested above. I agree with adding it. |
Problem
It is hard to keep track of which workspace is the "main" one (the one with the git store in it). As far as I know there is no command that outputs which workspace is the main one, and
jj workspace forget
will let you forget the main workspace with no warning. All of this makes it easy to accidentally delete your git store (@chriskrycho can testify to that).Proposed solution
jj workspace forget
-ting the main workspace should first move its git store to another non-forgotten workspace (if there's any) before proceeding with the forgetting. Additionally a command that outputs which workspace is the main one or a command to set which workspace should become the default one would help.Alternative solutions
The only alternative I can think of is to keep the git directory outside all of the workspaces, but I cannot think of a convenient location.
The text was updated successfully, but these errors were encountered: