Skip to content

Commit 0401a94

Browse files
[TASK] Add info for long links in commitmsg and add refs (#361)
* [TASK] Add info for long links in commitmsg and add refs The quickstart guide was missing a pointer to proper formatting of the commit message. Also, the section on the commit message is now enhanced to describe when and how long lines are allowed, with examples for hyperlinks. * [TASK] Make commit message complete with Resolves/Releases/Change-ID * [BUGFIX] Fix commit message appendix
1 parent b834bd1 commit 0401a94

File tree

4 files changed

+40
-1
lines changed

4 files changed

+40
-1
lines changed

Documentation/Appendix/CommitHook.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ a Change-Id on your own, the result will be chaos.
3636

3737
Apart from that the hook will check your commit message for logical errors like missing keywords, Resolves lines etc.
3838
For detailed information on the format of a commit message, :ref:`click here <commitmessage>`.
39+
This also describes cases in which you might exceed the line length of 72 characters (hyperlinks).
3940

4041
If the commit-msg hook finds errors in your commit-msg, you can try again, by amending to the commit::
4142

Documentation/Appendix/CommitMessage.rst

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,42 @@ Here you can go into detail about the how and why of the change. It should be br
170170

171171
- Wrap the lines after 72 characters manually
172172

173+
.. _commitmessage-links:
174+
Inserting links / long lines
175+
----------------------------
176+
177+
Sometimes you must insert long links that exceed the line length of 72 characters.
178+
179+
In that case, it is ok to have these long lines - because inserting linebreaks
180+
would make the link invalid. You can ignore warnings of possible CGL checks,
181+
or (temporarily) disable your GIT commit hook check for this specific warning.
182+
183+
It is best practice to use placeholders for links and then group used links
184+
at the end in your commit message, like this:
185+
186+
.. code-block:: none
187+
188+
[BUGFIX] Link some long links
189+
190+
In [1] is is documented, that something is not wrong. But
191+
in reality [2] properly indicates, this is indeed right.
192+
193+
So we follow the advice of [3][4] and make things better.
194+
195+
[1] https://example.com/a/very/very/long-link/because/it/is/really-needed-I-mean-it-its-long-but-okay
196+
[2] https://example.com/this/is/short/but/also/nice
197+
[3] https://example.com/snafu
198+
[4] https://example.com/mostlyharmless
199+
200+
Resolves: #12346
201+
Related: #12340
202+
Releases: main, 12.4
203+
Change-Id: I<some string generated by the git commit-msg hook>
204+
205+
This is no specifically parsed syntax, the `[number]` formatting is
206+
just common plaintext formatting.
207+
208+
173209
Relationships
174210
-------------
175211

Documentation/CheatSheets/Git.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ Other keywords:
235235
236236
* subject < 52 chars (if possible, otherwise <= 72)
237237
* other lines <= 72 chars
238-
238+
* hyperlinks with > 72 chars are allowed when required (:ref:`<commitmessage-links>`)
239239

240240
Workflow - Undoing / fixing things
241241
==================================

Documentation/Quickstart/6-Patch.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,8 @@ Now with this example in mind, we have two modified files that we want to commit
119119
Releases: main
120120
121121
Close your editor with saving the commit message.
122+
For proper formatting and wording of a commit message, please read the
123+
details in :ref:`commitmessage`.
122124
123125
5. Push to Git repository
124126

0 commit comments

Comments
 (0)