git-tools

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

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

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

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

action argument:
 {prune,validate,changelog}
   prune                     prune remote branches and local branches with gone remote tracks
   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 Prune

The prune action will prune remote branches & local branches with gone remote tracks.

usage: git-tools prune [-h] [-f]

optional arguments:
 -h, --help   show this help message and exit
 -f, --force  delete local branches irrespective of their merged status

Git Changelog

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

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

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

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 changelog HEAD 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.

usage: git-tools validate [-h] [rev]

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

optional arguments:
  -h, --help  show this help message and exit

See also

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