Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected behavior for commit messages with lines with the # character #3046

Closed
1 of 4 tasks
cesaralbloz opened this issue Feb 24, 2022 · 6 comments
Closed
1 of 4 tasks
Labels

Comments

@cesaralbloz
Copy link

Commit message lines that have the '#' are being interpreted as part of the commit footer
instead of commit body even when the previous line is not a empty line

Expected Behavior

Lines in the middle of a paragraph with the # character (it can be part of a URL) will be analyzed as
part of commit body instead of commit footer

Current Behavior

Lines with the '#' caracter are parsed as footer lines of the commit

Affected packages

  • cli
  • core
  • prompt
  • config-angular

Possible Solution

Clarify the '#' usage and/or enhance the parsing of that lines

Steps to Reproduce (for bugs)

Create a git commit message that uses the '#' caracter in the body message

Context

Recomend to the user not included the '#' in the commit message body

Your Environment

git version 2.32.0
node version v14.19.0
commitlint/cli version 16.2.1

@escapedcat
Copy link
Member

Thanks, can you post an example commit?

@cesaralbloz
Copy link
Author

cesaralbloz commented Feb 25, 2022

Parent:     ada13f02 (style: adapt repo to repo-homogenization-proposal)
Author:     Pepito Grillo (pegrillo) <pepito.grillo@pinoccio.com>
AuthorDate: 2022-02-22 13:49:17 +0100
Commit:     Pepito Grillo (pegrillo) <pepito.grillo@pinoccio.com>
CommitDate: 2022-02-22 16:10:20 +0100

fix: change output of the istio sidecar inject template

This is because some other templates need that the affected template
returns just "true" or "false" in order to decide further actions.
For example:

**https://gerrit.pinoccio.com/plugins/gitiles/policy/kvdb-supervisor/+/0.3.40/helm/eric-pcf-kvdbsupervisor/templates/_helpers.tpl#113**

Jira: https://eteamproject.internal.pinoccio.com/browse/SAPC-203470

Change-Id: I0395cadd725baae1ff02eca4430361251cfb4e7d

The error independently happens if the line with the '#' is an URL or not. With the following commit also happens

Parent:     ada13f02 (style: adapt repo to repo-homogenization-proposal)
Author:     Pepito Grillo (pegrillo) <pepito.grillo@pinoccio.com>
AuthorDate: 2022-02-22 13:49:17 +0100
Commit:     Pepito Grillo (pegrillo) <pepito.grillo@pinoccio.com>
CommitDate: 2022-02-22 16:10:20 +0100

fix: change output of the istio sidecar inject template

This is because some other templates need that the affected template
returns just "true" or "false" in order to decide further actions.
For example:

**1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567891234567890#113**

Jira: https://eteamproject.internal.pinoccio.com/browse/SAPC-203470

Change-Id: I0395cadd725baae1ff02eca4430361251cfb4e7d

The same line without the '#' the line is identified as body (An similar error happens but about the body line length that is an current bug of the tool

@escapedcat escapedcat added the bug label Feb 25, 2022
@escapedcat
Copy link
Member

Thanks, added some formatting.

@melink14
Copy link

Want to flag that this is pretty surprising since it was unclear what exactly was causing the random footer based errors so I tried several things before Googling and getting to this bug.

@melink14
Copy link

Ah, I realized I had interacted with this before. This bug should be the same as #896

@escapedcat
Copy link
Member

Thanks @melink14 , closing this as its duplicates #896

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

3 participants