multiline commits

Multiline Git commit messages are used to provide more context and detail beyond a short summary. They are particularly useful in collaborative projects and when changes are non-trivial.

Structure

Example 1: Prevent racing of requests

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

Example 2: Add retry logic to network requests

feat: add retry logic for network requests

Retries failed HTTP requests up to 3 times with exponential backoff.
Handles temporary network errors more gracefully.

Ref: #234
Reviewed-by: Alice <alice@example.com>

Example 3: Refactor authentication system

refactor: simplify authentication flow

The login process has been updated to use the new session management
API. This makes the code cleaner and more testable. Legacy token code
was removed.

BREAKING CHANGE: old `AuthToken` API is no longer supported.

Reviewed-by: Bob

Example 4: Fix crash on empty input

fix: crash when input is empty

Guarded against null or empty values in the parser, which previously
caused a segmentation fault under certain edge cases.

Fixes: #89

How to Write Multiline Commit Messages

You can write multiline commit messages using:

git commit
# Then your editor will open. Write subject, body, and footer there.

Or from the command line with -m used multiple times:

git commit -m "fix: crash when input is empty" \
          -m "Guarded against null or empty values..." \
          -m "Fixes: #89"

Tips


edit this page