• Clean / clear messages (what & how) • Bigger feature – more commit messages, feature # from issue tracker • Small stuff – renames & so on, non-functional stuff – can have „symbolic messages“ • The history is the most important! • The reviewer of a PR should also inspect commit messages to be clean
[optional body] [optional footer(s)] fix: prevent racing of requests Introduce a request id and a reference to latest request. Dismiss incoming responses other than from latest request. Remove timeouts which were used to mitigate the racing issue but are obsolete now. Reviewed-by: Z Refs: #123
if [ "$COMMIT_SOURCE" == "message" ] # allow `git commit -m "..."` to use the user supplied message then echo "Commit source is "message"" exit 0 fi if [ "$(head -1 "$COMMIT_MSG_FILE")" != "" ] # allow `git commit --amend` to use the existing commit message (do not replace it) then echo "The commit message is not the default one" exit 0 fi MSG=$(cat <<EOM <type>[optional scope]: <description> [optional body] [optional footer(s)] EOM ) test -f commit-msg.backup && MSG=$(cat commit-msg.backup) echo "$MSG" > "$COMMIT_MSG_FILE"
• Squash/rebase/amend – are just tools to get to a clean history • A PR can squash commits, but do it as part of the review process (not at the end) • This removes the need of asking „do we squash or not“ – this is the commiter‘s decision and also removes the need for a PR-task • ⚠⚠⚠ history manipulation should not be done on public/shared branches!
the last commit’s message and/or files $ vim file.cpp $ git add file.cpp $ git commit -m “…“ $ vim file.h $ git add file.h # or other source code modifications $ git log --stat $ git commit --amend $ git log --stat ⚠⚠⚠ history manipulation should not be done on public/shared branches!
in the context of a good PR • Write/review code (seriously?) • Write/review tests • Write/review docs • Write/ensure good commit messages in order to have “debuggable” and useful history