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

It's totally possible to have no issues with Git, e.g. if you are only using it for small or slow moving repos.

There definitely are lots of big issues with Git though. I dunno how many jj solves but it doesn't seem unreasonable to suggest people move to a better system.



And I totally agree! And if jj works better for you, please use it!

My point is just that I am yet to find a convincing example that would suggest that jj would improve my workflow. If people find it hard to stash a change, I don't tell them that they shouldn't get their shit together and not use jj. But I don't find it hard to stash a change, so why do I feel like jj evangelists try to convince me that something is wrong with me?


This is the age-old issue of how you describe something that has enough small improvements to result in one big one. There's no single thing that someone can say to convince you to switch to jj, because there's no single thing that you can do with jj that you can't with git. It just has a thousand little improvements left and right, that make it a joy to use.

That just results in less friction, and in you doing things with it that you couldn't be bothered to before. Yes, I can switch branches in git by stashing my changes, and then I can try to figure out the five-levels-deep stash stack, but with jj I just switch between branches without finishing working on them, because it just works and is easy.

Yes, with git you can technically have five branches open at the same time, and stash work to switch between them to work on one thing or the other, but it's so hard and finicky that you end up never doing it in reality. Or, you can say "I never need that", but is it that you never need it, or that your tools make it so hard that you just subconsciously never do it? For me, it was the latter, as now I'm switching between branches ALL THE TIME, just because it's easy.


> because there's no single thing that you can do with jj that you can't with git.

- jj undo, jj op restore, and jj --at-op to reset or view the repo at a previous state

- create multiple directories (workspaces) backed by a single repository at different commits

These are the only things I can think of off the top of my head that you can do with jj that you can't do with git.


> jj undo

Yeah - the other day I did a fetch, and then decided I didn't want to fetch. I simply ran "jj undo" to undo the fetch.


> create multiple directories (workspaces) backed by a single repository at different commits

This is `git worktree`.

They don't work with submodules but submodules are a disaster that should be avoided anyway so probably no big loss there.


Ah, I was not familiar with that feature in git. In that case, I'll swap out jj workspaces for sparse checkouts :-)


Apparently git sparse-checkout exists! I'm going to stop guessing features that git doesn't have now.


> to reset or view the repo at a previous state

What about `git reflog`?


That lets you see previously checked out revisions. Jujutsu keeps track of all previous repo state. In git, you can pull a new remote branch, delete that branch, and push the deletion. If you want to get that branch back, git reflog will only save you if you checked out that commit. If you didn't, you're SOL. Jujutsu will let you undo the delete operation, restore the repo to a state where the branch existed, or view the repo at a state where the branch existed, and create a new branch at the same revision that the old branch was before it was deleted.


That might be cool, actually.

FWIW, I cheated on a previous job for months by working 10% or so, then faking git commit data to spread it out across the week before sending a PR.

Thank you "git commit --amend --no-edit --date xxx"


What if you commit secrets to the repo by accident?


Just edit it out and don't push it to upstream?


Jujutsu repos only exists locally. There are no Jujutsu remotes, only git remotes. Repo properties unique to Jujutsu (repo history, stable revision IDs) are not pushed to git remotes.


This is interesting, thanks!


I've started, in this thread, likening it to Plato's Cave - people who are just using git are just seeing/using a blurry facsimile/projection of actual reality/possibilities. It's not a perfect analogy (jj is, I suppose, the projection, and people are chained in the cave), but it makes the point that there could be so much more.

The matrix or people happily in a cult would be similar analogies. Perhaps even Stockholm syndrome...


This is exactly why it feels like evangelism: "people who don't love jj haven't seen the light/are uninformed/live in the dark age/must be in a cult".

That kind of rhetoric makes me want to say "don't tell me I'm stupid if you are the one finding it hard to switch between git branches".


It is evangelism. Unabashedly. I think the Plato’s cave analogy is honestly apt.

Git was fine. I used git for ages. I loved its underlying model, and I think it’s brilliant. But it has a lot of sharp edges and a lot of tasks that are painful or frustrating, and people either opt to restrict themselves to a tiny subset to avoid the pain or they carefully curate a workflow that mostly does the job over the course of years.

Suddenly within a week of trying a new tool you just… don’t carry any of that any more.

It’s like going from GOTOs to structured programming with encapsulated functions. People made many useful programs with GOTO. Some people were more principled than others, but we all got by. But it turns out that functions and loops are a way better mental model for control flow than GOTO. Nobody had to switch and there were plenty of holdouts. But eventually the benefits were impossible to ignore.

People like Dijkstra evangelized structured programming because they “saw the light”.


You have a point, but it's more like it's difficult to articulate, than a cult.

I think of jj as the ultimate refinement of git. It's not revolutionary, in the sense that there's no must-have feature, but it's a distinct evolutionary upgrade that's just way more pleasant than git.

It's telling that most hard-core git gurus are lukewarm on jj at first, but for everyone else, jj makes it way easier to do guru-level version control.

Just my $.02, anyway.


That's fine. Carry on


I like to phrase it as "jj enables everyone to be the git guru".

The git gurus responding how they can do X/Y/Z don't quite realize that git is still cumbersome enough that most people never bother to reach their level of proficiency.

Whereas jj is simpler, better-designed, and more powerful, so it's easier to start doing more advanced VC.

I also think everyone's underestimated how much universal undo enables exploration.


This is one of the few comments here that make me feel like I should just try jj. Thank you, this is useful :-).


You're welcome! I've honestly really started doing stuff that git conditioned me into think I just didn't need, just because it made them hard to do.


Ha! Good example!

Once I started using jj, I realized how poor/annoying git's stash is. You don't need a concept called stash in jj. You have some work done and want to stash it? Just leave it alone as a leaf node (or split your commit into a leaf node). Then branch off the parent to work on whatever you want.

And with jj, my "stashed" node is version controlled in itself. I can make changes to it, undo it, all while still being stashed. (Maybe you can do this in git - I don't know).

Other niceties of jj:

Why do I need to come up with a commit message only when committing? Why couple the two? With jj, you can just decide to work on X, write your commit message "Adding cat photos to Easter Egg", and then work on the feature. Or you can just start working, and in the middle of it all, add the commit message, and continue working. You can change the commit message at any point.

Why do I need to fix merge conflicts immediately? Just the other day in jj, I made a change, which resulted in a merge conflict in several nodes. Whatever - I just branched off a clean node and worked on what I needed to. Only the following day did I go and fix the merge conflict.

Why can I only merge two branches? And why do I need to think of from/to when merging? A merge is basically creating a new node that is the child of multiple nodes. It's symmetric - there's no from/to. And you should be able to specify 10 parents if you want to.




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

Search: