Remix.run Logo
jdkoeck 11 hours ago

Wow, that’s a total deal breaker to me. Using git may require a complex mental model, but at least it’s not doing anything I didn’t ask for.

Diggsey 11 hours ago | parent | next [-]

You would have had to run `jj edit` in order for this to happen, so I think it's a stretch to say you didn't ask for the edit?

This is the main difference though: in git files can be `staged`, `unstaged` or `committed`, so at any one time there are 3 entire snapshots of the repo "active".

In `jj` there is only one kind of snapshot (a change) and only one is "active" (the current working directory). When you make changes to the working directory you are modifying that "change".

As others have mentioned, the equivalent to `git checkout` would be `jj new`, which ensures a new empty change exists above the one you are checking out, so that any changes you make go into that new change rather than affecting the existing one.

jdkoeck 2 hours ago | parent [-]

Thanks for the explanation! I wish I could edit my comment to reflect the truth.

saghm 9 hours ago | parent | prev | next [-]

Using `jj edit` will edit a commit you specify, and `jj new` will make a new empty commit after the one you specify. These work exactly the same whether you specify a commit by branch or by the hash. I'd argue that you're getting exactly what you ask for with these commands, and by comparison, what "checkout" is asking for is much less obvious (and depends on context). We've just internalized the bad behavior of git for so long that it's become normalized.

stouset 8 hours ago | parent | prev | next [-]

`jj edit` is quite literally asking for that.

GP is holding it wrong. If you don’t want to edit a commit, don’t ask to edit it. Use `jj new`.

11 hours ago | parent | prev [-]
[deleted]