Skip to content

Generate release notes from a tag or commit range #326

Open

Description

@somethingwithproof

Problem

--changelog (src/changelog.rs, ChangelogManager::add_entry) appends one entry for the commit being made. There is no way to build a changelog section for an existing range, for example everything since the last tag, so a project that did not use --changelog from the start cannot get release notes out of its history.

Proposal

Add --changelog-from <REF> with an optional --changelog-to <REF> (default HEAD) and --release-version <X.Y.Z>. It reads git log REF..TO, parses subjects with the same conventional-commit pattern the validator uses, groups them by type using the configured prefixes, and writes one new version section at the top of the changelog file. Subjects that do not parse go under an "Other" heading. --dry-run prints the section instead of writing it. A range with no commits writes nothing.

Where it fits

src/changelog.rs (new add_section next to add_entry), src/stats.rs (the same git log invocation and subject regex can move to a shared helper), src/main.rs (new Args fields), src/config.rs (prefix titles).

Done when

  • commitkit --changelog-from v1.2.0 --release-version 1.3.0 writes a ## 1.3.0 section grouped by commit type.
  • --dry-run prints it without touching the file.
  • Non-conventional subjects are listed under Other, not dropped.
  • An empty range leaves the file unchanged.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions