Lesson 5 of 9 · 26m
Branch, Commit, and Pull Request Craft
Create reviewable branches, meaningful commits, focused diffs, and pull request descriptions that reduce maintainer cognitive load.
Reviewers do not read your diff in the order you wrote it. They read it in the order their tools present it, while trying to infer intent, risk, and correctness. Good PR craft is therefore not decoration. It is interface design for another engineer's attention.
Build the branch like a single argument
Start from the correct base and keep the branch narrow:
git checkout main && git pull --ff-only && git checkout -b invite-revocation-fixCommit logical steps, not chronological confusion. A reviewer should be able to understand the sequence without excavating your false starts:
test: cover pending invitation revocation
fix: revoke pending invites when member is removedSmall commits are useful when they are coherent. Thirty commits named wip, fix, again, and oops are not honesty; they are noise. Follow repository convention. Some maintainers prefer squashed merges; others want carefully curated history.
Read your own diff before anyone else does
git diff main...HEADLook for generated files, lockfile churn, unrelated formatting, debug logs, commented-out code, accidental permission changes, and editor artifacts. If the diff surprises you, it will definitely surprise the reviewer.
The PR description is a decision document
A strong description answers four questions quickly:
## What
Revokes pending workspace invitations when the owning member is removed.
## Why
Removed members could still accept old invites because revocation only ran
for active memberships. Fixes #482.
## Evidence
- Added regression test: removed owner's invite cannot be accepted
- Existing invite lifecycle suite passes
- Manual check: invited email receives invalid-invite error after removal
## Risk / rollback
Touches invitation acceptance and member removal paths. No schema change.
Rollback is revert of this commit; no migration to reverse.Keep CI and review context current
Rebase or merge upstream according to project preference. Resolve conflicts deliberately; do not blindly accept "theirs" because the UI makes it easy. After pushing, read the rendered diff on the forge. Long lines, binary files, and hidden whitespace sometimes appear there even when local review looked clean.
Field notes
- Never force-push over shared review branches unless project convention allows it; rewriting review history makes comments hard to follow.
- Keep generated artifacts out unless the project commits them intentionally.
- Do not tag maintainers repeatedly because CI failed. Fix the failure or ask a specific question.
- "Tests pass" means you ran them. Say which command and which subset if not the full suite.
Was this lesson helpful?