Hacker News new | ask | show | jobs
by boltzmann64 14 days ago
if you are mid work and suddenly need to checkout something you checkout in a new worktree so that all your context remains intact. `git worktree` has been in stable since 2015.

i have not used jj, but if you are introducing sqaush/new just you get what the stage does cleanly then you are implictly agreeing with the stage model.

2 comments

JJ also has worktrees (called workspaces), but some repositories require more setup (like .env, install dirs, etc), and just checking out ends up being simpler and faster.

> i have not used jj, but if you are introducing sqaush/new just you get what the stage does cleanly then you are implictly agreeing with the stage model.

Squash / new also do it cleanly, just like `git add -e` (I'm not sure what you mean with "cleanly", does it mean "as a special concept?"). And you're right, I agree with the stage model (that's most of the point of my comment!), and I personally think it works pretty well on jj.

> you are introducing sqaush/new just you get what the stage does cleanly

I think that's where I disagree with you. Git introduces the staging area (and stash) as separate concepts divorced from the DAG of changes. JJ just has the DAG, and nothing else. I'd say JJ is the cleaner model.