···22atroot: true
33template:
44slug: stacking
55-title: jujutsu-style code review
55+title: jujutsu on tangled
66subtitle: tangled now supports jujutsu change-ids!
77date: 2025-06-02
88image: /static/img/hidden-ref.png
···2020as reviews are addressed. We set out to natively support
2121this model of code-review on Tangled.
22222323-If you're new to Tangled, [read our intro](/intro) for more
2424-about the project.
2323+Tangled is a new social-enabled Git collaboration platform,
2424+[read our intro](/intro) for more about the project.
25252626For starters, I would like to contrast the two schools of
2727code-review, the "diff-soup" model and the interdiff model.
28282929-## the diff soup model
2929+## the diff-soup model
30303131When you create a PR on traditional code forges (GitHub
3232specifically), the UX implicitly encourages you to address
···124124[a] some small refactor
125125```
126126127127-This is the most important part:
128128-129129-```
130130-Rebased 2 descendant commits onto updated working copy
131131-```
132132-133127Jujutsu automatically rebases the descendants without having
134128to lift a finger. Brilliant! You can repeat the same
135129exercise for all review comments, and effectively, your
136130PR will have evolved like so:
137131138132```
139139- a -> b -> c
133133+ a -> b -> c initial attempt
140134 | | |
141135 v v v
142142- a' -> b' -> c'
136136+ a' -> b' -> c' after first cycle of reviews
143137```
144138145139## the catch
···155149156150Jujutsu however, works around this by assigning stable
157151"change id"s to each change (which internally point to a git
158158-commit, if you use the git backing). If you edit an old
159159-commit, its SHA changes, but its change-id remains the same.
152152+commit, if you use the git backing). If you edit a commit,
153153+its SHA changes, but its change-id remains the same.
160154161155And this is the essence of our new stacked PRs feature!
162156···210204 <figcaption class="text-center">The "stack" is similar to Gerrit's relation chain</figcaption>
211205</figure>
212206213213-After a while, I receive a couple of review comments, but
214214-not on my entire submission, but rather, on each *individual
207207+After a while, I receive a couple of review comments, not on
208208+my entire submission, but rather, on each *individual
215209change*. Additionally, the reviewer is happy with my first
216210change, and has gone ahead and merged that:
217211···275269# hack, hack, hack
276270```
277271278278-We are done addressing reviews, let us push our code:
272272+We are done addressing reviews:
279273```
280274$ jj git push
281275Changes to push to origin:
···283277```
284278285279Upon resubmitting the PR for review, Tangled is able to
286286-accurately map every change in the resubmitted branch to its
287287-original PR, using jujutsu change-ids:
280280+accurately trace the commit across rewrites, using jujutsu
281281+change-ids, and map it to the corresponding PR:
288282289283<div class="flex justify-center items-start gap-2">
290284 <figure class="w-1/2 m-0 flex flex-col items-center">
static/img/review_difference.jpeg
This is a binary file and will not be displayed.
static/img/review_union.jpeg
This is a binary file and will not be displayed.
+3-1
templates/partials/footer.html
···11<div class="mt-16 px-6 py-4 bg-white dark:bg-gray-800 drop-shadow-sm rounded-t">
22 <p class="text-center">
33 <a class="font-bold italic no-underline hover:no-underline" href="https://tangled.sh">
44- tangled.sh
44+ tangled
55 </a>
66 is a new social-enabled Git collaboration platform built on top of the <a href="https://atproto.com/">AT Protocol</a>.
77 </p>
···1515 <a href="https://bsky.app/profile/tangled.sh">Bluesky</a>
1616 ·
1717 <a href="/blog/feed.xml">RSS</a>
1818+ ·
1919+ <a href="https://tangled.sh/@tangled.sh/core">Source</a>
1820 </div>
1921</div>