Skip to content

--git-log-args='--first-parent' silently ignored since v20 #4704

@llamington

Description

@llamington

Summary

--git-log-args='--first-parent' has no effect in commitlint v20. All commits in the merge ancestry are still linted despite the flag being passed. This works correctly in v19.

Reproduction

Given a branch with a merge commit (e.g. merging release into a feature branch before PR to main):

# Returns 8 commits
git log --first-parent --oneline origin/main..HEAD
                                                                                           
# v19: lints 8 commits ✅
# v20: lints all 43 commits ❌                                                           
commitlint --from origin/main --to HEAD --git-log-args='--first-parent'         

Expected behaviour

Only first-parent commits should be linted, consistent with v19 behaviour and the CLI
documentation which uses --first-parent as the example for --git-log-args.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions