Open adrianlzt opened 5 months ago
Addressed in commit-it
, will be released with commit-me
before the end of the week.
Can we leave the issue open until the new release of commit-me
?
Of course, and if possible, I would love to get feedback once deployed before closing
CommitMe@v1.3.0 introduces behavior equal to git
when comparing commit messages fromString()
(i.e. when a message is passed via PreCommit hook or validation of Pull Requests).
In essence, any line starting with #
will be removed (read: not replaced by an empty line), as is according to git
specifications.
In your example;
foo: bar
# comment
this would lead to:
foo: bar
However, it is important to mention that the following example will be considered non-compliant with the Conventional Commit specification:
foo: bar
# comment
commit message subject
As it will translate to:
foo: bar
commit message subject
which does not provide an empty line between subject and body;
A longer commit body MAY be provided after the short description, providing additional contextual information about the code changes. The body MUST begin one blank line after the description.
Let me know if this is satisfactory @adrianlzt
That will work with git in verbose mode?
Verbose mode add lines at the end not prefixed with '#', but are ignored in the commit message.
Out of curiosity, any particular (practical) use case that you are thinking of @adrianlzt ?
I always use "git commit -v" (in fact, I have it configured in ~/.gitconfig), so if it does not know how to ignore those diff lines, they linter will surely not pass.
Any update on this?
I think comments (lines starting with
#
) should be ignored by the parser.