Gnulib provides the ‘vcs-to-changelog’ module to generate an output similar to the GNU ChangeLog format from metadata of source control software such as git. Here’s an example of using ‘vcs-to-changelog’:
build-aux/vcs-to-changelog.py <from_ref> <to_ref>
where <from_ref> and <to_ref> refer to the range of commits to
generate the output.
VCS To ChangeLog currently recognises changes in C source code and can traverse commits in git. Additional source frontends and source control backends may be added to the module. ‘vcs-to-changelog’ takes the following optional arguments:
-d: Run the parser debugger, used for debugging
‘vcs-to-changelog’
-q filename: Load filename as the quirks file for the
project.
The quirks file is a python module that must minimally implement a
get_project_quirks function that returns an object of type
ProjectQuirks or its subclass. The subclass may override the following
members of ProjectQuirks:
repo: Specify the project repo source control. The default value
is git.
IGNORE_LIST: A list of files to ignore in the changesets, either
because they are not needed (such as the ChangeLog) or because they are
not parseable. For example, the GNU C Library has a header file that is only
assembly code, which breaks the C parser.
MACRO_QUIRKS: A list of dictionary entries with indexes as
orig and sub where orig is a Python regular expression
pattern to match and sub is the substitution. These substitutions are
used to work around C/C++ macros that are known to break parsing of C programs.
C_MACROS: This is a list of C preprocessor macro definitions that
are extensively used and are known to break parsing due to some characteristic,
mainly the lack of a semicolon at the end.