git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Generating GNU-style Changelog from git commits

From
MHMarcus D. Hanwell <marcus.hanwell@kitware.com>
Date
Apr 17, 2011, 01:47 UTC
Message-ID
<BANLkTikQvOkoFSXXC3oUKQfASo8==qdgxA@mail.gmail.com>
In-Reply-To
<4DAA3A0D.6070904@gmail.com>
On Sat, Apr 16, 2011 at 8:53 PM, Chris Packham <judge.packham@gmail.com> wrote:
Show 35 quoted lines
> On 17/04/11 10:46, David Chanters wrote:
>>
>> [Please Cc me on replies.  Thanks!]
>>
>> Hi,
>>
>> Some projects maintain a ChangeLog file, which looks something like this:
>>
>> 2011-01-01  David Chanters<d.c@example.com>
>>         * foo/bar.c (some_function):
>>          Changed static variable in some_function to auto.
>>
>> etc., etc.
>>
>> Here "foo" is some directory relative to the top-level directory the
>> .git one is in.
>>
>> These ChangeLog files are maintained manually, irrespective of the/any
>> revision control system in use.  I am wondering if it's possible if
>> the project is in Git to be able to automatically append to such a
>> ChangeLog file with each commit automatically, and have it formatted
>> in the style above.
>>
>> Is this possible?  Is it a solved problem?  If not, and I wanted to
>> try myself, could someone point me at the git-specific tools I'd need
>> to know to use to achieve it?
>
> Shouldn't be to hard, there are numerous hooks that could be used either on
> the developer end (post-commit), on the server end (post-update) or even
> when a maintainer applies a patch (post-applypatch). See githooks(5) for
> more info on what hooks are available and what args are passed.
>
> There is also the possibility of generating this changelog at the time of
> release. I'd advocate this approach as it would allow you to edit the
> changelog to make it more useful to readers.

Something I wrote a few years ago does this for us. It may not be perfect, but there was a desire to have a Changelog in our released tarballs,

https://github.com/cryos/avogadro/blob/master/scripts/gitlog2changelog.py

If there are better ways of doing this I would certainly be interested, but have not spent much time on this since writing the initial script. We had a similar desire, but didn't want to end up resolving conflicts around a file in version control.

Marcus
Previous: Chris PackhamNext: David Chanters
Message 3 of 4 in “Generating GNU-style Changelog from git commits”
  1. David ChantersApr 16, 2011
  2. Chris PackhamApr 17, 2011
  3. Marcus D. HanwellApr 17, 2011
  4. David ChantersApr 17, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.