Skip to main content

gitchangelog generates a changelog thanks to git log.

Project description

Translate commit message history to a changelog.

Feature

  • fully driven by a small configuration file to match with your changelog policies. (see for example the sample configuration file)

  • ignore commit message based on regexp matching

  • refactor commit message displayed on the fly with replace regexp

  • classify commit message into sections (ie: New, Fix, Changes…)

  • ignore non-changelog tags by regexps

Sample

The output is currently fixed to ReSTructured text, but it should be readable is ASCII.

Here is a small sample of the git-changelog changelog at work.

Current git log output so you can get an idea of the log history:

* 59f902a Valentin Lab new: dev: sections in changelog are now in the order given in ``git-changelog.rc`` in the ``section_regexps`` option.  (0.1.2)
* c6f72cc Valentin Lab chg: dev: commented code to toggle doctest mode.
* a9c38f3 Valentin Lab fix: dev: doctests were failing on this.
* 59524e6 Valentin Lab new: usr: added ``body_split_regexp`` option to attempts to format correctly body of commit.
* 5883f07 Valentin Lab new: usr: use a list of tuple instead of a dict for ``section_regexps`` to be able to manage order between section on find match.
* 7c1d480 Valentin Lab new: dev: new ``unreleased_version_label`` option in ``git-changelog.rc`` to change label of not yet released code.
* cf29c9c Valentin Lab fix: dev: bad sorting of tags (alphanumerical). Changed to commit date sort.
* 61d8f80 Valentin Lab fix: dev: support of empty commit message.
* eeca31b Valentin Lab new: dev: use ``git-changelog`` section in ``git config`` world appropriately.
* 6142b71 Valentin Lab chg: dev: cosmetic removal of trailing whitespaces
* 3c3edd5 Valentin Lab fix: usr: ``git`` in later versions seems to fail on ``git config <key>`` with errlvl 255, that was not supported.
* 3f9617d Valentin Lab fix: usr: removed Traceback when there were no tags at all in the current git repository.
* e0db9ae Valentin Lab new: usr: added section classifiers (ie: New, Change, Bugs) and updated the sample rc file.  (0.1.1)
* 0c66d59 Valentin Lab fix: dev: Fixed case where exception was thrown if two tags are on the same commit.
* d2fae0d Valentin Lab new: usr: added a succint ``--help`` support.

And here is the gitchangelog output:

0.1.2 (2011-05-17)
------------------

New
~~~

- Sections in changelog are now in the order given in ``git-
  changelog.rc`` in the ``section_regexps`` option. [Valentin Lab]

- Added ``body_split_regexp`` option to attempts to format correctly
  body of commit. [Valentin Lab]

- Use a list of tuple instead of a dict for ``section_regexps`` to be
  able to manage order between section on find match. [Valentin Lab]

- New ``unreleased_version_label`` option in ``git-changelog.rc`` to
  change label of not yet released code. [Valentin Lab]

- Use ``git-changelog`` section in ``git config`` world appropriately.
  [Valentin Lab]

Changes
~~~~~~~

- Commented code to toggle doctest mode. [Valentin Lab]

- Cosmetic removal of trailing whitespaces. [Valentin Lab]

Fix
~~~

- Doctests were failing on this. [Valentin Lab]

- Bad sorting of tags (alphanumerical). Changed to commit date sort.
  [Valentin Lab]

- Support of empty commit message. [Valentin Lab]

- ``git`` in later versions seems to fail on ``git config <key>`` with
  errlvl 255, that was not supported. [Valentin Lab]

- Removed Traceback when there were no tags at all in the current git
  repository. [Valentin Lab]

0.1.1 (2011-04-07)
------------------

New
~~~

- Added section classifiers (ie: New, Change, Bugs) and updated the
  sample rc file. [Valentin Lab]

- Added a succint ``--help`` support. [Valentin Lab]

Fix
~~~

- Fixed case where exception was thrown if two tags are on the same
  commit. [Valentin Lab]

And the rendered full result is directly used to generate the HTML webpage of the changelog of the PyPI page.

Usage

The sample configuration file is quite heavily commented and is quite simple. You should be able to use it as required.

The changelog of gitchangelog is generated with himself and with the sample configuration file. You’ll see the output in the changelog of the PyPI page.

What is not (yet) configurable

The output is in ReSTructured text, and this is not configurable. This could be easily implemented by using a template driven content generation.

Changelog

1.1.0 (2012-05-03)

New

  • New config file lookup scheme which adds a new possible default location .gitchangelog.rc in the root of the git repository. [Valentin Lab]

  • GitRepos object now give access to directory informations and whole git config read access. [Valentin Lab]

  • Added a new section to get a direct visual of gitchangelog output. Reworded some sentences and did some other minor additions. [Valentin Lab]

Changes

  • Removed old gitchangelog.rc.sample in favor of the new documented one. [Valentin Lab]

Fix

  • The sample file was not coherent with the doc, and is now accepting ‘test’ and ‘doc’ audience. [Valentin Lab]

1.0.2 (2012-05-02)

New

  • Added a new sample file heavily documented. [Valentin Lab]

Changes

  • Changed default config file name towards ~/.gitchangelog.rc instead of ~/.git-changelog.rc. [Valentin Lab]

  • Added a link to PyPI in the doc. [Valentin Lab]

Fix

  • ignore_regexps where bogus and would match only from the beginning of the line. [Valentin Lab]

  • Display author date rather than commit date. [Valentin Lab]

1.0.1 (2011-06-29)

Fix

  • ReST title consistency corrected in docs. [Valentin Lab]

1.0.0 (2011-06-29)

New

  • Set up setuptools packaging. [Valentin Lab]

  • Use GITCHANGELOG_CONFIG_FILENAME environ variable (if set) to get the default location of config file. [Valentin Lab]

Changes

  • Extracted the main code in a function main [Valentin Lab]

Fix

  • Adds a period to subject message only if last char of subject is alpha numeric. [Valentin Lab]

0.1.4 (2011-05-27)

Changes

  • Removed stdin from cmd() function. [Valentin Lab]

  • Various small code enhancements and cleanup. [Valentin Lab]

  • Forced MULTILINE regexps on paragraph_wrap which is used to wrap body of commit messages. [Valentin Lab]

Fix

  • Fixed the body_split_regexp to keep title words. [Valentin Lab]

  • Corrected big bad bug due to Popen.wait() usage instead of Popen.communicate() [Valentin Lab]

0.1.3 (2011-05-23)

New

  • Can now compare two commit. [Valentin Lab]

  • Added LAST virtual identifier to get the last element coming from HEAD. [Valentin Lab]

Fix

  • Last revision is now displayed in changelog. [Valentin Lab]

    new: dev: added new option tag_filter_regexp to filter tags we want to use in the changelog.

0.1.2 (2011-05-17)

New

  • Sections in changelog are now in the order given in git- changelog.rc in the section_regexps option. [Valentin Lab]

  • Added body_split_regexp option to attempts to format correctly body of commit. [Valentin Lab]

  • Use a list of tuple instead of a dict for section_regexps to be able to manage order between section on find match. [Valentin Lab]

  • New unreleased_version_label option in git-changelog.rc to change label of not yet released code. [Valentin Lab]

  • Use git-changelog section in git config world appropriately. [Valentin Lab]

Changes

  • Commented code to toggle doctest mode. [Valentin Lab]

  • Cosmetic removal of trailing whitespaces. [Valentin Lab]

Fix

  • Doctests were failing on this. [Valentin Lab]

  • Bad sorting of tags (alphanumerical). Changed to commit date sort. [Valentin Lab]

  • Support of empty commit message. [Valentin Lab]

  • git in later versions seems to fail on git config <key> with errlvl 255, that was not supported. [Valentin Lab]

  • Removed Traceback when there were no tags at all in the current git repository. [Valentin Lab]

0.1.1 (2011-04-07)

New

  • Added section classifiers (ie: New, Change, Bugs) and updated the sample rc file. [Valentin Lab]

  • Added a succint --help support. [Valentin Lab]

Fix

  • Fixed case where exception was thrown if two tags are on the same commit. [Valentin Lab]

TODO

  • Need tests

  • Need templating to offer other format than ReST.

  • Need complete documentation

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gitchangelog-1.1.0.tar.gz (10.3 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page