3 ms·
A lot of the discussion focuses on differences from git and how it uses the git storage strategy under the hood. Honestly, I think you should just ignore all of
by ibejoeb 6mo ago
A lot of the discussion focuses on differences from git and how it uses the git storage strategy under the hood. Honestly, I think you should just ignore all of that. Don't think about git. Here's a workflow that'll get you through your daily usage:
On a clean repo:
$ jj
The working copy has no changes.
Working copy (@) : abcdef a53ff9ba (empty) (no description set)
Parent commit (@-): qrstuv 4bc1bf34 the last thing you did
Make some changes.
$ jj # shows status (new, modified, deleted, moved, etc.)
If you're satisfied with your changes,
$ jj commit -m "made changes"
Now `jj` is back to clean state. You don't need to do `jj new` to continue working linearly. Just make your next changes and commit. If you realize that you messed something up, fix it, then `jj squash` and it gets incorporated into that last commit.
You only `jj new -r lmnop` if you want to do some work based on the state of the codebase at revision lmnop, rather than the previous revision, which is a figurative branch. No need to manually create and name branches.
As for git history: just do `git log` to see what's actually going on. It's a clean history reflecting your `jj commit`s. You're not going to see all of the stuff the jj machinery does.
- skydhash 6mo agoIf I really wanted that, I could create an alias like alias.save="!git add -A; git commit -m" And then use $ git save "made changes"
- ibejoeb 6mo agoYou could. That's not the point. I suggesting that if you want to try jj, try it based on its affordances, not by comparing it to how you'd do it differently with git. Most of the tutorials start with git and try to teach you how to change your thinking. I think the project would find many more fans if it didn't make such a big deal about being kinda like git.
- skydhash 6mo agoI did try it, but it was not my cup of tee. Git fits my mental modal better. Branches are experiments, commits are notes in my lab notebook, stashes are notes in scrap of papers, the staging area is for things that I plan to note down and the working tree is the workbench. Then every once in a while I take the notebook and rewrite stuff in it or update it to fit recent changes in the canonical branches. I use magit so the actual operations are just a few quick key presses. I could probably do the same thing with jj, but why use a new tool when the old thing works well, has myriad of integrations, and it's fairly standard.
- menaerus 6mo agoThe problem jj is trying to solve is not entirely clear to me but I guess there is enough people who aren't able to find their way with git so for them it probably makes switching to jj more appealing, or at least that's my first impression without going too deep into the documentation.
- steveklabnik 6mo agoSome of jj's users are "I find git hard and like jj more" but a lot of us are/were git experts before switching.
- menaerus 6mo agoYes, I understand that but what I'm saying is that the problem definition isn't completely clear to me. I'm not saying that there is none, it's just that it may not be obvious at the first read.
- steveklabnik 6mo agoAh, no worries.
- oniony 6mo agoI wouldn't say it's that people are not able to find their way with Git. I was a competent Git user and would carefully and squash my commits. It's just easier and nicer with Jujutsu. The way all changes (except those in the ignore file) are automatically incorporated into the current commit means I don't have to faff about with stash when I need to pivot and then try to remember which commit to pop against. I can just hop around the tree with gay abandon. That alone is invaluable. Then add in the fact that a change to history gets rippled down the descendent commits. And the fact that conflicts are recorded in the history and can be dealt with at your leisure. Or the fact that `jj undo` is a thing.
- whytevuhuni 6mo ago
- 8n4vidtmkvmk 6mo agoSometimes i like to jj describe before writing any code. It helps with mental clarity what i intend on writing or helps if i have to run away mid coding session (description will show in log so i can find it again) In this scenario I'd instead jj new at the end, after im finished and ready to move on to the next thing.
- MrGreenTea 6mo agoYou can then also just use `jj commit`. It will see the existing commit message and just move to a new clean revision.
- busfahrer 6mo ago> Don't think about git. You can also make the reverse point, only think about git: In theory it's perfectly possible if you have to jj binary lying around somewhere, to not even use it as your git client, but to temporarily do a `jj git init --colocate`, do a complex restructuring of your repo across 3 branches, and then delete the .jj folder again :-) Just to highlight the other end of the spectrum, jj is flexible like that
- steveklabnik 6mo agoColocation is the default these days, so you don't even need that flag :)