The way github does PRs is great for open source projects where you have submissions from a very diverse set of developers. You need to evaluate the whole PR as whole and accept it or reject it.
But it is not ideal where you have a small team working on single product. The PR review becomes a gate and it has been my experience as a developer that you spend a LOT of time trying to get your PR reviewed.
My preferred approach is to do smaller and more frequent commits that are merged directly to the main branch. Developers learn to break a problem into very small changes which is a skill by itself. It is the responsibility of a lead or Sr engineer to check the commits as they come so they can provide feedback as soon as possible. This was the spirit of the original continuous integration ideas back in the day.
Basically, I agree with you that large PRs are a problem, I just don't think it means you need to throw pre-land code review out the window.
But yeah, if the team lead is aware of what everyone is working on, and prioritizes fast CLs review, huge amounts of friction and slowdown are removed from the process
Why would I want to build on changes that haven't been reviewed and accepted? That's a good way to waste my time having to redo something because the foundation it was based on was flawed and got rejected later.
There's a reason git and most accepted development workflows are linear.
So I branch of a previous PR instead of development when the changes are related, and continue development, and rebase after the previous PR has been merged.
Usually this leads to less rework and fewer merge conflicts.
Very occasionally it means having to rework subsequent work because the approach was actually wrong, but I'll take that over the hassle of continuing to work from a base I know is already outdated.
There are so many times where I want to create 3-4 Merge requests that all build on each other along the same branch instead of creating one giant MR but the UI for reviewing them doesn't really work that way.
Stacked diffs just let you review one commit at a time, rather than requiring a full review of the entire thing, while still letting you see that these changes are related, so you can go look at the full context if you'd like.
This lets you do things like "hey, backend person, please review this backend commit, frontend person, please review this frontend commit" instead of "both of you review this full PR". This can save the frontend person time if, for example, the frontend code passes review, but the backend reviewer hasn't had time to review the backend changes yet. They won't be pinged by the other review.
Also, I don’t have time to wait around for a review to work on other parts of the same codebase.
I haven't signed up, but I'm not convinced the stacked PR's is a good route. This is mostly because I'm thinking about it in terms of how I work now, so maybe after a trial run I would see it differently. My experience with launching software is people don't want to change their workflows.
So the way I imagine how this would get used by real accounts is they will still review individual PR's and merge them in like normal and avoid doing stacked PR's because a lot of us mostly care about the final result and less about the how you got there.
That is until we need to understand the how lol So being able to visualize this is probably a very useful tool for retroactive inspection over being part of the PR review workflow.
I hope the author doesn't feel like I'm dunking on them, I really love the idea of re-thinking PR.
I also appreciate the ordering. In my projects, we put an extra focus on tests by having having a commit that adds new tests to reproduce the bad behavior so when you diff the tests with the fix commit, you get a visual of how things changed.
I also find that the order can be PR specific. I wonder about allowing the contributor or reviewrs reorder on per-PR basis.
There are also times we have a lot of test or doc changes. I wonder about grouping items to jump between or collapsing to more easily navigate around than opening and browsing a file picker.
Though if it can just make stacked PRs widespread, I'd already be very happy.
Maybe this tool would help, but nothing in this pitch convinces me.
(This is a genuine question, I think local first review is very interesting, but at some point, you've gotta send that feedback to the person you're reviewing.)
To the OP: JS is for enhancements. If you are using it in such a way that it becomes a potential blocker for all of the content then you are not going to reach the audience that you otherwise would. If you are on somebody else's platform/framework then by all means pass this up the chain.
https://pagespeed.web.dev/analysis/https-lubeno-dev-blog-rei...
[0] https://ersc.io/
That said, we haven’t talked a ton publicly about what exactly we’re building yet, because we’re very focused on building it. But if you or anyone else is dealing with pain around source control management, I’d love to hear about it: steve@ersc.io
This would be especially helpful for mobile, where reading a traditional diff is basically impossible.
Right now there are effectively three ways to do a PR:
- a bunch of small commits, some of them related to the feature, some fixes, some mixing both -> a PR with 'n' commits -> they don't really make sense as atomic commits, you have to review the entire PR to make the sense of it
- a squashed PR
- some uber principled reorganisation of commits that separates key implementation concerns into smaller commits (effectively stacked PRs but clean)
The last option would be desirable but it's unreasonable to expect anyone to do it by hand. So this is where <maybe> an LLM could parse my garbage intermediate commits, the final diff and generate a stack instead?
As a fellow rebase enjoyer, I will do it occasionally for smaller PRs but to me, it becomes unwieldy for large ones.
Do you have any tips or aliases that makes it more workable?
You don’t have to do it this way, you could use the oplog to undo it all if it’s not to your satisfaction, but it’s much simpler than trying to edit the commits into the right shape directly.
I believe that the ideas in the blog post are novel enough and should spark curiosity and interesting discussions. Also I submitted this last week, someone must have hand-picked and given it another chance because it's a good fit for HN.
Thanks for disclosing the financial conflict of interest, but this doesn't change the self-promotion factor.
I've got some wheels spare, care to have some?
Take a look at `git rebase --interactive`.
https://lubeno.dev/assets/images/blog/lubeno-repository.png
https://lubeno.dev/assets/images/blog/lubeno-pr.png
https://lubeno.dev/assets/images/blog/code-review-before-aft...
The file priority thing is a great idea too. That would be even more useful for search. The number of times I'm searching for something on Github and it just shows me a gazillion tests.... Yeah you can look up their advanced search syntax and exclude them probably, but it's always a hassle.
(this was a follow-up to the initial announcement months ago, also made via X)
The workflow just makes it a pain, since you have to manually rebase in both the branch and the UI after the original PR merges.