question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

scope(conventional-commits-parser) git diff showing in body/footer

See original GitHub issue

When doing a git commit --verbose, conventional-commits-parser should strip out the git diff message in the bottom.

I noticed when working on this PR for https://github.com/marionebl/commitlint/pull/436, that the validation of {body,footer}-max-line-length was validating the git diff of the commit.

After reporting the bug to marionebl/commitlint, the author suggested the fix to be made on this package since commitlint delegates the parsing to that module.

I don’t know if you are already stripping out the comments from the message:

type(scope): header message

body

footer

# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
#
# Date:      <date>
#
# On branch <branch>
# Your branch is up to date with '<remote/branch>'.
#
# Changes to be committed:
#	<typeOfChange>[]:   file-changed
#
# ------------------------ >8 ------------------------
# Do not modify or remove the line above.
# Everything below it will be ignored.

If yes I would recommend before removing to remove everything after:

# ------------------------ >8 ------------------------
# Do not modify or remove the line above.
# Everything below it will be ignored.

If not then maybe diff --git a/

If any of my solutions I proposed are valid and ok, I can try to contribute with those changes on this repo.

Related issue: https://github.com/marionebl/commitlint/issues/437

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Fetzcommented, Oct 24, 2018

Hi 👋@byCedric, not on my end, I was waiting for some feedback from the collaborators of this repo but I didn’t get any feedback and is blocking my other PR

0reactions
subdiffcommented, Jun 4, 2020

On a side note: Could you double check this is still a problem on 3.0.8? Could not reproduce in this runkit: https://runkit.com/embed/437uu016o687

I just checked with conventional-commits-parser@3.0.8 and running commitlint --verbose -f origin/master gave me a warning (I configured body length to be warnings for now) for this commit message:

ci: block detached pipelines from merge requests

Counter-intuitively when there are jobs with rules a detached merge requeust
pipeline is created including every job that has rules.

It is necessary to block detached pipelines from merge requests to fight this
behavior. [1]

[1] https://docs.gitlab.com/ee/ci/yaml/#exclude-jobs-with-rules-from-certain-pipelines

I assume that this commit message has the same pattern as the problem described here.

Result:

⧗   input: ci: block detached pipelines from merge requests
⚠   body's lines must not be longer than 80 characters [body-max-line-length]

⚠   found 0 problems, 1 warnings

Checking back on it some more the warning is though also issued when running without the --verbose flag. So this might be a different issue.

EDIT: Coming back to this after some time I realize the last line of above commit message is not recognized as a footer because it does not use a correct token format. It would be nice if such url references could be recognized as special footers because it is quite common they break the max-line-length limit but that’s an unrelated request.

Read more comments on GitHub >

github_iconTop Results From Across the Web

conventional-changelog - Bountysource
When doing a git commit --verbose , conventional-commits-parser should strip ... of {body,footer}-max-line-length was validating the git diff of the commit.
Read more >
Make git diff show the same result as Github, but from a long ...
First off, let's fix the syntax of this command: git diff feature/BRANCH_I_AM_INTERESTED_IN...master. The reason you observed:.
Read more >
JavaScript lodash compact Examples
destroy(); legendScope = $scope.$new(); // Used to toggle the series, and for displaying values on hover legendValueNumbers = canvasElem.find('.
Read more >
4 Exploring History (git diff & show)
Git & GitHub Tutorial for Scientists: It's Not Only for Programmers. ... 4.1 Difference between current file and N commit ago ( git...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found