Live data from Hacker News

Ask HN: Git Alternatives – Sapling vs. Jj

news.ycombinator.com

41–50 of 66 posts

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

#42
post #21

> I am uninterested in `you can do that in git with [insert esoteric commands]`. Why? If the only requirements you specified are that you're looking for something that is compatible with Git but with better ergonomics, wouldn't something that wraps Git (whether that's via aliases or something more comprehensive) fit the bill?

It's a fair question, but the answer is simple: because there are significant design choices in the UX and algorithms which are user visible, and percolate throughout the entire system design, which can't just be wrapped or alias'd away. There is git-branchless, which is kind of like this[1][2] and is something like a half-way point between Git and Jujutsu/Sapling. However, it needs to be stated that git branchless d…

For more info, here are some git-branchless write-ups on the topics:

- https://blog.waleedkhan.name/git-undo/ — has a link to this article explaining some things that can't be undone in the Git model via reflog: https://github.com/arxanas/git-branchless/wiki/Architecture#...

- https://blog.waleedkhan.name/in-memory-rebases/ — It's non-trivial to support workflows like "rebase just commit X out of its branch and insert it before commit Y in that branch" in a single command. jj implements the same workflows as well.

- https://blog.waleedkhan.name/bringing-revsets-to-git/

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

#44
If you're looking for a polished way to manage a stacked-PRs workflow with git and GitHub, I highly recommend Revup. It was invented at Skydio when I worked there, and quickly developed a cult following among engineers there. I wouldn't describe it as simpler than default git, especially since you still mostly use git commands (like rebase -i) for lots of tasks, but for power users it provides a really nice workflow.

https://github.com/Skydio/revup

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

#45
post #30
post #17

I have been using `git-branchless` a lot and really liking it. It should be part of the main git project, consider it a halfway between git and switching to some other tool.

For what it’s worth, the main developer of git-branchless is also a `jj` contributor

One of the main reasons to use git-branchless over jj or Sapling is if you need support for a workflow that's not supported in jj/Sapling yet, such as Git LFS. I (git-branchless author) would like to see both systems get to feature parity one day to unblock users who would like to migrate but can't.

These days, there are relatively few things that git-branchless can do that jj/Sapling can't, one example being its (somewhat opinionated) `git test` command: https://github.com/arxanas/git-branchless/wiki/Command:-git-...

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

#47
I just started a new job where I’m collaborating with the maintainers of mercurial, and was asking them about these alternative VCSs last night. It was interesting to learn that all these people are in contact with each other and there’s a lot of cross pollination of ideas. And for some newer ideas e.g. in jj and pijul, where just reading the website would have me 100% sold, they had more nuanced takes on the pros and cons. So I feel less confident in giving advice than I would have a few days ago. But if you need seamless git compatibility, I’ve personally found git-branchless to be the best solution for the requirements you listed as a thin layer over git. I also tried jj a while back and I liked it but I found being further removed from git made it harder to drop down into regular git when I needed to. In particular I had issues with jj log showing lots of irrelevant commits but that was probably because of our particular Gerrit setup and might have been fixed by now.

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

#48
At work I’ve been using jj for the internal Standard Chartered monorepo (6.5 MLOC). I didn’t ask anyone, just installed and started using it. Git compatibility is a killer feature.

(if anyone from SC is reading this -- search our wiki for "Jujutsu" and come say hi!)

Pretty much a strictly better experience than git so far — I’m not going back. `jj undo` is something that I expect in every program now and get vaguely annoyed it's not there.

Not having index/staging is great. Checking out another branch, switching to work on another thing, fixing a typo in an unrelated module, etc are all frictionless. "I'll insert a new commit five-commits-ago, do the refactoring there, and resolve conflicts" turns out to be much nicer than "I'll do the refactoring here and carefully stage it hunk-by-hunk". (I get distracted a lot -- maybe if you aren't tempted by shiny refactorings, this isn't a big deal for you.)

The merge story is also great. I have a commit with multiple parents. I can add more parents to it, change parents, rebase it somewhere, move it around. I have no idea how "rebasing a merge" works in git, but I'm afraid to try. In jj I don't care.

There are a few issues with jj that happen to not be a big deal for me, but I can imagine they could be a dealbreaker for someone else:

- No submodules support (yet)

- No LFS support (yet?)

- Doesn't track renames (yet?)

- When you do `git pull` with rebase, git skips duplicate commits -- this is great if something got rebased/amended on the remote. I was always suspicious that `git pull` just works even if I rebased the branch remotely, and now I know why it works. jj doesn't handle this yet. Not a big deal unless two people collaborate on a branch and want to do it the jj-way with rebases of everything.

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

#49
post #8

There's also Pijul. I have only had a brief play with Jujutsu and I haven't tried Sapling but from what I can see, Jujutsu is definitely the best option if you want to actually get stuff done while mostly maintaining Git compatibility. Pijul is definitely still in the research prototype phase, and definitely not Git compatible. I don't know how Git compatible Sapling is, but large parts of it are still labelled "Not…

Pijul's "upstream" (and git predecessor) darcs is still useful today. It doesn't see itself as a "research prototype" and has decades of experience in the real world. It isn't git compatible but does offer a fine fast-export to git in the worst case you need to switch.

Unfortunately some of those decades of experience with darcs are lessons in how it performs poorly in large repos or with large teams/lots of merge conflicts, but that still leaves darcs a good experience for small projects and "just getting stuff done".

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

#50

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.

I have never really made bisect a part of my workflow, but something I believe would work well with just jj is making two workspaces before and after the issue, and iteratively walking their working revisions toward each other. That has the advantage of being able to run both versions simultaneously easily.
Post reply on HN