git-tools

The confirm.tools library provides a git-tools CLI script to work with Git commits:

usage: git-tools [-h] [-r REPO] [rev] {validate,changelog} ...

A tool to work with the commits of a Git repository.

positional arguments:
  rev                   an alternative revision (e.g. `{lastTag}..HEAD`)

optional arguments:
  -h, --help            show this help message and exit
  -r REPO, --repo REPO  the path to the Git repository

action argument:
  {validate,changelog}
    validate            validates the commit messages
    changelog           build a Markdown changelog from commit messages

Hint

If you’ve installed git-tools to a path contained in PATH, you can this command as valid git sub command like this:

git tools

Git Changelog

The changelog action will generate a Markdown changelog from the Git commit messages:

usage: git-tools [rev] changelog [-h] [-f FORMAT] [-n NEWLINE] [-p PREFIXES]

optional arguments:
  -h, --help                        show this help message and exit
  -f FORMAT, --format FORMAT        the format for the commits
  -n NEWLINE, --newline NEWLINE     the newline character
  -p PREFIXES, --prefixes PREFIXES  the prefixes

If you’re in a Git repository, you should be able to execute git-tools changelog w/o any other arguments and you should get a changelog for FEATURE, FIX, TEST and DOC commit messages since the last tag.

Tip

Use git-tools HEAD changelog to get a changelog for all commit messages, regardless of the tags.

See also

The git revision should be determined automatically. If you want to know more about that, have a look at this method:

In case you need help in defining revisions, have a look at the following man page:

man gitrevisions

Validate Commits

The validate action will validate Git commits, according to the Git Guidelines.

See also

If you want to know which validations are in place, have a look at this method: