I've joined the jujutsu fan club. While it is rather disorienting to use at first, when coming from git, there are some really interesting ideas that can make life easier.
Here are my favorites:
- No more
git add ...Every edit is automatically in a working copy commit. - Similarly, no more
git rm ...! Just remove the file and it becomes untracked/removed in the working copy. - History: you can easily
jj undo/jj redoany action whatsoever. Abandon the wrong commits? No problem,jj undo. - Stable change IDs: if I edit a commit in git, the hash changes while jj keeps a stable change id.
- No stashing: Parallel work is more natural. This is an extension of the fact that there's no staging area and changes are automatically committed... because of this it's easier to jump back and forth to and from commits picking up just where it was left.
- Sync branches with upstream rarely... much is automatic. When I
jj git fetchI don't have to make sure "local branches" are up to date and merge/rebase each, they automatically point to the correct commit in the DAG upon fetch. My work that is now "behind" clearly points to commits before staging and I can rebase those if necessary. - Conflicts are easier to manage. They are non blocking (no more
rebase --continue) and can be left in place as long as you want. When they're edited/fixed, they're resolved automatically. - Works side-by-side with git so one can always hop back to familiar git commands as needed.
jj squash -i --into <older-commit>piece out portions of code to squash into an earlier commit. This makes managing working history very easy. (alsojj squash --into <older-commit> path/to/file)jj arrangefor a tui interface to reorder commits easily- "force" isn't required... if you changed immutable commits (commits pushed upstream) with the --ignore-immutable, push commands "just work"
- Also I love that outputs automatically show the shorthand prefixes for change
IDs and hashes. Makes for easy cli work... often as short as one letter so
instead of
jj edit svzwsrrqit'sjj edit s. (git doesn't show this automatically though it sorta works by uniqueness, e.g. if only one commit started withayou could type justa... but this again is a package deal with stable change IDs. My current task will always be at commitxno matter how things change around it.