Code Monkey home page Code Monkey logo

gitchangelog's Introduction

gitchangelog

Latest PyPI version

Number of PyPI downloads

Travis CI build status

Appveyor CI build status

Test coverage

Use your commit log to make beautifull and configurable changelog file.

Feature

  • fully driven by a config file that can be tailored with your changelog policies. (see for example the reference configuration file)
  • filter out commits/tags based on regexp matching
  • refactor commit summary, or commit body on the fly with replace regexp
  • classify commit message into sections (ie: New, Fix, Changes...)
  • any output format supported thanks to templating, you can even choose your own preferred template engine (mako, mustache, full python ...).
  • support your merge or rebase workflows and complicated git histories
  • support full or incremental changelog generation to match your needs.
  • support easy access to trailers key values (if you use them)
  • support of multi-authors for one commit through Co-Authored-By trailers key values
  • support standard python installation or dep-free single executable. (this last feature is not yet completely pain free to use on Windows)

Requirements

gitchangelog is compatible Python 2 and Python 3 on Linux/BSD/MacOSX and Windows.

Please submit an issue if you encounter incompatibilities.

Installation

full package

Gitchangelog is published on PyPI, thus:

pip install gitchangelog

.. is the way to go for install the full package on any platform.

If you are installing from source, please note that the development tools are not working fully yet on Windows.

The full package provides the gitchangelog.py executable as long as:

  • a reference configuration file that provides system wide defaults for all values.
  • some example templates in mustache and mako templating engine's language. Ideal to bootstrap your variations.

from source

If you'd rather work from the source repository, it supports the common idiom to install it on your system:

python setup.py install

Note that for linux/BSD, there's a link to the executable in the root of the source. This can be a convenient way to work on the source version.

single executable installation

The file gitchangelog.py is a full blown executable and can be used without any other files. This is easier to use naturally on Linux/BSD systems. For instance, you could type in:

curl -sSL https://raw.githubusercontent.com/vaab/gitchangelog/master/src/gitchangelog/gitchangelog.py > /usr/local/bin/gitchangelog &&
chmod +x /usr/local/bin/gitchangelog

It'll install gitchangelog to be accessible for all users and will use the default python interpreter of your running session.

Please note: if you choose to install it in this standalone mode, then you must make sure to value at least all the required configuration keys in your config file. As a good start you should probably copy the reference configuration file as you base configuration file.

This is due to the fact that gitchangelog can not anymore reach the reference configuration file to get default values.

Sample

The default output is ReSTructured text, so it should be readable in ASCII.

Here is a small sample of the gitchangelog 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 ``gitchangelog.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 ``gitchangelog.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 ``gitchangelog`` 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 ``gitchangelog.rc`` to
  change label of not yet released code. [Valentin Lab]
- Use ``gitchangelog`` 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 reference configuration file is delivered within gitchangelog package and is used to provides defaults to settings. If you didn't install the package and used the standalone file, then chances are that gitchangelog can't access these defaults values. This is not a problem as long as you provided all the required values in your config file.

The recommended location for gitchangelog config file is the root of the current git repository with the name .gitchangelog.rc. However you could put it elsewhere, and here are the locations checked (first match will prevail):

  • in the path given thanks to the environment variable GITCHANGELOG_CONFIG_FILENAME
  • in the path stored in git config's entry gitchangelog.rc-path (which could be stored in system location or per repository)
  • (RECOMMENDED) in the root of the current git repository with the name .gitchangelog.rc

Then, you'll be able to call gitchangelog in a GIT repository and it'll print changelog on its standard output.

Configuration file format

The reference 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 reference configuration file. You'll see the output in the changelog of the PyPI page.

Output Engines

At the end of the configuration file, you'll notice a variable called output_engine. By default, it's set to rest_py, which is the legacy python engine to produce the ReSTructured Text output format that is shown in above samples. If this engine fits your needs, you won't need to fiddle with this option.

To render the template, gitchangelog will generate a data structure that will then be rendered thanks to the output engine. This should help you get the exact output that you need.

As people might have different needs and knowledge, a templating system using mustache is available. mustache templates are provided to render both ReSTructured Text or markdown formats. If you know mustache templating, then you could easily add or modify these existing templates.

A mako templating engine is also provided. You'll find also a mako template producing the same ReSTructured Text output than the legacy one. It's provided for reference and/or further tweak if you would rather use mako templates.

Mustache

The mustache output engine uses mustache templates.

The mustache templates are powered via pystache the python implementation of the mustache specifications. So mustache output engine will only be available if you have pystache module available in your python environment.

There are mustache templates bundled with the default installation of gitchangelog. These can be called by providing a simple label to the mustache(..) output_engine, for instance (in your .gitchangelog.rc):

output_engine = mustache("markdown")

Or you could provide your own mustache template by specifying an absolute path (or a relative one, starting from the git toplevel of your project by default, or if set, the git config gitchangelog.template-path location) to your template file, for instance:

output_engine = mustache(".gitchangelog.tpl")

And feel free to copy the bundled templates to use them as bases for your own variations. In the source code, these are located in src/gitchangelog/templates/mustache directory, once installed they are in templates/mustache directory starting from where your gitchangelog.py was installed.

Mako

The makotemplate output engine templates for gitchangelog are powered via mako python templating system. So mako output engine will only be available if you have mako module available in your python environment.

There are mako templates bundled with the default installation of gitchangelog. These can be called by providing a simple label to the makotemplate(..) output_engine, for instance (in your .gitchangelog.rc):

output_engine = makotemplate("markdown")

Or you could provide your own mustache template by specifying an absolute path (or a relative one, starting from the git toplevel of your project by default, or if set, the git config gitchangelog.template-path location) to your template file, for instance:

output_engine = makotemplate(".gitchangelog.tpl")

And feel free to copy the bundled templates to use them as bases for your own variations. In the source code, these are located in src/gitchangelog/templates/mako directory, once installed they are in templates/mako directory starting from where your gitchangelog.py was installed.

Changelog data tree

This is a sample of the current data structure sent to output engines:

{'title': 'Changelog',
 'versions': [{'label': '%%version%% (unreleased)',
               'date': None,
               'tag': None
               'sections': [{'label': 'Changes',
                             'commits': [{'author': 'John doe',
                                          'body': '',
                                          'subject': 'Adding some extra values.'},
                                         {'author': 'John Doe',
                                          'body': '',
                                          'subject': 'Some more changes'}]},
                            {'label': 'Other',
                             'commits': [{'author': 'Jim Foo',
                                          'body': '',
                                          'subject': 'classic modification'},
                                         {'author': 'Jane Done',
                                          'body': '',
                                          'subject': 'Adding some stuff to do.'}]}]},
              {'label': 'v0.2.5 (2013-08-06)',
               'date': '2013-08-06',
               'tag': 'v0.2.5'
               'sections': [{'commits': [{'author': 'John Doe',
                                          'body': '',
                                          'subject': 'Updating Changelog installation.'}],
                             'label': 'Changes'}]}]}

Merged branches history support

Commit attribution to a specific version could be tricky. Suppose you have this typical merge tree (spot the tags!):

* new: something  (HEAD, tag: 0.2, develop)
*   Merge tag '0.1.1' into develop
|\
| * fix: out-of-band hotfix  (tag: 0.1.1)
* | chg: continued development
|/
* fix: something  (tag: 0.1)
* first commit  (tag: 0.0.1, master)

Here's a minimal draft of gitchangelog to show how commit are attributed to versions:

0.2
  * new: something.
  * Merge tag '0.1.1' into develop.
  * chg: continued development.

0.1.1
  * fix: out-of-band hotfix.

0.1
  * fix: something.

Note

you can remove automatically all merge commit from gitchangelog output by using include_merge = False in the .gitchangelog.rc file.

Use cases

No sectionning

If you want to remove sectionning but keep anything else, you should probably use:

section_regexps = [
    ('', None)
]

subject_process = (strip | ucfirst | final_dot)

This will disable sectionning and won't remove the prefixes used for sectionning from the commit's summary.

Incremental changelog

Also known as partial changelog generation, this feature allows to generate only a subpart of your changelog, and combined with configurable publishing actions, you can insert the result inside an existing changelog. Usually this makes sense:

  • When wanting to switch to gitchangelog, or change your conventions:
    • part of your history is not following conventions.
    • you have a previous CHANGELOG you want to blend in.
  • You'd rather commit changes to your changelog file for each release:
    • For performance reason, you can then generate changelog only for the new commit and save the result.
    • Because you want to be able to edit it to make some minor edition if needed.

Generating partial changelog is as simple as gitchangelog REVLIST. Examples follows:

## will output only tags between 0.0.2 (excluded) and 0.0.3 (included)
gitchangelog 0.0.2..0.0.3

## will output only tags since 0.0.3 (excluded)
gitchangelog ^0.0.3 HEAD

## will output all tags up to 0.0.3 (included)
gitchangelog 0.0.3

Additionally, gitchangelog can figure out automatically which revision is the last for you (with some little help). This is done by specifying the revs config option. This config file option will be used as if specified on the command line.

Here is an example that fits the current changelog format:

revs = [
    Caret(
        FileFirstRegexMatch(
            "CHANGELOG.rst",
            r"(?P<rev>[0-9]+\.[0-9]+(\.[0-9]+))\s+\([0-9]+-[0-9]{2}-[0-9]{2}\)\n--+\n")),
]

This will look into the file CHANGELOG.rst for the first match of the given regex and return the match of the rev regex sub-pattern it as a string. The Caret function will simply prefix the given string with a ^. As a consequence, this code will prevent recreating any previously generated changelog section (more information about the REVLIST syntax from git rev-list arguments.)

Note that the data structure provided to the template will set the title to None if you provided no REVLIST through command-line or the config file (or if the revlist was equivalently set to ["HEAD", ]). This a good way to make your template detect it is in "incremental mode".

By default, this will only output to standard output the new sections of your changelog, you might want to insert it directly in your existing changelog. This is where publish parameters will help you. By default it is set to stdout, and you might want to set it to:

publish = FileInsertIntoFirstRegexMatch(
    "CHANGELOG.rst",
    r'/(?P<rev>[0-9]+\.[0-9]+(\.[0-9]+)?)\s+\([0-9]+-[0-9]{2}-[0-9]{2}\)\n--+\n/',
    idx=lambda m: m.start(1)
)

The full recipe could be:

OUTPUT_FILE = "CHANGELOG.rst"
INSERT_POINT = r"\b(?P<rev>[0-9]+\.[0-9]+)\s+\([0-9]+-[0-9]{2}-[0-9]{2}\)\n--+\n"
revs = [
        Caret(FileFirstRegexMatch(OUTPUT_FILE, INSERT_POINT)),
        "HEAD"
]

action = FileInsertAtFirstRegexMatch(
    OUTPUT_FILE, INSERT_POINT,
    idx=lambda m: m.start(1)
)

Alternatively, you can use this other recipe, using FileRegexSubst, that has the added advantage of being able to update the unreleased part if you had it already generated and need a re-fresh because you added new commits or amended some commits:

OUTPUT_FILE = "CHANGELOG.rst"
INSERT_POINT_REGEX = r'''(?isxu)
^
(
  \s*Changelog\s*(\n|\r\n|\r)        ## ``Changelog`` line
  ==+\s*(\n|\r\n|\r){2}              ## ``=========`` rest underline
)

(                     ## Match all between changelog and release rev
    (
      (?!
         (?<=(\n|\r))                ## look back for newline
         %(rev)s                     ## revision
         \s+
         \([0-9]+-[0-9]{2}-[0-9]{2}\)(\n|\r\n|\r)   ## date
           --+(\n|\r\n|\r)                          ## ``---`` underline
      )
      .
    )*
)

(?P<rev>%(rev)s)
''' % {'rev': r"[0-9]+\.[0-9]+(\.[0-9]+)?"}

revs = [
    Caret(FileFirstRegexMatch(OUTPUT_FILE, INSERT_POINT_REGEX)),
    "HEAD"
]

publish = FileRegexSubst(OUTPUT_FILE, INSERT_POINT_REGEX, r"\1\o\g<rev>")

As a second example, here is the same recipe for mustache markdown format:

OUTPUT_FILE = "CHANGELOG.rst"
INSERT_POINT_REGEX = r'''(?isxu)
^
(
  \s*\#\s+Changelog\s*(\n|\r\n|\r)        ## ``Changelog`` line
)

(                     ## Match all between changelog and release rev
    (
      (?!
         (?<=(\n|\r))                ## look back for newline
         \#\#\s+%(rev)s                     ## revision
         \s+
         \([0-9]+-[0-9]{2}-[0-9]{2}\)(\n|\r\n|\r)   ## date
      )
      .
    )*
)

(?P<tail>\#\#\s+(?P<rev>%(rev)s))
''' % {'rev': r"[0-9]+\.[0-9]+(\.[0-9]+)?"}

revs = [
    Caret(FileFirstRegexMatch(OUTPUT_FILE, INSERT_POINT_REGEX)),
    "HEAD"
]

publish = FileRegexSubst(OUTPUT_FILE, INSERT_POINT_REGEX, r"\1\o\n\g<tail>")

Contributing

Any suggestion or issue is welcome. Push request are very welcome, please check out the guidelines.

Push Request Guidelines

You can send any code. I'll look at it and will integrate it myself in the code base while leaving you as the commit(s) author. This process can take time and it'll take less time if you follow the following guidelines:

  • check your code with PEP8 or pylint. Try to stick to 80 columns wide.
  • separate your commits per smallest concern
  • each functionality/bugfix commit should contain the code, tests, and doc.
  • each commit should pass the tests (to allow easy bisect)
  • prior minor commit with typographic or code cosmetic changes are very welcome. These should be tagged in their commit summary with !minor.
  • the commit message should follow gitchangelog rules (check the git log to get examples)
  • if the commit fixes an issue or finished the implementation of a feature, please mention it in the summary.

If you have some questions about guidelines which is not answered here, please check the current git log, you might find previous commit that would show you how to deal with your issue. Otherwise, just send your PR and ask your question. I won't bite. Promise.

License

Copyright (c) 2012-2018 Valentin Lab.

Licensed under the BSD License.

gitchangelog's People

Contributors

beeftornado avatar skorokithakis avatar tuukkamustonen avatar vaab avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gitchangelog's Issues

No output after gitchangelog

Hello.

situation.

The command ..

echo $GITCHANGELOG_CONFIG_FILENAME

gave me

/home/drxos/.gitchangelog.rc

and this file is a perfect copy of the sample you suggested.

git log  - -oneline

gave this :

f9432cd chg: dev: cofigurations !cosmetics
7b2884c chg: dev: initial commit !cosmetics
68bd063 new: dev: initial commit !minor

Unfortunetly,

gitchangelog

output no thing.

Where is the mistake ?

"git describe --tags" use question

Hi,

I am trying to setup gitchangelog and I've noticed that I am getting an error on the initial run off ./autorun.sh

The error I am getting is at line 185.

if ! "$git" describe --tags >/dev/null 2>&1; then
    die "Didn't find a git repository (or no tags found). " \
     "\`\`./autogen.sh\`\` uses git to create changelog and version information."
fi

However if I change describe --tags to log the script runs fine with no errors.

So just a question, what is t the script trying to do here? I understand that its trying to check for git, but is there a specific reason why describe does not work and log does?

Thanks

Commit body message is wrangled, I want it pristine...

In projects I usually am used to provide my commit message's body in full ReSTructured text. But when used in the changelog it get all smashed.

I understand that it is smashed because of some wrapping occuring to get 80-column wide changelog file, and that indentation in default output ReST format will add some chars to each line. So this is why it was trying to recompute and re-wrap lines.

But this breaks most of commit's body message's ReSTructured text (lists, blockquote...). I would rather have the body of my messages kept untouched, and face a more than 80-column gitchangelog. I could even deal myself to this last issue by enforcing a policy to have 76-columns commit body messages if I really wanted also to have 80-column gitchangelog.

Automatically figure out what is the last version to provide to incremental changelog

As of #26 we now can have incremental changelog. But this doesn't cover another simple need that is in numerous use case: how to get automatically the lastest version already generated to create only the last last tags ?

I propose to add an option in .gitchangelog.rc that would provide a simple function that must return the last git ref that was logged. To follow the current trend, this would be a simple callable that takes no argument and must be called.
Helpers could be provided that help creating a callable from reading a given file and would apply a regex to it and return the first match::

infer_last_version = FileRegex("Changelog", r"^(?P<ref>[0-9]+.[0-9]+.[0-9])+\n--+\n\n")

Installation with pip 7.0+ is broken

While pip install gitchangelog works just ok, when invoking gitchangelog, it does not find the reference config file. I do have local .gitchangelog.rc file, but I get:

Traceback (most recent call last):
  File "/home/musttu/Code/virtualenvs/citrus/bin/gitchangelog", line 11, in <module>
    sys.exit(main())
  File "/home/musttu/Code/virtualenvs/citrus/local/lib/python2.7/site-packages/gitchangelog.py", line 1028, in main
    section_regexps=config['section_regexps'],
KeyError: 'section_regexps'

I don't specify section_regexps in my config file, so it's not found from config.

On pip 6.x, gitchangelog.rc.reference extracts to:

~/.virtualenvs/citrus/lib/python2.7/site-packages/gitchangelog.rc.reference

On pip 7.x, it extracts to:

~/.virtualenvs/citrus/gitchangelog.rc.reference

@ vaab: Would you consider checking #36 that might also fix this. It's somewhat old now, so I'm not sure.

Add support for "git log --first-parent"

I think --first-parent can be a great companion to the include_merge option, i.e. include ONLY a merge commit and no other commits in the same merge bubble.

An example use case:

* Merge commit: This is a new feature... (summarize the new feature)
\ * Child of merge commit: fix: Fix something
\ * Child of merge commit: new: Add something
\ * Child of merge commit: chg: Change something

If I choose to include merge commit now it will split these 4 commits into different sections, while they most make sense when grouped together. Actually all the things a user needs to know when reading the changelog is already summarized in the merge commit.

I hope that makes sense.

Have been using this tool with great success recently (with a heavily modified mako template though).

Incremental changelog

For several reason, building changelog incrementally is sometimes required, usually when you want to commit your CHANGELOG:

  • When wanting to switch to gitchangelog, or change your conventions:
    • part of your history is not following conventions.
    • you have a previous CHANGELOG you want to blend in.
  • You'd rather commit your changelog file:
    • For performance reason, you can then generate changelog only for the new commit and save the result.
    • Because you want to be able to edit it to make some minor edition if needed.

This would require gitchangelog to accept some rev-list type of argument, with optional detection of last revision made, and/or automatically insert in a file. This could be all driven by options in the config file, or command line arguments.

Unable to use gitchangelog under travis builds

I tried to use gitchangelog as part of the build scripts executed via travis but I discovered that it does not work as expected.

First problem is that pip install gitchangelog failed with the error below:

 Command "/home/travis/virtualenv/python2.7.9/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-I7WzDd/gitchangelog/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-KMZBF0-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/travis/virtualenv/python2.7.9/include/site/python2.7" failed with error code 1 in /tmp/pip-build-I7WzDd/gitchangelog

Full logs at https://travis-ci.org/pycontribs/jira/jobs/150580836

The second problem is that it seems that is not possible to call gitchangelog as a python module which is a real PITA. Why? Installing command line utilities via pip does not work very well in all environments (especially on Windows or different virtual environments). For this reason most Python package developers do allow you to call modules using python -m modulename [options]. This works very well and allows you to use a specific python interpreter, always knowing which one you are calling.

This can be implemented with only few lines of code. Few examples of projects that are using this approach pip, flake8, py.test, tox,...

Ability to specify the range

Hi,
It would be nice to give a range, for example "create only the changelog from the last release". My changelog contains 202046 lines (very old project :)) and I'm not interested by the older releases.

Templates are extracted to invalid location and markdown template is missing

Running the latest 2.2.0, with pystache installed and output_engine = mustache("markdown") in my .gitchangelog.rc, running gitchangelog gives:

Error: Invalid mustache template name 'markdown'.
No available mustache templates found in '/home/musttu/.virtualenvs/foobar/python2.7/site-packages/templates/mustache'.

That directory does not exist at all. Instead, the templates are directly in virtualenv root:

$ pip uninstall gitchangelog
Uninstalling gitchangelog-2.2.0:
  /home/musttu/.virtualenvs/foobar/bin/gitchangelog
  /home/musttu/.virtualenvs/foobar/gitchangelog.rc.reference
  /home/musttu/.virtualenvs/foobar/lib/python2.7/site-packages/gitchangelog-2.2.0-py2.7.egg-info
  /home/musttu/.virtualenvs/foobar/lib/python2.7/site-packages/gitchangelog.py
  /home/musttu/.virtualenvs/foobar/lib/python2.7/site-packages/gitchangelog.pyc
  /home/musttu/.virtualenvs/foobar/templates/mako/octobercms-plugin.tpl
  /home/musttu/.virtualenvs/foobar/templates/mako/restructuredtext.tpl
  /home/musttu/.virtualenvs/foobar/templates/mustache/restructuredtext.tpl
Proceed (y/n)?

And even in this case, markdown.tpl is missing.

It fails the same way without virtualenv (templates get extracted to /usr/local/templates, is it intentional?)

Some issues with installation scripts?

KeyError: 'ignore_regexps' when running gitchangelog

Traceback (most recent call last):
  File "/usr/local/bin/gitchangelog", line 9, in <module>
    load_entry_point('gitchangelog==2.2.0', 'console_scripts', 'gitchangelog')()
  File "/usr/local/lib/python2.7/site-packages/gitchangelog.py", line 1029, in main
    ignore_regexps=config['ignore_regexps'],
KeyError: 'ignore_regexps'

Why could this be happening? I just pip install gitchangelog and then run gitchangelog this is my list of pip packages installed

ansible (1.6.10)
ecdsa (0.11)
gitchangelog (2.2.0)
Jinja2 (2.7.3)
Mako (1.0.1)
MarkupSafe (0.23)
paramiko (1.15.1)
pip (1.5.6)
pycrypto (2.6.1)
pystache (0.5.4)
PyYAML (3.11)
setuptools (8.0.2)
vboxapi (1.0)
wsgiref (0.1.2)

TypeError: 'str' object does not support item assignment

Hey,

i just installed version 2.0.0 from pypi, thinking this would be a great companion to my very own http://github.com/peritus/bumpversion โ€” however, i can't seem to get it to work (this happens with no configuration and with the sample configration as .gitchangelog.rc in the root of the git repository):

$> gitchangelog
Traceback (most recent call last):
  File "/usr/local/share/python//gitchangelog", line 9, in <module>
    load_entry_point('gitchangelog==2.0.0', 'console_scripts', 'gitchangelog')()
  File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/gitchangelog.py", line 708, in main
    gc_rc = repository.config.get("gitchangelog", {}).get('rc-path')
  File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/gitchangelog.py", line 381, in config
    return inflate_dict(dct_options)
  File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/gitchangelog.py", line 155, in inflate_dict
    mset(res, k, dct[k], sep, deep)
  File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/gitchangelog.py", line 149, in mset
    deep=-1 if deep < 0 else deep - 1)
  File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/gitchangelog.py", line 149, in mset
    deep=-1 if deep < 0 else deep - 1)
  File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/gitchangelog.py", line 142, in mset
    dct[k] = v
TypeError: 'str' object does not support item assignment

BTW: Your TODO list contains "More Tests", and i think they are essential for this kind of application. Have a look at https://github.com/peritus/bumpversion/blob/master/tests.py (and the overall setup there, including Travis CI) as an inspiration.

Using git notes

Git notes could be used to:

  • allow afterthoughts re-wording of commits
  • allow to effectively replace usage of commit message content (for those that would prefer this method)
    • add more info / entries to a commit.

Support of using git note could really be a good addition to gitchangelog, at the condition we find a nice way to allow different usage scenarios.

Windows Support

I saw many issues and PRs reported regarding Windows support.

From my understanding this tool doesn't work on Windows yet. Am I right ?

Installation via pip fails on OSX 10.9.2

I'm on a different system and installing the package via pip 1.5.5 fails again.

$ pip install gitchangelog
Downloading/unpacking gitchangelog
  Downloading gitchangelog-2.1.2.tar.gz
  Running setup.py (path:/private/var/folders/_r/d4klmxy136g99ks6x0s58sb00000gn/T/pip_build_cduquett/gitchangelog/setup.py) egg_info for package gitchangelog

Installing collected packages: gitchangelog
  Running setup.py install for gitchangelog
    error: can't copy 'gitchangelog.rc.reference': doesn't exist or not a regular file
    Complete output from command /usr/local/opt/python/bin/python2.7 -c "import setuptools, tokenize;__file__='/private/var/folders/_r/d4klmxy136g99ks6x0s58sb00000gn/T/pip_build_cduquett/gitchangelog/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/_r/d4klmxy136g99ks6x0s58sb00000gn/T/pip-aaJNVF-record/install-record.txt --single-version-externally-managed --compile:
    running install

running build

running build_py

creating build

creating build/lib

copying gitchangelog.py -> build/lib

running install_lib

copying build/lib/gitchangelog.py -> /usr/local/lib/python2.7/site-packages

byte-compiling /usr/local/lib/python2.7/site-packages/gitchangelog.py to gitchangelog.pyc

running install_data

error: can't copy 'gitchangelog.rc.reference': doesn't exist or not a regular file

----------------------------------------
Cleaning up...
Command /usr/local/opt/python/bin/python2.7 -c "import setuptools, tokenize;__file__='/private/var/folders/_r/d4klmxy136g99ks6x0s58sb00000gn/T/pip_build_cduquett/gitchangelog/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/_r/d4klmxy136g99ks6x0s58sb00000gn/T/pip-aaJNVF-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /private/var/folders/_r/d4klmxy136g99ks6x0s58sb00000gn/T/pip_build_cduquett/gitchangelog
Storing debug log for failure in /Users/cduquett/.pip/pip.log

Fails on standard install and sample configuration file

I installed gitchangelog in a virtualenv (/work/tools/zest.releaser/). (I do not think the problem is related to this.)

$ cd
$ /work/tools/zest.releaser/bin/gitchangelog

Calling gitchangelog in the root of a git repo, with the sample configuration file installed in ~/.gitchangelog.rc, causes the following traceback:

Traceback (most recent call last):
  File "/work/tools/zest.releaser/bin/gitchangelog", line 9, in <module>
    load_entry_point('gitchangelog==2.0.0', 'console_scripts', 'gitchangelog')()
  File "/work/tools/zest.releaser/lib/python2.7/site-packages/gitchangelog.py", line 708, in main
    gc_rc = repository.config.get("gitchangelog", {}).get('rc-path')
  File "/work/tools/zest.releaser/lib/python2.7/site-packages/gitchangelog.py", line 381, in config
    return inflate_dict(dct_options)
  File "/work/tools/zest.releaser/lib/python2.7/site-packages/gitchangelog.py", line 155, in inflate_dict
    mset(res, k, dct[k], sep, deep)
  File "/work/tools/zest.releaser/lib/python2.7/site-packages/gitchangelog.py", line 149, in mset
    deep=-1 if deep < 0 else deep - 1)
  File "/work/tools/zest.releaser/lib/python2.7/site-packages/gitchangelog.py", line 149, in mset
    deep=-1 if deep < 0 else deep - 1)
  File "/work/tools/zest.releaser/lib/python2.7/site-packages/gitchangelog.py", line 142, in mset
    dct[k] = v
TypeError: 'str' object does not support item assignment

Provide more lowlevel information to templates

Some templating mecanism have full python capabilities (mako for instance), and providing an already limited and parsed output limit a lot their expressiveness. By staying compatible with standard python interface and simple objects (dict-like and list-like), it could be a good idea to give full blown git commit object for instance, where information could be added as the need for them would come.

Here are a few ideas of lowlevel information that we could want:

  • all GitCommit attributes
  • diff-stat (list of file modified)
  • boolean for merge commit or not

We don't want to fill memory in really large git history, so this feature should come after some type of lazy evaluation is implemented (see #19).

versions

is there any documentations/examples somewhere of how to maintain version numbers using gitchangelog?

Document default behavior

By default, gitchangelog makes sections under each version by builtin rules. At least following rules are followed:

  • new: as "New"
  • chg: as "Changes"
  • fix: as "Fixes"

This behavior is not documented anywhere. The default sectioning can be overridden by custom config file and section_regexps. Still, however, documentation should describe the default behavior.

There is a sample configuration file, but that's different from telling what the defaults are.

Or is reference config used as defaults? The behavior seems a bit inconsistent:

  • section_regexps are not completely replaced (prefixes are still snipped)
  • ignore_regexps is

Did not try other params.

use "git tag" for marking a release

I am using tags for marking releases:

$ git tag
v1.0
v1.1
v1.1.2
v1.1.3

My expectation is that gitchangelog would use tags as releases headers and prints the commit between tags.

But currently only one release header unreleased is created:

Changelog
=========


%%version%% (unreleased)
------------------------
- Bump version. [Max Muster]
- Use KeyValueMetadata.update in view. [Max Muster]

  - KeyValueMetadata._load_original() to load original content and try to
    keep original field ordering
  - some list comprehension magic in KeyValueMetadata.update to keep the
    ordering

Templates for others formats ?

Setup on Windows guide

Been trying to get this tool setup on Windows with no luck. Got Python 3.2 running, but the instructions just don't seem to be clear enough how to get going. Am I missing something? Clarification would be useful. Thanks

Is template feature not working in expected. Is it bug?

i installed gitchangelog by sudo pip install gitchagelog

and i try test template feature.
but, i can't get what i expected.

here is some example

[~/temp/gitchangelog]$ uname -a                                      *[master]
Darwin pyoung.local 15.5.0 Darwin Kernel Version 15.5.0: Tue Apr 19 18:36:36 PDT 2016; root:xnu-3248.50.21~8/RELEASE_X86_64 x86_64

[~/temp/gitchangelog]$ diff .gitchangelog.rc gitchangelog.rc.reference
181c181
< #output_engine = rest_py

---
> output_engine = rest_py
183c183
< output_engine = mustache("markdown")

---
> #output_engine = mustache("markdown")


[~/temp/gitchangelog]$ gitchangelog                                  *[master]
Error: Invalid mustache template name 'markdown'.
No available mustache templates found in '/usr/local/lib/python2.7/site-packages/templates/mustache'.


[~/temp/gitchangelog]$ ./gitchangelog                                *[master]
# Changelog

## 2.3.0 (2015-09-25)

### Fix
.
.
.

i was clone gitchangelog to ~/temp/gitchangelog
but when i try to generate by gitchangelog not ./gitchangelog, it's failed.

i supposed that caused by __file__ path based.

https://github.com/vaab/gitchangelog/blob/master/gitchangelog.py#L663

template_dir = os.path.join(
        os.path.dirname(os.path.realpath(__file__)),
        "templates", label)

  • Is this working in expected? or Bug?
  • In additional, Could you add feature that specifiy template_dir from .gitchangelog.rc by optional.

sorry, i found pull request about that. #46

Unreleased Version

Where do you specify the %%version%% for unreleased version that's in the rc file?

Also on another note: How do you go about exporting the respond from gitchangelog to a file? Do you have a process around this built in or do you manage it by hand?

Installation via pip failed on OSX 10.9.2

Environment

Mac OSX 10.9.2
Python 2.7.6
Pip 1.5.4

Output

$ pip install gitchangelog
Downloading/unpacking gitchangelog
  Downloading gitchangelog-2.1.0.tar.gz
  Running setup.py (path:/private/var/folders/39/65psh3055pz7931lp18l_jv8d4rpv6/T/pip_build_xxxx/gitchangelog/setup.py) egg_info for package gitchangelog

Installing collected packages: gitchangelog
  Running setup.py install for gitchangelog
    error: can't copy 'gitchangelog.rc.reference': doesn't exist or not a regular file
    Complete output from command /usr/local/opt/python/bin/python2.7 -c "import setuptools, tokenize;__file__='/private/var/folders/39/65psh3055pz7931lp18l_jv8d4rpv6/T/pip_build_xxxx/gitchangelog/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/39/65psh3055pz7931lp18l_jv8d4rpv6/T/pip-bTXANp-record/install-record.txt --single-version-externally-managed --compile:
    running install

running build

running build_py

creating build

creating build/lib

copying gitchangelog.py -> build/lib

running install_lib

copying build/lib/gitchangelog.py -> /usr/local/lib/python2.7/site-packages

byte-compiling /usr/local/lib/python2.7/site-packages/gitchangelog.py to gitchangelog.pyc

running install_data

error: can't copy 'gitchangelog.rc.reference': doesn't exist or not a regular file

----------------------------------------
Cleaning up...
Command /usr/local/opt/python/bin/python2.7 -c "import setuptools, tokenize;__file__='/private/var/folders/39/65psh3055pz7931lp18l_jv8d4rpv6/T/pip_build_casey.duquette/gitchangelog/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/39/65psh3055pz7931lp18l_jv8d4rpv6/T/pip-bTXANp-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /private/var/folders/39/65psh3055pz7931lp18l_jv8d4rpv6/T/pip_build_xxxx/gitchangelog
Storing debug log for failure in /Users/xxxx/.pip/pip.log

Configurable Template Path

Template path should be independent of the package path best configurable via ~/.gitconfig

[gitchangelog]
rc-path = ~/.gitchangelog/gitchangelog.rc
template-path = ~/.gitchangelog/templates

Python 3 - unreliable failing behavior

When launching gitchangelog on my python 3.4.2, I get sometimes full changelog, but sometimes it's empty, and other times it bails out with this traceback::

Traceback (most recent call last):
  File "./gitchangelog", line 1052, in <module>
    main()
  File "./gitchangelog", line 1034, in main
    subject_process=config.get("subject_process", noop),
  File "./gitchangelog", line 860, in changelog
    for tag in reversed(repository.tags)
  File "./gitchangelog", line 605, in tags
    key=lambda x: int(x.committer_date_timestamp))
  File "./gitchangelog", line 605, in <lambda>
    key=lambda x: int(x.committer_date_timestamp))
ValueError: invalid literal for int() with base 10: 'tag 0.1.0\nTagger: Valentin Lab <[email protected]>\n\nInitial release\n\n1309333456'

Could this come from the Phile and subprocess piping ?

Generate changelog for a subdirectory

In some case, we can want to generate sort of a sub-changelog in a subdirectory.

For instance, you could be using a framework supporting addons/modules. Each of which are not always separated in individual sub-git. Nevertheless, they have version information, and could need a proper changelog.

git show - separate paths from revisions

Hi.

I fetch error with gitchangelog.py (error from git)

Short error description:
<<<
[dimti@prototype digitec]$ git show -s import-export-cli
fatal: ambiguous argument 'import-export-cli': both revision and filename
Use '--' to separate paths from revisions, like this:
'git [...] -- [...]'

[dimti@prototype digitec]$ git show -s import-export-cli --
commit 5d947848c154753e49ca210cb543ae4d3277ce55

A have two objects with name "import-export-cli"
Path in root folder of git repositroy
Tag
After add tag "import-export-cli", Im fetching that error with use gitchangelog.py
<<<
Traceback (most recent call last):
File "/mnt/passport/opt/gitchangelog/gitchangelog.py", line 267, in getattr
% (identifier, aformat))
File "/mnt/passport/opt/gitchangelog/gitchangelog.py", line 228, in swrap
return self._repos.swrap(_args, *_kwargs)
File "/mnt/passport/opt/gitchangelog/gitchangelog.py", line 438, in swrap
return swrap(command, *_kwargs)
File "/mnt/passport/opt/gitchangelog/gitchangelog.py", line 214, in swrap
return wrap(command, *_kwargs).strip()
File "/mnt/passport/opt/gitchangelog/gitchangelog.py", line 207, in wrap
errlvl=errlvl, command=command, out=out, err=err)
main.ShellError: Wrapped command 'cd /mnt/passport/var/www/digitec; git show -s import-export-cli --pretty=format:%s%x00%B%x00%ad%x00%an%x00%H%x00%b%x00%at%x00%ct%x00%cn' exited with errorlevel 128.
stderr:
| fatal: ambiguous argument 'import-export-cli': both revision and filename
| Use '--' to separate paths from revisions, like this:
| 'git [...] -- [...]'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/mnt/passport/opt/gitchangelog/gitchangelog.py", line 839, in
main()
File "/mnt/passport/opt/gitchangelog/gitchangelog.py", line 821, in main
output_engine=config.get("output_engine", rest_py),
File "/mnt/passport/opt/gitchangelog/gitchangelog.py", line 686, in changelog
for tag in reversed(repository.tags)
File "/mnt/passport/opt/gitchangelog/gitchangelog.py", line 444, in tags
key=lambda x: int(x.committer_date_timestamp))
File "/mnt/passport/opt/gitchangelog/gitchangelog.py", line 444, in
key=lambda x: int(x.committer_date_timestamp))
File "/mnt/passport/opt/gitchangelog/gitchangelog.py", line 270, in getattr
% self.identifier)
ValueError: Given commit identifier import-export-cli doesn't exists

Only use the commit subject in the changelog.

It looks like gitchangelog uses the entire commit in the changelog. However, this is rather heavy and leads to cumbersome changelogs. The commit subject (the first line) should be describing the commit at a high level, with the rest of the commit message being lower-level details. For example, see here:

Fixes
~~~~~

- Abort with an error if the bulb closes the connection (fixes #5).
  [Stavros Korokithakis]

- Flow API improvements (#3) [Teemu R]

  * Flow API improvements

  1. Cast brightness always to int.
  2. Raise an exception when supplied with more than maximum amount of transitions.
  3. Supply repr dunders.

  * Flow: use warning instead of exception for invalid values. Add check for brightness' validity.

  * Change warning to display for over 9 messages.

  * Silently clamp brightness to 100, as elsewhere.

This is a side-effect of the merging process, and is rather ugly in this case, but it generally seems to me that only the first line should be included. That would make the changelog much prettier (assuming I had taken care to write proper commit messages, which is a sound assumption).

Can I deactivate sectioning ?

For some project, I'd like to deactivate sectioning ("new", "changes"...). I understand that I can do it with some work:

  • changing regexp in .gitchangelog.rc so that all commit messages goes to one default section.
  • providing my own template in mustache or mako that would avoid printing the section name.

This is not straightforward, and maybe disabling sectionning should be easier and supported by the default gitchangelog templates.

Default formatting is not the one showing on pypi

I've used the default gitchangelog.rc.reference to generate a change log for my project. However, I didn't get the (nicer) formatting expected as seen on the pypi page. Although the pypi page says: And the rendered full result is directly used to generate the HTML webpage of the changelog of the PyPI page.", I don't get the same result. In my output there's "Change-Id.." and extra newlines, like:

Changelog
=========

0.3.0 (2015-03-08)
------------------

- Doco update. [Lars Stavholm]

  Change-Id: Ib81c683769d31a1b4923df0f2ec937b2ad22f04a


- Rearranged rack files. [Lars Stavholm]

  Change-Id: I2a31001299c283d23b69db1622aec633e891abaa


- Updated. [Lars Stavholm]

  Change-Id: I6aa8fd0c479617257f6325b1ca16366ec582bbe3

Lazy evaluation while generating the changelog

Currently the changelog data are all built up in python memory in simple object (dict and list), then it's fed to the templating mecanisms. This eats up a lot of memory and is not scalable to big commit history.

A kind of lazy evaluation (through iterator for instances or lazy evaluating dict/list-like objects) should be implemented.

Feature request: View Changes per tag

It would be nice if we can filter CHANGELOG per tag

something like

$~ gitchangelog --tag 1.0.5
OR
$~ gitchangelog 1.0.5
(Should display only 1.0.5 tag changes)

gitchangelog.rc.reference not found

Hi,

I have just installed the last version of gitchangelog (version 2.5.1) on a Python 3.5 virtualenv (same with Python 2.7), but the command failed with the following message:

Config reference file '/Users/me/virtualenv/py-gitchangelog/lib/python3.5/site-packages/gitchangelog.rc.reference' not found.

Is this file missing in the library? Is it a packaging error?

How to reproduce:

$ mkvirtualenv -p python3 py-gitchangelog
Running virtualenv with interpreter /Library/Frameworks/Python.framework/Versions/3.5/bin/python3
[boring stuf...]

(py-gitchangelog) $ pip install gitchangelog
Collecting gitchangelog
Installing collected packages: gitchangelog
Successfully installed gitchangelog-2.5.1

(py-gitchangelog) $ pip list
Package      Version 
------------ --------
appdirs      1.4.0   
gitchangelog 2.5.1   
packaging    16.8    
pip          9.0.1   
pyparsing    2.1.10  
setuptools   34.2.0  
six          1.10.0  
wheel        0.30.0a0

(py-gitchangelog) $ cd ~/workspace/my_project
(py-gitchangelog) $ ls .gitchangelog.rc 
.gitchangelog.rc

(py-gitchangelog) $ gitchangelog 
Config reference file '/Users/me/virtualenv/py-gitchangelog/lib/python3.5/site-packages/gitchangelog.rc.reference' not found.

I'm on OS X.

Check the config file before to read it

Hello,
It would be cool to check:

  • if the config file exists before to read it
  • if the section exists
$ gitchangelog
Traceback (most recent call last):
  File "/home/sdouche/.pyenv/versions/default/bin/gitchangelog", line 11, in <module>
    sys.exit(main())
  File "/home/sdouche/.pyenv/versions/3.5.1/envs/default/lib/python3.5/site-packages/gitchangelog.py", line 1030, in main
    ignore_regexps=config['ignore_regexps'],
KeyError: 'ignore_regexps'

Perfomance on big git repositories

Hello.
Im use gitchangelog for version control in my company.
An big git repositories work gitchangelog is slow.

I often released my app (2-3 per day) and gitchangelog every time processed my big git repository (for create new CHANGELOG.md file).

How to tunning gitchangelog for caching results and processed only new commits?

UnicodeDecodeError: 'ascii' when running gitchangelog in Jenkins

Hi, I've used gitchangelog for a couple months in our development process. Everything was working great. But when I was trying to generate the changelog (in on of our many repositories), I get this error:

gitchangelog

Traceback (most recent call last):
  File "../gitchangelog/gitchangelog", line 1052, in <module>
    main()
  File "../gitchangelog/gitchangelog", line 1034, in main
    subject_process=config.get("subject_process", noop),
  File "../gitchangelog/gitchangelog", line 882, in changelog
    for commit in commits:
  File "../gitchangelog/gitchangelog", line 644, in log
    for key in GIT_FORMAT_KEYS]))
  File "../gitchangelog/gitchangelog", line 270, in <lambda>
    @itermap(lambda r: r.decode(_preferred_encoding))
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 24: ordinal not in range(128)

I checked the commit messages using git log:

git log > logs.txt

looks like there is one commit message with a zero-width space character <200b>. If I open the file in vim:

vi logs.txt

commit 5010274e14641e0891c0844318774741b5864947
Author: osroflo 
Date:   Tue Mar 29 10:31:39 2016 -0700

    API Enhancements*<200b>
    - Added Elasticsearch search() function to our Query library
    - Moved construction of response parameters out of controller and into Response Formatter library
    - Return a status of fail if something goes wrong with returning our API response instead of always returning status of success

Is there a way that I can fix this?

NOTE:

  • We are using jenkins to generate logs automatically.

Use annotated tag date instead of commit date when available

Hi,

I use annotated tag to number version of my code. Changelog is displayed properly, but I've just seen that the date displayed next to the tag in the log is the date of the commit that is tagged whereas I would expect to have the date of the tag itself displayed (I tag the commit when I plan to release).
Can this be configured?

Thank you,
Antoine.

Configurable ``publish`` action upon ``output_engine`` content

Currently, output is on stdout.

But we could want to:

  • directly write in a file, fully overwriting it or appending to it. Both of these are easily accessible through shell > and >>.
  • insert in the beginning of a file for obvious incremental changelog.
  • insert at point in file
  • call an executable with arguments from the commit (for instance, dch) to manage creation of an entry.
  • multiplex a few of these possibilities.

This could be achievable with a simple new variable in config file, we could call it: publish.

The default value would be stdout. The value of the variable would be a function that take the full string output as sole argument. A few function could be provided (as Multiplex, Append, Overwrite, Prepend, InsertAtPoint, Call) to cover these first needs.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.