-
Notifications
You must be signed in to change notification settings - Fork 917
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
Linting commits from log fails when git option log.showSignature
is enabled
#2118
Linting commits from log fails when git option log.showSignature
is enabled
#2118
Comments
This disables `git log` showing signatures (`--no-show-signature`) unless `showSignature` is set to a truthy value. This way differences in developers` local configuration (`log.showSignature`) do not affect tooling operation. Callers of `gitRawCommits` will need to explicitly request signatures (via `rawGitOpts`) if they are desired, instead of the current behavior of the presence of signatures being undefined. Fixes conventional-changelog/commitlint#2118
Hey @thesmiley1 , thanks you for this really well written issue! :) |
Thanks. While tracing through code, I thought the best location for a fix might be the |
This disables `git log` showing signatures (`--no-show-signature`) unless `showSignature` is set to a truthy value. This way differences in developers` local configuration (`log.showSignature`) do not affect tooling operation. Callers of `gitRawCommits` will need to explicitly request signatures (via `rawGitOpts`) if they are desired, instead of the current behavior of the presence of signatures being undefined. Fixes conventional-changelog/commitlint#2118 Co-authored-by: Benjamin E. Coe <[email protected]>
This disables `git log` showing signatures (`--no-show-signature`) unless `showSignature` is set to a truthy value. This way differences in developers` local configuration (`log.showSignature`) do not affect tooling operation. Callers of `gitRawCommits` will need to explicitly request signatures (via `rawGitOpts`) if they are desired, instead of the current behavior of the presence of signatures being undefined. Fixes conventional-changelog/commitlint#2118 Co-authored-by: Benjamin E. Coe <[email protected]>
This disables `git log` showing signatures (`--no-show-signature`) unless `showSignature` is set to a truthy value. This way differences in developers` local configuration (`log.showSignature`) do not affect tooling operation. Callers of `gitRawCommits` will need to explicitly request signatures (via `rawGitOpts`) if they are desired, instead of the current behavior of the presence of signatures being undefined. Fixes conventional-changelog/commitlint#2118 Co-authored-by: Benjamin E. Coe <[email protected]>
This disables `git log` showing signatures (`--no-show-signature`) unless `showSignature` is set to a truthy value. This way differences in developers` local configuration (`log.showSignature`) do not affect tooling operation. Callers of `gitRawCommits` will need to explicitly request signatures (via `rawGitOpts`) if they are desired, instead of the current behavior of the presence of signatures being undefined. Fixes conventional-changelog/commitlint#2118 Co-authored-by: Benjamin E. Coe <[email protected]>
When linting commits sourced from git log, commitlint fails to parse/analyze commits correctly if git's
log.showSignature
option is enabled, either for the repository or globally.Expected Behavior
Commitlint should gracefully handle this configuration and parse/analyze the commits correctly.
Current Behavior
Commitlint chokes on parsing signatures and fails to analyze commits correctly.
Affected packages
Possible Solution
Git log needs to be called with the
--no-show-signature
to normalize output (no signature) regardless of configuration.Alternatively, parsers would need to be modified to gracefully handle signatures somehow, whether it's full parsing or just recognizing and skipping them. It still might be useful to normalize output (maybe always showing signatures in this case). Parsing signatures is briefly mentioned in #321.
The first option is much simpler for squashing this bug and the second is more of a larger feature addition.
Steps to Reproduce (for bugs)
There are signed commits in this repo that can be used to reproduce this issue, e.g. b610bcd.
git clone 'https://github.com/conventional-changelog/commitlint.git'
cd commitlint
git config log.showSignature true
commitlint --from b610bcd15215cc5f14fb6de07914ed595cc3047b~1 --to b610bcd15215cc5f14fb6de07914ed595cc3047b
Context
I like to have signatures shown when I run
git log
as it makes it very obvious which commits are signed and which are not. So, I have this enabled globally:git config --global log.showSignature true
. This bug effectively prevents me from using commitlint with my preferred git configuration.Your Environment
commitlint --version
@commitlint/[email protected]
git --version
git version 2.28.0
node --version
v14.9.0
See also
There is a similar bug report (but lacking details) that I believe is the same issue in conventional-changelog/conventional-changelog#213.
The text was updated successfully, but these errors were encountered: