A simple changelog system on top of git commit messages.
The main idea is to generate “release notes” from a diff in commits before a release. It can easily be run manually or as part of a merge/pull CI pipeline.
In this case it looks for commit messages starting with one of these [ADD]
, [REMOVE]
, [INFO]
and just outputs those, but those patters can be adjusted to fit any existing commit schema.
PREVIOUS_REF=origin/dev
NEXT_REF=dev
git fetch origin # only required if you compare with a remote ref
git log $NEXT_REF..$PREVIOUS_REF --pretty=format:"%s" | grep -i -E "^(\[ADD\]|\[REMOVE\]|\[INFO\])"