Example Tooling
Changelogs from commit history
Commits are a great starting point for determining what’s changed and should be discussed with stakeholders. Having structured commit messages - like those git-com produces - makes generating these internal changelogs easy.
For example, in one of my projects I’ve got git-com generating commit messages with the following structure.
[<change-type>] <commit-title>
<commit-body>
<code-section>
Running git log --pretty='format:%s' gives us easily parseable output that we can convert into a changelog. For example:
[fix] icon in readme on github
[fix] removed unecessary blank line from .git-com.yaml
[fix] removed flag from script to update homebrew tap
[add] added quick-start to docs
[refactor] minimized cyclomatic complexity
To make it more readable for stakeholders we can convert that into something like this:
[fix]
- icon in readme on github
- removed unecessary blank line from .git-com.yaml
- removed flag from script to update homebrew tap
[add]
- added quick-start to docs
[refactor]
- minimized cyclomatic complexity
I’ve written a ruby script that does this conversion for me.