Tooling to generate pretty changelogs from commit histories.
Find a file
Marc Cataford 13d132708b
All checks were successful
Pull Request / static-analysis (pull_request) Successful in 1m5s
Pull Request / export-trace (pull_request) Successful in 29s
Push / static-analysis (push) Successful in 1m0s
Push / export-trace (push) Successful in 41s
feat: sort grouped commits by commit date
2024-11-11 23:01:18 -05:00
.forgejo/workflows feat: generate changelog from commit range + cli basics 2024-11-09 15:11:50 -05:00
modif feat: sort grouped commits by commit date 2024-11-11 23:01:18 -05:00
.gitignore Initial commit 2024-11-09 19:56:51 +00:00
.pre-commit-config.yaml feat: generate changelog from commit range + cli basics 2024-11-09 15:11:50 -05:00
bootstrap.sh feat: generate changelog from commit range + cli basics 2024-11-09 15:11:50 -05:00
LICENSE Initial commit 2024-11-09 19:56:51 +00:00
pyproject.toml feat: add configurable groups 2024-11-11 22:53:38 -05:00
README.md feat: add configurable groups 2024-11-11 22:53:38 -05:00
uv.lock feat: add configurable groups 2024-11-11 22:53:38 -05:00

Modif

Forgejo unfortunately doesn't support autogenerating release changelogs, and while a lot of tooling already exists out here to tackle that sort of problem, it often does far too much extra for my taste. Thus, modif seeks to do one thing and do it well: generate simple markdown changelogs from commit history data (and later, validate that commits comply with a desired format for those logs).

Install

This isn't published anywhere, but can be installed directly from source control via pipx or pip:

# With pipx
pipx install git+https://forge.karnov.club/marc/modif.git

# With pip
pip install git+https://forge.karnov.club/marc/modif.git

The repository can also be pulled down to put it together yourself.

Usage

Generating changelogs from commit ranges

Changelogs can be generated based on a start and end reference:

modif log --from=<reference> --to=<reference>

Using the --raw flag will output the changelog markdown without any colours or headers - the output otherwise has extra messaging that isn't part of the changelog itself.

Commit format

Some assumptions are made about commit message formatting that will later be made more configurable. It is expected that commits conforms to the Conventional Commit scheme.

Configuration

The groupings can be configured using a YAML file formatted as follows:

groups:
    - label: <Heading to identify the group with in the generated log>
      prefixes: [<prefix1>, <prefix2, ...]
    - label: ...
      prefixes: ...

Each group is headed by its label value and contains a list of all the commits matching the prefix selection for that group.

If not supplied, a default configuration (see modif.configuration.get_default_config) is substituted in.