DEV Community

Sh Raj
Sh Raj

Posted on

6 Merged Patches Later: How to Get Your First PR Accepted in a Big Open-Source Repo

I am a computer science student with no industry connections. So far I have had six patches merged upstream: a cancellation fix in Google's gemini-cli, three fixes in MoFA's Rust crates, a types fix in Preact, and an inline-toolbar fix in Editor.js — with fourteen more in review. None of that happened by luck. The process is learnable, and it is mostly about making the reviewer's job easy.

1. Reproduce first, always

Every one of my merged PRs started from a failing case I could reproduce. Not a vague idea — a concrete sequence that shows the bug happening. If you cannot reproduce it, you do not understand it yet, and your fix will be a guess. Write the reproduction down; it becomes the first paragraph of your PR description, and it is the thing that makes a maintainer take the report seriously.

My gemini-cli fix started exactly this way: cancel a turn mid-compression, observe the request continuing. The MoFA fix started with a bad cron schedule string panicking on unwrap(). Reproduction first, fix second.

2. Pick small, scoped bugs

Your first PR should not be a refactor. It should be a bug a maintainer can understand in one minute and a diff they can approve in five. The categories that work:

  • Edge cases — a function that panics on input it should reject with an error.
  • Type fixes — a valid attribute the types do not allow (my Preact fix).
  • UI logic — showing an option that cannot apply, like a "Convert to" menu with nothing to convert to (my Editor.js fix).
  • API hygiene — marking public enums non-exhaustive so future variants do not break downstream code (two of my MoFA fixes).

Small diffs get reviewed. Large diffs get deferred.

3. Read the code around the bug, not the whole repo

Nobody reads a large codebase cover to cover. Pick the value or the function at the centre of the bug and follow it. In gemini-cli I followed one AbortSignal from turn creation to the call that never received it. In MoFA I followed one schedule string into the parser. Following one thing end to end beats reading every file, and it gets you to the fix faster than any amount of skimming.

4. Write the PR for the reviewer

A maintainer triaging dozens of PRs decides in seconds. Make those seconds count:

  • Title in the repo's convention — usually Conventional Commits: fix(core): thread AbortSignal to chat compression requests.
  • What, why, and how to verify — the bug, the reproduction, the change, the test. In that order.
  • Tests with the fix. A test that fails before your change and passes after is the strongest argument a PR can make.
  • No drive-by changes. Do not reformat unrelated files or fix three things at once. One PR, one change.

5. Respond to review instead of defending the draft

Review feedback is not an attack on your code; it is a maintainer spending their time to get your change mergeable. The fastest path to merged is to take the feedback seriously, ask when something is unclear, and push the revision promptly. The PRs that stall are the ones where the author argues or disappears.

Where to look

Start with software you already use — you understand its bugs better than a stranger's project. Then: good first issue labels, your dependencies' issue trackers, and bugs you hit while building your own projects. The best first issue is one you found yourself, because you already have the reproduction.

Six merged patches is not a large number. But each one taught the same lesson: maintainers merge work that is reproduced, scoped, tested, and easy to review. Do that consistently, and the merges follow.

Top comments (0)