-
Notifications
You must be signed in to change notification settings - Fork 324
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
cli: branch: on create/set/rename, assume deleted tracking local branch still exists #3884
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am still undecided on the best possible message, but it's OK already, and that can be fixed up later. The rest of the PR LGTM.
Thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW, this PR can go away if we decide to reorganize create
+ set
as something like set
(upsert) + move
.
The weirdness I'm trying to fix by this patch is that "create" preserves the existing tracking state. If the command name were "set", the behavior makes sense.
Created #3895 I personally prefer it over this PR since it seems more useful and will have a fewer special cases. |
Wouldn't this problem affect |
My feeling is that |
I don't think I would agree if If Some less solidified thoughts: This might create a (minor? not minor?) problem if the user deleted a branch I am not sure this is a fatal problem. The same problem would also happen if you Finally, if If we keep |
(Update: I belatedly realized I should have posted this in #3884 (comment), now this post is more or less duplicated) As an aside, I'm pretty sure I want Most likely, I'll require people to specify either Let me know if you prefer not doing this or find this controversial enough to benefit from filing an FR before trying to implement a PR. |
My plan is:
The reason behind the idea is that
Yeah. That's why I think we might want some warning message. Another reason I'm getting skeptical about this PR is that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, thank you!
…d remotes We use "tracked remote branches" in the doc, and hints are usually capitalized.
While explaining branch tracking behavior, I find it's bad UX that a deleted branch can be re-"create"d with tracking state preserved. It's rather a "set" operation. Since deleted tracking branch is still listed, I think it's better to assume that the local branch name is reserved. martinvonz#3871 Renaming to deleted tracking branch is still allowed (with warning) because the "rename" command can't handle tracked remotes very well. If it were banned, bad rename couldn't be reverted by using "jj branch rename". It would be confusing if "rename a b" succeeded with warning, but the following "rename b a" failed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for suggestions.
Checklist
If applicable:
CHANGELOG.md