-
Notifications
You must be signed in to change notification settings - Fork 934
add ability to pass arbitrary git log arguments #3331
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
Comments
Thanks for opening this. Are you motivated to look into this? I.e. to find the root cause of this? |
it is a feature request not a bug the feature is: commitlint/@commitlint/cli/src/cli.ts Line 180 in f1b9b11
commitlint/@commitlint/read/src/read.ts Line 12 in f1b9b11
|
Wanna create a PR? |
I pushed an PR, adds
|
Thanks for you PR! Merged it. Will try to push out a new release soon. |
Released, please give it a try |
Gave it a try works very well thanks for that uncomplicated process. |
Issue
Currently it is impossible to add any additional parameters to
git log
when usingcommitlint
cli parameter--from
.I am sure you are aware of the need to be able to modify the git log behaviour, there are many corner cases that can be tackled by adding additional arguments to
git
.My specific case is based on merging unrelated history, in which case git log traverses through all the merged in dangling branches, which ends up in a lot of commits being validated.
To fix it I needed to add
--first-parent
to git log so it doesn't traverse into the merged history.My current fix is to pass the commit messages one by one to
commitlint
via a for loop that exits on error.An alternative could be to allow a list of commits via the stdin, I guess you would have to add a delimiter option, similar how the
--from
option splits messages into an array. As far as I can see you log with the option:and split the messages by
------------------------ >8 ------------------------
since commit messages can't be split by new lines.Affected packages
commitlint --version
git --version
node --version
The text was updated successfully, but these errors were encountered: