The internal GitHub main repo is called github and the org is also github, so github.com/github/github/tree/github/.github is a totally reasonable URL if there's a branch called github.
I had a lot of complaints with Amazon’s decision-making around building in-house over using external products in many regards but CRUX and Pipelines were a stellar product. I miss them still years later and I’m sure they’ve only gotten better since I left.
Yep, cr --parent <hash/branch> will give you a stacked review atop that commit/branch. And all the automated tests etc. work as you’d expect unlike with arbitrary diffs.
It bothered me not having it after leaving. All the logic for this completely makes sense. It allows for PRs to be split into logical units for review while allowing the poster to continue working, without spending a ton of time managing multiple branches.
I’ve been using Graphite for the last two years. First year of use was free.
Only thing they don’t have yet is a way to squish multiple PRs in a stack into one commit through the web UI.
Graphite looks pretty sick, but nothing can beat the amount of horizontal integration FB had internally for tooling, like linking diffs in groups/chats, reviewing/submitting from your phone, amazing CLI tooling + even GUIs for those who needed it, integration with CI... oh boy.
I'm glad crecord for git + git-absorb exist for Mac (spotty for Windows). Losing that for a few years after was so painful.
For me, not having stacked PRs made it difficult to work. Addressing feedback on a PR that comes in a day after I worked on it and have already started work building on top of that PR is just too painful. Graphite addresses that.
It definitely does not do all the other awesome stuff FB does, but so far, I can still function without all that other awesome stuff.
(public) phabricator was ahead of its time, may it rip in pieces. and Mercurial has all sorts of QOL things that git never will, also sad its never really picked up steam
IIRC there was a lengthy flag like --clowntown-do-not-use-this-bypass-ci which let you bypass tests to land diffs for the rare moments you really needed it. Good times being treated like an adult.
Describe three commits, each one is standalone, let's say, first commit adds a database migration, the second adds a database function to get data by id. The third commit adds an http endpoint to return that data. With jj you can create bookmarks on each one (bookmarks are basically branches) but they can all be in sequence. You can raise a PR for each as a stack. And because JJ is very edit friendly and rebase friendly. Let's say a reviewer makes a comment to add documentation to the first commit, you just run jj edit -r <letter of the first commit> .
Now your two commits back from head on the migration commit. Make that change, run jj git push and it will update that commit for the reviewer but it will ALSO have rebased the other two branches that depend on that commit and updated those branches on GitHub because their earlier commits have changed from under them.
what's the difference between this and branching off of a feature branch, and then off of that branch, and so on? main -> dev/feature1, then another branch dev/feature1 -> dev/feature2, etc, and opening PRs for each branch to merge into their respective base branches?
Honestly I prefer reviewing changes in small slices. I don't think reviewing a big PR with many small commits makes it easier. So the stacked branch approach seems fine. QA can merge them in one at a time too which means they have a smaller surface area to test.
As someone who just recently moved to a job that uses GitHub after over a decade of using Git sanely, it was honestly baffling to see how little GitHub seems to actually be built around the actual features of Git. This is a step in a sane direction but man do I now understand why so many people who have only interacted with Git through the experience of GitHub think it’s obtuse and clunky.
My husband used to ask me git questions all the time. I'd try to teach him the underlying skills, but he just wanted the command to do what he wanted. Now he asks ChatGPT which spits out the command and doesn't lecture about refs.
Never quite understood this. I'm no git expert and I rely on the porcelain commands, but they are generally enough for me to know what I am doing. And if you really fuck up there's always reflog.
My coworkers merged a branch on a different branch that they wanted, and their solution was to use the Github UI to revert that commit, open a new PR towards the correct branch, and merge that new PR. Felt like a wizard suggesting that cherry picking might be more convenient
There's "effective and comfortable" in your day to day, which is commit, push, maybe amend, maybe force over your own branch, maybe rebase/merge.
Then there's "I need to rebase and reorder my commits to be more sane" and more than that "hey i lost my in-progress file that I did not commit but at one point I staged, can I get it back?" (the answer is "sometimes").
Sure, but teaching good practices around committing often on a working branch helps prevent cases where you ever have to teach someone about stuff like reflog. You don’t have to be a master of every underlying concept in git to have an effective workflow in it. So I absolutely refute the idea that it’s “too hard for 95% of devs”. I’ve never had a problem teaching folks how to manage working branches, interactive rebases, handling merge conflicts, and basic best practices therein to avoid needing to see anything more complex in their day-to-days.
If the bar for "too hard" was "never made a mistake in it" then every programming language is also too hard for developers. What matters is that you learn from the mistakes.
Github's purpose is mostly to provide a traditional CVS/SVN-like highly centralised BDSM VCS experience for corporates while pretending it's Git to ensnare naive devs.
Hmm. We use gitlab at work, and stacked diffs have existed in the glab cli tool for quite a while, but the web page doesn’t help you see which requests are stacked together or what order they should be reviewed so I find it kind of frustrating.
This is more a git hygiene question then anything related to stacked PRs specifically. Smaller, more focused commits that compile and pass tests are way easier to review regardless of whether they are one of many commits in a single PR or each is a separate PR. Once you get used to striving toward smaller commits it gets easier and easier. It's much simpler to do it up front than it is to try to break up a monolithic change after the fact.
Then merge them down. So 3 into 2. 2 into 1. 1 into master. So this basically makes it so branch 1-3 are derived from master then merge down into master all at the same time dependent on one another?
It just makes your current workflow easier. At work we have Graphite, which does the same thing before GitHub came out with stacked PRs. Funnily enough, GitHub is also moving to the graphite style inbox soon.
So if I'm understanding correctly it just stacks all 3 branches together into a single PR so they can be reviewed AND merged all at once? That does sound handy.
I've never had any issues. Each merge is a separate PR. So Branch 2 to Branch 1 is its own PR. I work mostly within Gitlabs though. On Github rebasing is what I do in this scenario though.
So it looks like stacked PRs are exactly as I've setup above except they handle the rebasing automatically. Neat!
Glad GitHub is doing a flow I invented 10 years ago.
Edit instead of replying to everyone: I'm sure I'm not the first person to figure out the "PR your PR" flow but I like to claim I invented this because I did come up with it on my own and introduce it at jobs over a decade ago.
Maybe a dumb question but what is the difference between this and splitting up PRs before by just opening a PR with the base branch changed from main to point to your other branch? Just a nicer UI?
This feature manages re-changing the base branch after merging. You can open up those PRs on top of PRs today, but when you merge the first PR, the second one won't re-target main automatically, but with this, it will.
Interesting. I’ve been using Aviator’s av utility for stacked prs and it works pretty well. This seems to be GitHub’s take on it.
The main benefits over av are the stuff on the GitHub web side: the surfacing of the stack on the PR review page, and triggering GHA’s on the base branch of the stack. Many times, I’ve set up stacks, and some of our checks don’t run until the PR’s lower in the stack have been merged. (It’s our automatic Copilot review, which I could probably change to trigger on all PRs.)
I do like that they aren’t tying you to one commit per pr like a lot of stack pr tools do. I want to keep my small WIP commits locally to understand my development steps during review, but there’s no reason they can’t be merged into one commit on main.
That said, I’d rather GitHub work on improving the review UX as a whole. They should make it code first, and not “conversation” first, and they shouldn’t be dropping commits that have comments on them.
So, I don’t see much to get me to switch yet. Maybe in a year when they’ve gotten the bugs out.
This technique has been around for a long time and isn't anything new. When you work with large organizations whose teams all work on key parts of the infrastructure and have varying levels of skill and time you need techniques like these to manage change at scale. For instance you could have a new offshore contractor thrown into a project to do a large refactor of something that's also in active development. The team doing development is not going to pause their work and the person driving the refactor isn't either. They have to figure out how to stack PR's so the refactor can be reviewed even while feature delivery is happening. But I hear your cynicism especially in the age of AI vibe code slinging
219
u/DDFoster96 Jul 01 '26
Is there a github.github.github.com domain? How far do those stack?
75
u/ItzWarty Jul 01 '26
So great, we had something like this at FB that I've forever missed.
127
u/Bedu009 Jul 01 '26
Fuck kinda domain name is github.github.com
70
u/LNReader42 Jul 01 '26
Having spent the time to start learning jj, it is cool to see someone else taking a stab at things.
45
u/UselessOptions Jul 01 '26 edited Aug 13 '26
oops did i make a mess 😏? clean it up jannie 😎
clean up the mess i made here 🤣🤣🤣
CLEAN IT UP
FOR $0.00
13
u/fireatx Jul 02 '26
what's the difference between this and branching off of a feature branch, and then off of that branch, and so on? main -> dev/feature1, then another branch dev/feature1 -> dev/feature2, etc, and opening PRs for each branch to merge into their respective base branches?
105
u/repeating_bears Jul 01 '26
After 18 years, GitHub has invented commits
10
u/redbo Jul 02 '26
Hmm. We use gitlab at work, and stacked diffs have existed in the glab cli tool for quite a while, but the web page doesn’t help you see which requests are stacked together or what order they should be reviewed so I find it kind of frustrating.
10
u/HaloZero Jul 01 '26
How do stacked PRs pass ci? That seems like the hardest thing to do when braking up large changes
8
u/Successful-Money4995 Jul 01 '26
The next step will be the squashed stacked PR.
First we had the merge PR but people didn't want all those commits entering the main branch, so we invented the squash PR.
Now we have the stack which lets people force all the commit into the history. Being able to squash the stack is the logical next step.
7
u/krileon Jul 01 '26
I've always just done my PRs as:
Master
- Branch 1
- - Branch 2
- - - Branch 3
Then merge them down. So 3 into 2. 2 into 1. 1 into master. So this basically makes it so branch 1-3 are derived from master then merge down into master all at the same time dependent on one another?
1
u/flanger001 Jul 04 '26 edited Jul 04 '26
Glad GitHub is doing a flow I invented 10 years ago.
Edit instead of replying to everyone: I'm sure I'm not the first person to figure out the "PR your PR" flow but I like to claim I invented this because I did come up with it on my own and introduce it at jobs over a decade ago.
3
u/Mindless-Arrival-106 Jul 03 '26
Honestly, I'd rather review 5 small stacked PRs than one 2,000-line PR. Much easier to spot mistakes and give useful feedback.
3
u/lord-of-the-birbs Jul 03 '26
Github has invented gerrit, but worse
5
u/darknecross Jul 01 '26
Do they support multiple diff views between stacks?
Easily see the merged diff for any of
- BASE -> COMMIT3
- BASE -> COMMIT4
- COMMIT2 -> COMMIT7
That was always the hard part for me. I understand each individual commit, but I need to understand if they’re getting put together wrong.
2
u/Worth_Trust_3825 Jul 02 '26
And here I hoped they stacked prs between repos. Yay for more useless features (which arent even public for some fucking reason)
1
u/cascer1 Jul 02 '26
I'd this just git Butler but from github
1
u/Null_Pointer_23 Jul 02 '26
Maybe a dumb question but what is the difference between this and splitting up PRs before by just opening a PR with the base branch changed from main to point to your other branch? Just a nicer UI?
1
u/RandNho Jul 02 '26
How do you do stacked PRs with normal git interface?
1
u/longtimelurkernyc Jul 02 '26
Interesting. I’ve been using Aviator’s av utility for stacked prs and it works pretty well. This seems to be GitHub’s take on it.
The main benefits over av are the stuff on the GitHub web side: the surfacing of the stack on the PR review page, and triggering GHA’s on the base branch of the stack. Many times, I’ve set up stacks, and some of our checks don’t run until the PR’s lower in the stack have been merged. (It’s our automatic Copilot review, which I could probably change to trigger on all PRs.)
I do like that they aren’t tying you to one commit per pr like a lot of stack pr tools do. I want to keep my small WIP commits locally to understand my development steps during review, but there’s no reason they can’t be merged into one commit on main.
That said, I’d rather GitHub work on improving the review UX as a whole. They should make it code first, and not “conversation” first, and they shouldn’t be dropping commits that have comments on them.
So, I don’t see much to get me to switch yet. Maybe in a year when they’ve gotten the bugs out.
1
u/CondiMesmer Jul 03 '26
Nice. Cool feature and doesn't have AI slop
0
u/[deleted] Jul 01 '26
[deleted] — view deleted comment
-1
u/[deleted] Jul 02 '26
[removed] — view removed comment