Explicit best practices for reviewing and commiting?
Created by: JoKeyser
Dear @freedombox/reviewers , I recently became a reviewer (thanks for your trust!), thus gaining commit-access, and was wondering what the expected practices are.
Of course I have some vague ideas (and made already a mistake in #962), but I would feel more confident if it was made explicit. My brief look into
git log shows several styles. I propose to write down a few "best practices" into the HACKING file (not calling it "rules" to prevent over-formalizing our collaboration, and leaving room for deviations, if necessary).
My initial guesses, to achieve keep the log understandable, succinct, and verifiable:
- If possible, commit messages should state
MODULE NAME: <insert what changed>. Multiple lines are allowed e.g. to indicate which issue is closed/fixed by it, or further aspects to the commit.
- Unless trivial (e.g. typo fixes), create a PR to get your work reviewed.
- Before committing a PR, add the line
Reviewed-by: REVIEWER NAME <REVIEWER EMAIL>to the commit message.
- If a PR contains unnecessary many commits, squash them into one beforehand.
- Sign your commits with gpg (thus avoid GitHub's buttons and do it locally, where your private key is).
- If you review another reviewer's PR, let him/her commit (to preserve gpg signatures).
- There are a few "Signed-off-by" messages in the log; what does that mean?
- Probably rebasing is necessary to avoid "useless" merge commits? (However this strips away gpg-signatures of the original author...)