Lines Matching +full:commit +full:- +full:message
1 .. _docs-pw-style-commit-message:
4 Commit message style
6 Pigweed commit message bodies and summaries are limited to 72 characters wide to
8 commit is affecting. The commits should describe what is changed, and why. When
9 writing long commit messages, consider whether the content should go in the
12 .. code-block:: none
17 description of why the change is needed. Consider what parts of the commit
18 message are better suited for documentation or code.
20 - Added foo, to fix issue bar
21 - Improved speed of qux
22 - Refactored and extended qux's test suite
24 -----------------------------
26 -----------------------------
28 evident - for example, reducing memory usage, optimizing, or fixing a bug.
29 Otherwise, err on the side of over-explaining why, not under-explaining why.
31 When adding the "why" to a commit, also consider if that "why" content should go
34 .. admonition:: **Yes**: Reasoning in commit message
37 .. code-block:: none
49 .. code-block:: none
55 ------------------
57 ------------------
63 .. code-block:: none
67 This commit correctly uses imperative present-tense style.
69 .. admonition:: **No**: Uses non-imperative style for subject and text.
72 .. code-block:: none
76 Use present tense imperative style for subjects and commit. The above
79 ---------------------------------------
80 Documentation instead of commit content
81 ---------------------------------------
82 Consider whether any of the commit message content should go in the
83 documentation or code comments and have the commit message reference it.
84 Documentation and code comments are durable and discoverable; commit messages
90 .. code-block:: none
98 .. admonition:: **No**: Important content only in commit message
101 .. code-block:: none
110 ---------------------------
112 ---------------------------
119 .. code-block:: none
121 pw_complicated_module: Pre-work for refactor
127 - Add arguments to MyImportantClass::MyFunction
128 - Update MyImportantClass to handle precondition Y
129 - Add stub functions to be used during the transition
134 .. code-block:: none
138 This CL does A, B, and C. The commit message is a Big Wall Of Text
143 ------------
145 ------------
146 The subject line (first line of the commit) should take the form ``pw_<module>:
150 .. admonition:: **No**: Uses a non-standard ``[]`` to indicate module:
153 .. code-block:: none
160 .. code-block:: none
167 .. code-block:: none
175 #. **2-5 modules**: Use ``{}`` syntax shown below
176 #. **>5 modules changed** - Omit the module names entirely
177 #. **Changes mostly in one module** - If the commit mostly changes the
184 .. code-block:: none
194 .. code-block:: none
203 .. code-block:: none
209 Non-standard modules
218 .. code-block:: none
227 case-sensitive symbol.
232 .. code-block:: none
242 .. code-block:: none
246 This commit message demonstrates the subject when the subject has an
253 .. code-block:: none
257 ------
259 ------
260 We support a number of `git footers`_ in the commit message, such as ``Bug:
261 123`` in the message below:
263 .. code-block:: none
270 <https://git-scm.com/docs/git-interpret-trailers>`_. Note in particular that
271 multi-line footers are supported:
273 .. code-block::none
282 * ``Bug``: Associates this commit with a bug (issue in our `bug tracker`_). The
286 .. code-block:: none
296 .. code-block:: none
307 documentation, not in the commit message. Use the ``Test`` field to attest
310 .. code-block:: none
321 …ooters: https://commondatastorage.googleapis.com/chrome-infra-docs/flat/depot_tools/docs/html/git-…