Live data from Hacker News

Ask HN: Git Alternatives – Sapling vs. Jj

news.ycombinator.com

31–40 of 66 posts

Re: Ask HN: Git Alternatives – Sapling vs. Jj

#31

JJ is incredible. Highly recommend it. I can't put into words what a game changer it is for my workflow. The only thing I reach for for git now is `bisect` when I need to debug an oncall issue.

This is a nice reminder for me to check it out.

I've liked Phabricator, and Google's internal variant of Mercurial in the past (and have always despised GitHub's PR=branch model). Sounds like Jujutsu might be right up my alley.

Re: Ask HN: Git Alternatives – Sapling vs. Jj

#32
post #19

A question: I prefer jumping into the command line for most of my git work. But, I'm intrigued by this discussion and wonder: how well do these tools work within an editor? I am using Zed, which IMHO has poor git support anyway. I'm curious if the experiences here are mostly from people who do not use their editor as their main point of contact with the code repository they are working on.

I'll use JJ through an integrated terminal in my editor

Re: Ask HN: Git Alternatives – Sapling vs. Jj

#33
I've been using Sapling along with the VSCode extension for ISL which mostly gets me a better workflow with diff stacks locally (Github isn't great dealing with stacks though).

The only major limitation for me is git-lfs support so for certain repos I have to revert to git.

Re: Ask HN: Git Alternatives – Sapling vs. Jj

#34

I like fossil. Much prefer it to git. No idea what stacked PRs are but it's compatible with git and way simpler in my opinion. Plus comes with some nice extras like tickets, wiki, UI.

It comes up a lot in split repos or split deployments.

To make a change you need to deploy part of it here, then another part over there, and maybe fiddle with some settings in between.

So your story ends up with several PRs that have to land in a specific order or things break. Eg client calling a new endpoint that doesn’t exist yet.

We call these chains of dependent reviews “stacked” for reasons I’m not entirely clear on.

Re: Ask HN: Git Alternatives – Sapling vs. Jj

#35
post #34

I like fossil. Much prefer it to git. No idea what stacked PRs are but it's compatible with git and way simpler in my opinion. Plus comes with some nice extras like tickets, wiki, UI.

It comes up a lot in split repos or split deployments. To make a change you need to deploy part of it here, then another part over there, and maybe fiddle with some settings in between. So your story ends up with several PRs that have to land in a specific order or things break. Eg client calling a new endpoint that doesn’t exist yet. We call these chains of dependent reviews “stacked” for reasons I’m not entirely cl…

That sounds like a nightmare, and I'm glad I've never had to deal with something like that. Benefits of not being a professional developer.

Re: Ask HN: Git Alternatives – Sapling vs. Jj

#36

I like fossil. Much prefer it to git. No idea what stacked PRs are but it's compatible with git and way simpler in my opinion. Plus comes with some nice extras like tickets, wiki, UI.

Stacked PRs is GitHub users (or Phabricator) reinventing commits as pull requests.

Re: Ask HN: Git Alternatives – Sapling vs. Jj

#37
post #25

Earlier quoted context omitted.

What's the advantage of using Sapling as an alternative Git frontend?

You don't need to manage the stash or index, those are just expressed as commits, so you have fewer commands and a simpler UX, and can use universal tools like 'split' to handle cases you'd otherwise need stash/apply/switch to handle. It supports Mercurial-like "revsets", so it is easy and flexible to query the commit graph for all kinds of information, in a user-controlled way. Features like 'sl absorb' can do git '…

> You don't need to manage the stash or index, those are just expressed as commits,

You can also avoid managing the stash in Git. By not using it.

Re: Ask HN: Git Alternatives – Sapling vs. Jj

#38
post #25

Earlier quoted context omitted.

You don't need to manage the stash or index, those are just expressed as commits, so you have fewer commands and a simpler UX, and can use universal tools like 'split' to handle cases you'd otherwise need stash/apply/switch to handle. It supports Mercurial-like "revsets", so it is easy and flexible to query the commit graph for all kinds of information, in a user-controlled way. Features like 'sl absorb' can do git '…

> You don't need to manage the stash or index, those are just expressed as commits, You can also avoid managing the stash in Git. By not using it.

But you still need to deal with a dirty working copy somehow. This blog post from today happens to describe one scenario where it's nice not to have to worry about changes in the working copy:

https://drewdevault.com/2024/12/10/2024-12-10-Daily-driving-...

Re: Ask HN: Git Alternatives – Sapling vs. Jj

#39
I learnt Sapling while at Meta. I was skeptical when someone said "it's better than git" but then I used it and I will in turn now say that it's indeed better than git. At the very least it doesn't yell at you for not being on a branch and losing code, but it has easy commands for working with a source tree and working with diff stacks. I haven't used it outside Meta's infrastructure though.

Re: Ask HN: Git Alternatives – Sapling vs. Jj

#40
I switched to jj about a month ago and love it.

Broadly speaking, commits in git represent two conflicting ideas – a mechanical representation of the state of the codebase, and a logical series of changes for bisecting and human readability. It's possible to manage this in git, but painful.

In jj, these two concepts are separated – you have Revisions which represent the mechanical state, and are saved every time you run any command, even `jj status`. And you have Changes, which represent the human readable stuff, and can be edited at any time. This makes it really easy to save lots of snapshots, while carefully crafting your Changes for a readable history.

I was surprised at how easy it was to adapt to jj. It didn't feel like I had to learn a lot of stuff or a big new mental model, it turns out to just be pretty simple to craft the Changes at any point I please.

Post reply on HN