Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

In jj you tend to use `jj split` to break changes apart. The selected bits become the first revision, the remaining bits become the second revision.

I tend to do a bunch of work then split into small, bite-sized revisions. Often I split something out to a parallel revision (e.g., a separate branch) if it’s an independent thread of work like a bugfix elsewhere or a documentation fix. This is an obvious one-liner in jj but a bunch of annoying branch-switching and stashing in git.

You can also use a `git add`-style workflow. Create a new revision with `jj new`. Do it again. Make your changes, then `jj squash -i/--interactive` to select the bits you want to include. Keep making changes and squashing into the previous commit you’re building up until you’re happy. Conceptually just think of @ (the current revision) and @- (the previous revision) as the working copy and the staged copy, respectively.



I feel like I already lost more time reading this than jj would make me win if I switched :-).


In the first year of switching I easily saved more time and frustration than the sum total of all of my jj evangelism on HN.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: