-
Notifications
You must be signed in to change notification settings - Fork 346
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
refactor: remove 'jj checkout' command #1713
Conversation
Some discussion on Discord basically lead to Martin deciding this would be OK; users should generally use `jj new` instead of checkout, which is not only more general (it can take more than one revset, in order to perform a merge) -- it's also not trying to be something it isn't. The idea was, people will try to do `checkout` and might feel strange if it doesn't work. First impressions matter. But on the other hand, `git checkout` is a particular colloquialism that even Git itself seems to be (slowly) moving away from with `git branch` and the experimental `git switch`. Just trying to have a familiar name isn't enough if the mechanics aren't the same, and may lead to *more* confusion due to behavioral changes. This can of course always be revisited later if people really *do* clamour for that wonderful `checkout` command, but in such a case, it's *probably* better as an alias of `new` anyway, rather than having similar-but-more-restricted semantics. Signed-off-by: Austin Seipp <[email protected]> Change-Id: Iwmotxnmmopxptrvzqzpsytvkyvwlrrll
I also got the tests and examples changed, but might have missed something here or there. |
Instead of removing the command entirely, could we leave a redirect that says, ~"Use Ideally, for those transitioning from git, retaining as much git motor memory is a huge ergonomic advantage. |
This looks fine. But it'd be better if we left |
How about:
|
I'd also be OK with keeping |
FWIW, on the note of shorthands, I'd be a big fan of more one-letter shorthands by default, but I know people have wildly varying opinions on that. At the very least I have |
When I was playing with the idea of making an intellij plugin for jj I found deeper meaning in the |
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.
If possible, please limit the reformatting to the paragraphs you actually changed. If you'd like to reformat the whole file, that can be a separate commit.
In this case, I'm not sure the reformatting is for the better, but I only glanced at it; feel free to have a reformatting commit if you feel it is for the better.
If this is difficult, we can leave it be.
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.
Damn, I thought I avoided this but apparently not. It was an accident in vscode and I guess my changes got slurped up. I'll back this out and fix it.
@@ -9,6 +9,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 | |||
|
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.
Re the commit's and PR title: I wouldn't call this a "refactor". I'd put "cli" instead (not sure if other people have better thoughts).
That plan sounds good to me. |
To be explicit, this first version will also include the message to prefer |
The final version could be more welcoming to git users by giving a hint if they type And this never goes away (unless git completely gets replaced by jj everywhere, then sure)
Should we do the same thing with I feel like in git there is this strong connection between "merging" and "fixing merge conflicts", and So |
I'm mildly opposed to removing I wouldn't mind making it look like an actual alias to |
Do you feel the same about removing I think my preference is to make both |
I think the case for removing Personally, I'm not sure how objective this feeling is (I'm not opposed to any outcome here, and my feelings may change), but I currently don't really want to remove them in a later version (especially if they are aliases) or print a warning without a good reason (e.g. if I might be a bit biased by using |
Yep, that's what I was imagining, more or less.
Yeah, and I think that's actually a good idea. Generally speaking, I think jj is early on enough in its life (and in the 0.x series) that removing some stuff like this is good, healthy, and should be done early, so you don't have to maintain semi-similar commands with minor differences forever. It seems small now but a lot can happen in the long run. Forwarding commands and stuff is mostly fine, probably, but minor semantic differences can get hairy in the long run. But on the other hand, just printing a command that says "Please use this other command" is like, 5 lines of code and probably not a big deal? You can keep that forever, yeah. So really the motivation is just "Do it now, before you can never, ever do it," which in my (FOSS, mostly) experience is a point that comes along and hits you much like a truck, at high speeds and quite unexpectedly. It probably would have been better for me to lead with that as more of a motivation, admittedly.
Yeah, I hadn't thought about merge actually, but it's a good point... There's a tension between basically having too many "verbs" (Git has an astronomical amount of them), but also not making people uncomfortable by lacking the verbs they expect... In light of this, I'm going to close this PR for now. It's clear we don't want to delete this code just yet, but at the same time there seems to be some consensus that maybe "thinning the verbs" is worth thinking about. I think starting a discussion in the discussion forums with a little wider context might be more useful; we can start with |
(sorry for giving my last msg here I guess) IMO the best outcome would be for the mature version of jj to not have functional And there could be a known set of aliases you could easily add to your config to make jj way more git-like if you prefer, and it's mentioned in learning resources etc Multiple verbs that do essentially the same thing must be one actual command and learning-warnings/aliases/not-being-there-at-all |
Well said, put that way it sounds pretty compelling. If
It would be pretty easy to have a hidden I am not sure this is the one true way to go, but it seems like a sensible option. (Update: I didn't know Also, this fantasy Actually, |
Some discussion on Discord basically lead to Martin deciding this would be OK; users should generally use
jj new
instead of checkout, which is not only more general (it can take more than one revset, in order to perform a merge) -- it's also not trying to be something it isn't.The idea was, people will try to do
checkout
and might feel strange if it doesn't work. First impressions matter. But on the other hand,git checkout
is a particular colloquialism that even Git itself seems to be (slowly) moving away from withgit branch
and the experimentalgit switch
. Just trying to have a familiar name isn't enough if the mechanics aren't the same, and may lead to more confusion due to behavioral changes.This can of course always be revisited later if people really do clamour for that wonderful
checkout
command, but in such a case, it's probably better as an alias ofnew
anyway, rather than having similar-but-more-restricted semantics.Change-Id: Iwmotxnmmopxptrvzqzpsytvkyvwlrrll
Checklist
If applicable:
CHANGELOG.md