AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Sourcetree rebase in progress1/15/2024 ![]() ![]() But commits reflect the developer’s perspective and, most of the time, aren’t a great way to help the reviewer understand the code unless the code author is very strict and skilled in making coherent, self-contained, and good-to-follow commits. Using the commits to review the code, the reviewer can follow our development process and also reviews smaller changes. ![]() So, if we open a pull request for this change, the only option the reviewer has is to use our commit history to review it in smaller chunks. And 400 lines are known to be an upper bound for the maximum amount of code review change size. Most likely, the change will comprise more than 400 lines of code. ![]() Working with feature branches.īut, as you can imagine, this is a rather large code change. We commit frequently, and after some time, we open a pull request comprising all our changes. Let’s say we start development on the feature branch. In fact, always if we have made too many changes (more than, say, 400 lines of code) and we want to easy the burden on the reviewers.īut back to the example. Note that stacked pull requests are also useful during trunk-based development. After we finish, we merge this work back into the main branch. This means that we branch off from the main branch to do our work in isolation on a dedicated feature branch. Let’s also imagine that, normally, we use a workflow based on feature branches for development. We want to add the functionality to add and delete items to and from a shopping card. Let’s start by imagining we are working on a new feature. Stacked code reviews work with most of the common tools that are built on Git and allow you to review code, like GitHub, GitLab, and Bitbucket. So, are you ready? Good! Let’s talk about stacked pull requests In return, reviewers have an easier time understanding the code under change and therefore give better feedback in a shorter time. This technique helps engineers split code changes into smaller and more coherent pieces. In this blog post, I will show you a technique, also referred to as stacked pull requests, that I teach in my code review workshops. Research confirms this: the more code to review, the less effective the review. However, this equation changes when the code change becomes too large. This way, the reviewers can easier follow the code and give better feedback.īut what exactly are stacked pull requests, why do we need them, and how do we create stacked pull requests?Ĭode reviews are hard but worth it. Stacked pull requests allow you to split large pull requests into smaller more digestible pieces. ![]()
0 Comments
Read More
Leave a Reply. |