Skip to content

Git and Automatic ChangeLog Generation

After our move to use Git and GitHub to host our repository I got thinking about ChangeLogs. Having a version controlled file, where you manually add details about what the version control system should be recording seems like it should not be necessary. I searched and couldn't find a solution that generates ChangeLogs in the style we prefer, which is a variant of the GNU ChangeLog.

So I wrote a quick Python script to try and accomplish this task. It may not be the prettiest Python code as I have never written more than five or six lines of Python before. ChangeLogs always seemed to be the biggest source of merge conflicts whenever we would work in branches, or just all be working at the same time. This is why I think it is necessary to automatically generate something like this that can be generated with source tarballs.

I called it gitlog2changelog.py and it has all of the basics down already. It may not be the most general script but works pretty well for us. I need to add some extra parsing for file creation/deletion so that we can add the + or - in front of the file names. Is there a general need for this? Are there better scripts out there that I dd not spot?

2008-12-29  Tim Vandermeersch <email@protected>

  ∗ libavogadro/src/pluginmanager.cpp: replace getenv(...) with
  QProcess::systemEnvironment()

  ∗ libavogadro/src/elementtranslate.h: Replace "A_DECL_EXPORT extern ..." with
  "A_EXPORT extern ..."

  ∗ CMakeLists.txt: use /MD compiler flag for MSVC

2008-12-28  Marcus D. Hanwell <email@protected>

  ∗ libavogadro/src/molecule.cpp, libavogadro/src/molecule.h,
  libavogadro/src/python/molecule.cpp: Lots of documentation updates,
  reorganised the functions and grouped in Doxygen tags. Some minor changes
  too, more are needed for const correctness.

  ∗ testfiles/multicubes.cube.gz: Removed from our source as it is the same
  size as all the other files put together. May be we should provide a more
  extensive sample of files in a separate distribution.

  ∗ libavogadro/src/engines/bsdyengine.cpp: Ported to use the new bond position
  functions.

  ∗ libavogadro/src/bond.cpp, libavogadro/src/bond.h: Added functions to
  retrieve bond positions, still need to implement the mid-point function.

  ∗ libavogadro/src/bond.h: Documentation updates.

  ∗ libavogadro/src/python/bond.cpp: Added missing Atom include.

  ∗ libavogadro/src/atom.cpp, libavogadro/src/atom.h: Documentation updates,
  added member function groupings and a destructor.

  ∗ libavogadro/src/atom.cpp, libavogadro/src/bond.cpp, libavogadro/src/bond.h:
  Added some atom accessor functions to the Bond class. This should make using
  bonds easier. Fixed assignment order in Atom constructor.

Trackbacks

No Trackbacks

Comments

Display comments as Linear | Threaded

hades on :

hadesOnce I googled "git changelog" to find out what has changed from 1.6.0.1 to 1.6.0.2 (or something like that) and found tons of different generate-changelog-from-git-log scripts.

I suppose every project write their own script, if they need it.

Btw, I had to surf from kernel.org to find git's own changelog, google proved helpless.

Marcus D. Hanwell on :

Marcus D. HanwellI found a few questions on mailing lists but didn't come across something that gave the format I was used to. I found the git changelog stuff as I was reading through the git documentation. The problem is that this isn't the format I and others in our project are used to. I think I agree with Ian that there is limited value in distributing ChangeLogs and am personally uncertain whether we should bother or not.

I am open to opinions one way or the other on this. Especially when the repo is publicly accessible and anyone can grab it or view it from their browser.

Ian Monroe on :

Ian MonroeThe problem with this (and you're not the first I've seen do it) is you get bunk changelog entries like "replace getenv(...) with QProcess::systemEnvironment()". What does that mean to the user?

I really don't get the point of saving the git log into the CHANGELOG. The only people it means anything to have access to 'git log'.

Marcus D. Hanwell on :

Marcus D. HanwellI guess some of us don't let go of these things as easily. The main point I saw was for the tarballs when making new releases and the fact that so many of us are familiar with this format. I was surprised it wasn't a supported format for git log.

I agree with you that for users it is fairly useless, and our repository is available online for all to browse. A what's new style section is often much more useful and we tend to do that too. For me part of the motivation was to write something in Python and see if it was possible to generate this kind of thing should we want to distribute it with our sources.

Geoff Hutchison on :

Geoff HutchisonFor most users, I think a "NEWS" file is more important. We already do that on our wiki.

I think there are a few advantages of full ChangeLogs for more technically adept users and packagers. That way, you can see if particular bugs have been fixed, etc. Yes. the repository is open, but it's often faster to look through a good ChangeLog.

JP on :

JPI think this is a great script that saves us all some time analyzing the amount of data contained in a changelog, Thanks and good job, I just added it to my project.

Berry on :

BerryFantastic!! Thanks for the wonderful script!

Add Comment

Enclosing asterisks marks text as bold (*word*), underscore are made via _word_.
Standard emoticons like :-) and ;-) are converted to images.
E-Mail addresses will not be displayed and will only be used for E-Mail notifications.

To prevent automated Bots from commentspamming, please enter the string you see in the image below in the appropriate input box. Your comment will only be submitted if the strings match. Please ensure that your browser supports and accepts cookies, or your comment cannot be verified correctly.
CAPTCHA 1CAPTCHA 2CAPTCHA 3CAPTCHA 4CAPTCHA 5


You can use [geshi lang=lang_name [,ln={y|n}]][/geshi] tags to embed source code snippets.