Skip to content

Instantly share code, notes, and snippets.

@chrishenry
Created February 2, 2015 19:59
Show Gist options
  • Save chrishenry/649462c96cad7232b43f to your computer and use it in GitHub Desktop.
Save chrishenry/649462c96cad7232b43f to your computer and use it in GitHub Desktop.
.gitchangelogrc
## This requires a global install of pystache
## pip install pystache
##
## Format
##
## ACTION: [AUDIENCE:] COMMIT_MSG [@TAG ...]
##
## Description
##
## ACTION is one of 'chg', 'fix', 'new'
##
## Is WHAT the change is about.
##
## 'chg' is for refactor, small improvement, cosmetic changes...
## 'fix' is for bug fixes
## 'new' is for new features, big improvement
## 'rmv' is for anything removed in this release
##
## SUBJECT is optional and one of 'dev', 'usr', 'pkg', 'test', 'doc'
##
## Is WHO is concerned by the change.
##
## 'dev' is for developpers (API changes, refactors...)
## 'usr' is for final users (UI changes)
## 'pkg' is for packagers (packaging changes)
## 'test' is for testers (test only related changes)
## 'doc' is for doc guys (doc only changes)
##
## COMMIT_MSG is ... well ... the commit message itself.
##
## TAGs are additionnal adjective as 'refactor' 'minor' 'cosmetic'
##
## 'refactor' is obviously for refactoring code only
## 'minor' is for a very meaningless change (a typo, adding a comment)
## 'cosmetic' is for cosmetic driven change (re-indentation, 80-col...)
## 'wip' is for partial functionality but complete subfunctionality.
##
## Example:
##
## new: usr: support of bazaar implemented
## chg: re-indentend some lines @cosmetic
## new: dev: updated code to be compatible with last version of killer lib.
## fix: pkg: updated year of licence coverage.
## new: test: added a bunch of test around user usability of feature X.
## fix: typo in spelling my name in comment. @minor
##
## Please note that multi-line commit message are supported, and only the
## first line will be considered as the "summary" of the commit message. So
## tags, and other rules only applies to the summary. The body of the commit
## message will be displayed in the changelog with minor reformating.
##
## ``ignore_regexps`` is a line of regexps
##
## Any commit having its full commit message matching any regexp listed here
## will be ignored and won't be reported in the changelog.
##
## Spare regexes for ignore
## r'^([cC]hg|[fF]ix|[nN]ew)\s*:\s*[p|P]kg:',
## r'^([cC]hg|[fF]ix|[nN]ew)\s*:\s*[d|D]ev:',
##
ignore_regexps = [
r'@minor', r'!minor', r'#minor',
r'@cosmetic', r'!cosmetic', r'#cosmetic',
r'@refactor', r'!refactor', r'#refactor',
r'@savegame', r'!savegame', r'#savegame',
r'@wip', r'!wip', r'#wip',
r'^(.{3,3}\s*:)?\s*[fF]irst commit.?\s*$',
r'^(.{3,3}\s*:)?\s*[iI]nitial commit.?\s*$'
]
##
## ``replace_regexps`` is a dict associating a regexp pattern and its replacement
##
## It will be applied to get the summary line from the full commit message.
##
## Note that you can provide multiple replacement patterns, they will be all
## tried. If None matches, the summary line will be the full commit message.
##
replace_regexps = {
## current format (ie: 'chg: dev: my commit msg @tag1 @tag2')
r'^([cC]hg|[fF]ix|[nN]ew|[rR]mv)\s*:\s*((dev|use?r|pkg|test|doc)\s*:\s*)?([^\n@]*)(@[a-z]+\s+)*$':
r'\4',
}
## ``section_regexps`` is a list of 2-tuples associating a string label and a
## list of regexp
##
## Commit messages will be classified in sections thanks to this. Section
## titles are the label, and a commit is classified under this section if any
## of the regexps associated is matching.
##
section_regexps = [
('New', [
r'^[nN]ew\s*:\s*((dev|use?r|pkg|test|doc)\s*:\s*)?([^\n]*)$',
]),
('Changes', [
r'^[cC]hg\s*:\s*((dev|use?r|pkg|test|doc)\s*:\s*)?([^\n]*)$',
]),
('Fix', [
r'^[fF]ix\s*:\s*((dev|use?r|pkg|test|doc)\s*:\s*)?([^\n]*)$',
]),
('Removed', [
r'^[rR]mv\s*:\s*((dev|use?r|pkg|test|doc)\s*:\s*)?([^\n]*)$',
]),
('Other', None ## Match all lines
),
]
## ``body_split_regexp`` is a regexp
##
## Commit message body (not the summary) if existing will be split
## (new line) on this regexp
##
body_split_regexp = r'\n(?=\w+\s*:)'
## ``tag_filter_regexp`` is a regexp
##
## Tags that will be used for the changelog must match this regexp.
##
tag_filter_regexp = r'^(v|)[0-9]+\.[0-9]+(\.[0-9]+)?$'
## ``unreleased_version_label`` is a string
##
## This label will be used as the changelog Title of the last set of changes
## between last valid tag and HEAD if any.
unreleased_version_label = "%%version%% (unreleased)"
## ``output_engine`` is a callable
##
## This will change the output format of the generated changelog file
##
## Available choices are:
##
## - rest_py
##
## Legacy pure python engine, outputs ReSTructured text.
## This is the default.
##
## - mustache(<template_name>)
##
## Template name could be any of the available templates in
## ``templates/mustache/*.tpl``.
## Requires python package ``pystache``.
## Examples:
## - mustache("markdown")
## - mustache("restructuredtext")
##
## - makotemplate(<template_name>)
##
## Template name could be any of the available templates in
## ``templates/mako/*.tpl``.
## Requires python package ``mako``.
## Examples:
## - makotemplate("restructuredtext")
##
#output_engine = rest_py
#output_engine = mustache("restructuredtext")
#output_engine = makotemplate("restructuredtext")
output_engine = mustache("markdown")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment