Looks like a nice project! Will try it out next week. In the meantime, I'll share my thoughts on jj in general, since I assume most readers here won't have tried jj.
I started using jj a few months ago. I had used Fig previously when I was at Google, but then spent over 2.5 years just using git, and using jj was like riding a bike. It's more or less exactly what I want it to be and I use it as much as I can.
That said, here are some of my pain points (despite all of which I do still prefer jj to git):
* No GitHub PR sync for stacks. Managing stacked diffs locally is great, but (a better version of) Sapling's PR syncing would be a huge value add. This is somewhat of a pain point for me directly, but even more so a weakness when I've tried to evangelize jj internally as a viable "stacked diff" solution (e.g. to be blessed by our eng tools team). Someone familiar and comfortable with Sapling (or just skeptical of jj) can easily point to this feature gap in a way that pretty much ends the conversation.
* I wish the native backend supported pushing/pulling changes. I want to be able to switch between working from my laptop and my workstation, and doing that through pushing to and pulling from GitHub is obviously lossy of jj history. Manually copying the .jj directory seems to work if I'm careful and do everything correctly (i.e. make sure both clones have equivalent working copy state when I copy .jj), but this feels brittle and it's easy to mess up.
* If you forget to start a new rev before you (or your LLM) touch the repo, it's a little bit of a pain to go back and split the changes into a new rev.
* Some of the more mature repos I've worked with have tooling/scripts/tests/etc. that seem to look for or rely on the presence of .git (perhaps indirectly). Perhaps I could have gotten around this with colocated repos (i.e. `git clone` and then `jj git init --colocate`), but in at least one case I just gave up on using jj for a given repo and just made a separate git clone. I'm not sure this is really jj's fault so much as a practical compatibility gap with git (again, possibly entirely solved by using `--colocate`).
You might be interested in tangled.sh, a Git forge that recently added support for stacked PRs with jj[1] (or anything that supports the Change-Id header i suppose)!
> No GitHub PR sync for stacks
FWIW, I think the fact that you need client support for this is a bizarre shortcoming of GitHub.
If GitHub just let you review individual commits like Gerrit does, the concept of "PR stacking" would be unnecessary (as it is with Gerrit).
The model of "a PR is just a blob of changes" is a weird baby's toy version of a code review tool IMO!
I highly recommend revup, it allows managing and uploading stacked (or arbitrary trees of) PRs to Github, including adding a comment that shows approximate revision-to-revision diffs if you want it to. I don't actually think that per-commit reviewing obviates the desire for stacked PRs, for example I often have some PRs in my stack that are not yet ready for review or merging.
GitHub does let you review individual commits, at least you can leave comments on them.
All we need is GitHub to support a `Depends on: #123` annotation which would hide commits already in #123 and not let you merge until #123 is merged.
> All we need is GitHub to support a `Depends on: #123` annotation which would hide commits already in #123 and not let you merge until #123 is merged.
You can get an approximation by having the PR target the branch used by #123.
This doesn't work across forks, though, and therefore doesn't compose with GitHub's model where you push your changes to your private fork and then open a PR from there.
There's also no native UI support for it in GitHub -- I'd expect to have a navigation element for stacked PRs like in Gerrit.
This means multiple stacked branches that you need to maintain on your own, doesn't it? That's the annoying part IMO, even when a short script would do or the rebases take a few characters in some efficient git UI.
You can review them but you can't look at the diff between them after they've been amended in response, so it's not actually a usable workflow.
IIUC the typical model is that people just upload new commits like "respond to review comments" and then eventually squash the whole PR into one commit when it's ready.
So basically you are just giving up on the idea that the commit history is part of the artifact you're working on.
You can review a PR commit by commit. But it's not obvious how in the UI. Navigate to the commits tab on the PR page and you can navigate through the commits in the PR and review them one by one. Although it's possible this isn't what you mean.
Github doesn’t understand that all commits can change for review purposes. This is what makes it a ‘toy’ (though I prefer stronger wording here.)
Right, the problem is when I amended one of my patches there's no way for the reviewer to look at a diff between current and previous versions.
ADO handles this by showing a dropdown of 'comment left on update X, currently update Y' with a toggle to show the difference.
I ~hate how ADO handles individual commits (comment left on a single commit is hidden), but I do like the update tracking on a PR as it allows cleaning up the commit tree seamlessly without losing history or comment traceability (less you remove/move files).
Indeed. I wrote a tool for myself to help with that in my reviews: https://github.com/nhaehnle/vctools/tree/main/diff-modulo-ba...
It admittedly doesn't have a lot of polish, but I do use it regularly and I'd be happy to help anybody who is interested in using it.
Yes, I agree, much of the blame lies with GitHub -- but realistically, GitHub isn't going to change to accommodate tools like jj.
Yeah but I just wanted to highlight that a better world exists! People should know that GitHub's toy model isn't the only one available.
Still, you're right that it makes sense to build tools to work around GitHub since there's always gonna be cases where you can't avoid using it.
Yeah, effectively all my programming is at my job, where we use GH Enterprise, so I don't really have a choice. I prefer Gerrit but not up to me.
> I wish the native backend supported pushing/pulling changes.
0.29.0 is working towards support here. It's only the first step as far as I understand (not following too closely): https://github.com/jj-vcs/jj/releases/tag/v0.29.0 git.write-change-id-header
> If you forget to start a new rev before you (or your LLM) touch the repo, it's a little bit of a pain to go back and split the changes into a new rev.
This is my biggest pain point at the moment, yes. I think it could be partially solved by better documentation already. I contributed a bit in the past but haven't had the time to look at this bit yet.
Thanks for the pointers to the progress in 0.29.0, and for your contributions. :)
> using jj was like riding a bike
This has been my experience as well! I haven't had success conveying that to my peers at work (or outside), but your comment resonates with me deeply.
> If you forget to start a new rev before you (or your LLM) touch the repo, it's a little bit of a pain to go back and split the changes into a new rev.
This is one area where I broke my Fig habits and just switched to a the [Squash workflow](https://steveklabnik.github.io/jujutsu-tutorial/real-world-w...): I basically forbid myself from use `jj edit` and have been pretty successful in getting that to stick in my brain. Instead, I use `jj new` to switch contexts (and then `jj commit`, `jj squash`, or `jj absorb` depending on what I'm trying to achieve).
> Some of the more mature repos I've worked with have tooling/scripts/tests/etc. that seem to look for or rely on the presence of .git (perhaps indirectly).
Yeah, I've noticed this too. I find that the most common root cause is usually something that wants to run a lint tool only against the files that you've changed so it does something to the effect of `git diff --name-only $(git merge-base HEAD origin/main)`. I've also noticed that some precommit hooks have been working better since I enabled the `git.subprocess` option (which is on by default as of recently, I believe).
I have more or less been using the squash workflow, but nevertheless, remembering to do `jj new` before doing anything else is a challenge. Might just get used to it with more time.
Hmm, maybe I'm missing something, but you can use the squash workflow so that you don't have to remember to start a new commit: you're always at an empty commit when you context switch to repo.
* If you `git clone ...` and then `jj git init --colocate`, you're in a new commit (whose parent is the HEAD of the git repo).
* If you write some code and then `jj commit`, you're now in a new commit.
* If you want to work on top of commit zyx instead, you can run `jj new zyx` (not `jj edit zyx && jj new`).
* If you're done for the day, you can `jj commit -m "temp: it kinda works, I'll take another stab tomorrow"` and you're on a new commit again.
In many ways, this reflects the normal git workflow (if you want something checkpointed, you've "commit"ed it). This does mean that while I'm in the middle of working on something, I have some commits that aren't split by logic but by chronology. So instead of one commit ("make foo"), I'll have three commits ("try to make foo", "eh, didn't work, try again", "fix bar so that foo actually works now") that reflect my process rather than logic. Once I'm convinced that I finally did it right, jj makes it easy to squash/manipulate the commits into the logical units I want to present in my PR (or record in my history for personal projects).
`--colocate` is indeed working fine for me. The backend is then stored in a real `.git` directory instead of being hidden deep inside the `.jj` directory as a bare git repository. Python scripts that use pygit or tools like Conan can safely use that `.git` directory while you enjoy your jj workflow.
There might be some issues with jj workspaces though if you have the habit of using git worktrees as the colocated repo is not there anymore.
> No GitHub PR sync for stacks. Managing stacked diffs locally is great, but (a better version of) Sapling's PR syncing would be a huge value add. This is somewhat of a pain point for me directly, but even more so a weakness when I've tried to evangelize jj internally as a viable "stacked diff" solution (e.g. to be blessed by our eng tools team). Someone familiar and comfortable with Sapling (or just skeptical of jj) can easily point to this feature gap in a way that pretty much ends the conversation.
Can you explain this point in detail? I've been using jj and doing stacked PRs on GitLab using `jj git push --all`. I haven't used Sapling so I'm not familiar with it's way of doing stacked PR and I'm really just curious what do you miss from it.
Sapling has a way to manage multiple PRs, setting the target branch of each to its parent and adding information about the stack of PRs to each PR description.
What does this look like in practice?
It seems jj supports this workflow roughly as well as Sapling. If I have five PRs open with five feature bookmarks, changing an ancestor and pushing will update all PRs simultaneously. Github's PR view notices that the heads were updated and changes which commits are included in the review set.
Sapling shares the limitations of Github's review UI: reviews still include all changes (I think). The only nice bit is Sapling automatically submitting the PRs for you and adding the descriptive info?
As a nifty workaround, it looks like sapling recommends an external tool called reviewstack.dev to properly review its stacked PRs which show incorrectly by default on GitHub. So is there much difference?