Skip to content

Commit 4515c86

Browse files
LemmingAvalanchegitster
authored andcommitted
doc: interpret-trailers: document comment line treatment
Comment lines have always been ignored but this is not documented. The primary motivation here is to be reasonably complete in the documentation of how trailers are parsed; this is after all the only documentation page that documents this format. However, and going beyond that point, we could imagine that someone would want to use this format outside a commit (or tag) message context, like say in Git notes. On the other hand, it seems far-fetched that someone would be caught off guard by this considering that comment characters/strings are not likely to be alphanumeric,[1] which would mean that these comment lines would be treated as non-trailer lines if they were *not* detected and removed as comment lines. † 1: A notable exception is that Jujutsu VCS uses `JJ:` as the comment string Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent cb65736 commit 4515c86

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

‎Documentation/git-interpret-trailers.adoc‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,16 @@ key: This is a very long value, with spaces and
117117
newlines in it.
118118
------------------------------------------------
119119

120+
OTHER RULES
121+
-----------
122+
123+
What was covered in the previous section are the rules that are relevant
124+
for regular use. The following points are included for completeness.
125+
126+
This command ignores comment lines (see `core.commentString` in
127+
linkgit:git-config[1]). This is for use with the `prepare-commit-msg`
128+
and `commit-msg` hooks.
129+
120130
OPTIONS
121131
-------
122132
`--in-place`::

0 commit comments

Comments
 (0)