|
| 1 | +--- |
| 2 | +# SPDX-FileCopyrightText: Copyright (c) 2014-2025 Yegor Bugayenko |
| 3 | +# SPDX-License-Identifier: MIT |
| 4 | + |
| 5 | +layout: post |
| 6 | +title: "Help Me, My PR Doesn't Merge!" |
| 7 | +date: 2025-11-09 |
| 8 | +place: Moscow, Russia |
| 9 | +tags: oss etiquette |
| 10 | +description: | |
| 11 | + When your pull request won’t merge, don't fight it—fail fast, |
| 12 | + split your changes, file bugs, and move on smarter. |
| 13 | +keywords: |
| 14 | + - merge conflict |
| 15 | + - pull request policy |
| 16 | + - discipline of pull requests |
| 17 | + - resolving conflicts |
| 18 | + - pull request |
| 19 | +image: /images/2025/11/amores-perros.jpg |
| 20 | +jb_picture: |
| 21 | + caption: Amores Perros (2000) by Alejandro González Iñárritu |
| 22 | +--- |
| 23 | + |
| 24 | +You've made a pull request, but it won't merge. |
| 25 | +A reviewer says it's not good or the tests don't pass. |
| 26 | +No matter what, you can't get it into the master branch. |
| 27 | +You keep fixing the branch, keep convincing the reviewer, keep hating the tests. |
| 28 | +Stop. |
| 29 | +Try smarter tactics. |
| 30 | + |
| 31 | +<!--more--> |
| 32 | + |
| 33 | +{% jb_picture_body %} |
| 34 | + |
| 35 | +## 1. Give Up Instantly |
| 36 | + |
| 37 | +First, [fail fast]. |
| 38 | +Give up quickly. |
| 39 | +If it doesn't go through smoothly, close it. |
| 40 | +If the reviewers' complaints are more than stylistic issues, your understanding of the architecture is flawed. |
| 41 | + |
| 42 | +Ask yourself, how did this happen? |
| 43 | +Why did you, a smart programmer, get a wrong understanding of the architecture? |
| 44 | +Obviously, it's [not your mistake]({% pst 2015/feb/2015-02-16-it-is-not-a-school %}). |
| 45 | +It's a bug in the repository. |
| 46 | +Its README isn't complete, its code isn't clean enough, its documentation is outdated. |
| 47 | + |
| 48 | +What do you do? |
| 49 | +You [blame]({% pst 2025/may/2025-05-25-bug-driven-development %}) them by submitting [bug reports]({% pst 2014/apr/2014-04-13-bugs-are-welcome %}). |
| 50 | +Then, when they fix the repository, you try again, with a new pull request. |
| 51 | + |
| 52 | +## 2. Take a Smaller Bite |
| 53 | + |
| 54 | +Most likely they don't complain about all the changes you've made. |
| 55 | +Something looks good to them, while they refuse to accept something else. |
| 56 | +Good, remove the bad parts from your pull request. |
| 57 | + |
| 58 | +Don't waste time trying to sell the entire package in one go. |
| 59 | +Instead, give them as much as they're ready to accept. |
| 60 | +In the end, you will merge a few pull requests instead of one. |
| 61 | +The more, the better, at least for us in [Zerocracy], where we [reward]({% pst 2018/jul/2018-07-24-bugs-or-pull-requests %}) each merged pull request. |
| 62 | + |
| 63 | +## 3. Blame Them Wisely |
| 64 | + |
| 65 | +This may be a defect in their existing codebase. |
| 66 | +Pretty often it is. |
| 67 | +Your code can't merge, not because it's broken, but because one of the existing tests is flaky. |
| 68 | +This is tricky and it may get ugly. |
| 69 | + |
| 70 | +Don't get negative or frustrated. |
| 71 | +You know that it's not your fault. |
| 72 | +But they don't. |
| 73 | +They believe that your code is defective and their code is perfect. |
| 74 | +Moreover, all CI workflows are [green]({% pst 2014/jul/2014-07-21-read-only-master-branch %}) on master, while your branch is red. |
| 75 | +Who do we [blame]({% pst 2025/apr/2025-04-19-dont-merge-into-broken-master %})? |
| 76 | +Obviously, you. |
| 77 | + |
| 78 | +You have to collect enough evidence and submit a bug report. |
| 79 | +It should explain what's wrong in their master branch. |
| 80 | +Don't ever mention your pull request. |
| 81 | +It's a trap! |
| 82 | +If you try to use your pull request as a proof of their mistakes, they won't listen. |
| 83 | + |
| 84 | +Forget about your pull request for a while. |
| 85 | +Submit a bug report as if you were a stranger who just found a bug in master. |
| 86 | + |
| 87 | +It may be hard, since master is green. |
| 88 | +However, there is no other way around it. |
| 89 | +Again, they won't listen if you blame them for the failure in your pull request. |
| 90 | +At best, they will explain to you the basics of continuous integration. |
| 91 | + |
| 92 | +## 4. Move On |
| 93 | + |
| 94 | +Just as poker fish (immature players) try to win every hand, junior developers try to merge every pull request. |
| 95 | +This is a mistake. |
| 96 | +Some problems simply can't be fixed and some features can't be implemented right now. |
| 97 | +There will be time for them later. |
| 98 | + |
| 99 | +It's perfectly all right to close a pull request after a negative review. |
| 100 | +There's no need to feel obliged to finish it. |
| 101 | +It's better to spend time on easier bugs to fix and simpler functionality to implement. |
| 102 | + |
| 103 | +## 5. Don't Call for Help |
| 104 | + |
| 105 | +No matter how hard it is, don't ask them to help you. |
| 106 | +"I can't understand why it doesn't merge!" |
| 107 | +Don't say this. |
| 108 | + |
| 109 | +They [may help]({% pst 2015/feb/2015-02-16-it-is-not-a-school %}), but it will be annoying for them. |
| 110 | +You won't look like a reliable programmer. |
| 111 | +The more you ask for help, the more you ruin your reputation. |
| 112 | +You must know how to solve issues on your own. |
| 113 | + |
| 114 | +A failed PR isn't a setback. |
| 115 | +It's a lesson. |
| 116 | +Fail fast, blame smart, and move on stronger. |
| 117 | + |
| 118 | +[fail fast]: https://en.wikipedia.org/wiki/Fail_fast |
| 119 | +[Zerocracy]: https://www.zerocracy.com |
0 commit comments