DEV Community

Ziad Taha
Ziad Taha

Posted on AI-assisted

What a one-line pull request description needs: four real examples

A pull request description can be one sentence. Four of mine were merged into NestJS repositories on the same morning, and each description was one or two lines. Here is what those lines did, so you can borrow the pattern.

The four descriptions

nest-cli #3735 (+1 -1): "Fixes the typo 'formated' to 'formatted' in the JSDoc of lib/utils/formatting.ts. Comment-only change."

sequelize #2240 (+3 -3): "Fixes the misspelling 'Repostiory' (twice) in the JSDoc comment in lib/common/sequelize.utils.ts. Comment-only change."

config #2507 (+2 -2): "Fixes two typos in comments in tests/src/app.module.ts: 'runnnig' to 'running' and 'bellow' to 'below'. Comment-only change, no behavior change."

swagger #4328 (+2 -2): "Renames the misspelled rest parameter respones to responses in DocumentBuilder.addGlobalResponse. It is a local parameter name, so there is no change to the public API or behavior."

What each one answers

A reviewer opens a PR with three questions: what changed, where, and what could break.

  • What: the exact wrong word and the exact right word.
  • Where: the file path, or the function name.
  • What could break: a clear statement. "Comment-only" settles it for three of them. The swagger one needed more, because a rename touches code, so the description says why the public API is unaffected.

A template you can reuse

  1. Say what you changed, with the before and after.
  2. Name the file or function.
  3. Say what does not change, if the diff could make a reader wonder.

If you cannot write step 3 with confidence, check first. Is the name exported? Is it in the docs? Does a test import it? Answer that before you open the PR.

Why this matters for a first contribution

A small PR with a precise description is quick to review, and a quick review is more likely to end in a merge. All four of these were merged within about 14 hours of being opened.

What is the shortest PR description you have seen that still said everything it needed to?

Top comments (0)