Hacker News new | ask | show | jobs
by stouset 35 days ago
Very often when writing a new feature, I have to fix a bug in another subsystem (and write tests for it), add a small capability to another subsystem, fix documentation elsewhere, and so on.

Those could be separate commits in one PR, and that’s the way I’ve historically worked. But in jj it’s trivial to make them separate branches and continue working on the merge of all of them, even if they haven’t been merged upstream yet.

The benefit is that my coworkers have absolutely trivial PRs to review, rather than one omnibus. If there’s some debate about one of them, not only can we still make progress by merging the others, but I can continue plugging away on my main feature branch while we decide on the best path forward. If one of those PRs needed a bugfix or changes, fixing them typically m requires quite literally zero VCS shuffling to incorporate into the work downstream.

My pace of and ability to work on features is no longer bottlenecked by reviews. My coworkers no longer have to review giant PRs that touch seven subsystems. I don’t have to wait until an entire feature is finished before coworkers can start merging smaller preparatory bits for it.

You can do some of this stuff in git. But it’s excruciating and so nobody does it except in rare circumstances.

1 comments

But that means you haven't actually done anything with the PR, it is a hypothetical thing.

Hopefully you have perfect CI coverage since you didn't bother to compile your PR even.

This flatly isn’t true.

Each individual PR gets tested and merged the same way they would if you’d authored them one by one in the first place.

The combination is merged in your tree well in advance of a PR ever being made. When the ancestor PRs are merged, you just pull and your descendent merge commit is rebased automatically.

At no point are you pushing untested code that you wouldn’t have pushed in a similar git workflow.

I mean so it is identical to how I already do this...

If I am pushing a PR with a working combination and rebasing after upstream merges how is jj changing the flow?