Generate release note pages from git commit history.
It's preferable to install it globally through npm
npm install -g git-release-notes
The basic usage is
cd <your_git_project>
git-release-notes <since>..<until> <template>
Where
<since>..<until>specifies the range of commits as ingit log, see gitrevisions(7)<template>is an ejs template file used to generate the release notes
Two templates are included as reference, markdown and html.
This are for instance the release notes generated from joyent/node running
git-release-notes v0.9.8..v0.9.9 html > changelog.html
The second parameter of git-release-notes can be any path to a valid ejs template files.
The only available template local variable is commits that is an array of commits, each containing
sha1commit hash (%H)authorNameauthor name (%an)authorEmailauthor email (%ae)authorDateauthor date (%aD)committerNamecommitter name (%cn)committerEmailcommitter email (%ce)committerDatecommitter date (%cD)titlesubject (%s)messageLinesarray of body lines (%b)
More advanced options are
porpathGit project path, defaults to the current working pathborbranchGit branch, defaults tomastertortitleRegular expression to parse the commit title (see next chapter)mormeaningMeaning of capturing block in title's regular expressionforfileJSON Configuration file, better option when you don't want to pass all parameters to the command line, for an example see options.json
Some projects might have special naming conventions for the commit title.
The options t and m allow to specify this logic and extract additional information from the title.
For instance, Aria Templates has the following convention
fix #123 Title of a bug fix commit
feat #234 Title of a cool new feature
In this case using
git-release-notes -t "^([a-z]+) #(\d+) (.*)$" -m type -m issue -m title v1.3.6..HEAD html
generates the additional fields on the commit object
typefirst capturing blockissuesecond capturing blocktitlethird capturing block (redefines the title)
Another project using similar conventions is AngularJs, commit message conventions.
git-release-notes -t "^(\w*)(?:\(([\w\$\.]*)\))?\: (.*)$" -m type -m scope -m title v1.1.2..v1.1.3 markdown