Skip to content

fix: assign commits to closest tag#1571

Open
DaniPopes wants to merge 25 commits into
orhun:mainfrom
DaniPopes:fix-include-paths
Open

fix: assign commits to closest tag#1571
DaniPopes wants to merge 25 commits into
orhun:mainfrom
DaniPopes:fix-include-paths

Conversation

@DaniPopes

@DaniPopes DaniPopes commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Reopening #711.

Description

Previously, when creating releases (assigning commits to tags), a new release was considered only when a tagged commit is encountered. This works fine in most cases, however, when used together with --include-path/--exclude-path, which may filter out one of these tagged commits, the entire tag would be skipped too.

This PR makes sure tags are never skipped by looking up the closest tag instead of trying to find an exact match for a given commit when creating new releases.

Additionally, this PR also fixes the issue where the first (root) commit of the repository was never included in the output when --include-path/--include-path was used.

Both of these issues are described in #208.

Motivation and Context

Fixes #208.

How Has This Been Tested?

cargo test + manual testing on repositories I use git-cliff on with --include-path, and with the script provided in the issue.

Screenshots / Logs (if applicable)

Types of Changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation (no code change)
  • Refactor (refactoring production code)
  • Other

Checklist:

  • My code follows the code style of this project.
  • I have updated the documentation accordingly.
  • I have formatted the code with rustfmt.
  • I checked the lints with clippy.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@DaniPopes
DaniPopes requested a review from orhun as a code owner July 6, 2026 20:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Relevant tags are missing when using --include-path

1 participant