Skip to content

utils / command

Write a PR description

Writes a PR description from the branch's real diff, for the reviewer; --apply writes it to the PR with gh

❯ /utils:generate-pr-description [--base <branch>] [--apply] [--pr <number>]

Reads the branch's real diff and writes the PR description for the reviewer, not for the author. The bar: the reviewer understands what changed, where to look first, and can test it by hand without asking anything.

Parameters

With no flag it prints the description in the chat and changes nothing.

Parameter What it does
--base <branch> Base of the comparison. Defaults to develop when origin/develop exists, else the default branch.
--apply Write the description to the branch's open PR with gh pr edit. It shows the text and asks first, since this replaces the current body.
--pr <number> The PR --apply writes to, when the branch has more than one.
/utils:generate-pr-description                  # print it in the chat
/utils:generate-pr-description --base main      # compare against main
/utils:generate-pr-description --apply          # write it to the open PR
/utils:generate-pr-description --apply --pr 42  # write it to PR 42

View source on GitHub