Go to file
Siddhesh Poyarekar f2144b7874 Script to generate ChangeLog-like output from git log
Co-authored-by: Gabriel F. T. Gomes <gabriel@inconstante.net.br>
Reviewed-by: Gabriel F. T. Gomes <gabriel@inconstante.net.br>
Reviewed-by: Joseph Myers <joseph@codesourcery.com>

The utility of a ChangeLog file has been discussed in various mailing
list threads and GNU Tools Cauldrons in the past years and the general
consensus is that while the file may have been very useful in the past
when revision control did not exist or was not as powerful as it is
today, it's current utility is fast diminishing.  Further, the
ChangeLog format gets in the way of modernisation of processes since
it almost always results in rewriting of a commit, thus preventing use
of any code review tools to automatically manage patches in the glibc
project.

There is consensus in the glibc community that documentation of why a
change was done (i.e. a detailed description in a git commit) is more
useful than what changed (i.e. a ChangeLog entry) since the latter can
be deduced from the patch.  The GNU community would however like to
keep the option of ascertaining what changed through a ChangeLog-like
output and as a compromise, it was proposed that a script be developed
that generates this output.

The script below is the result of these discussions.  This script
takes two git revisions references as input and generates the git log
between those revisions in a form that resembles a ChangeLog.  Its
capabilities and limitations are listed in a comment in the script.
On a high level it is capable of parsing C code and telling what
changed at the top level, but not within constructs such as functions.

Design
------

At a high level, the script analyses the raw output of a VCS, parses
the source files that have changed and attempts to determine what
changed.  The script driver needs three distinct components to be
fully functional for a repository:

- A vcstocl_quirks.py file that helps it parse weird patterns in
  sources that may result from preprocessor defines.
- A VCS plugin backend; the git backend is implemented for glibc
- A programming language parser plugin.  C is currently implemented.

Additional programming language parsers can be added to give more
detailed output for changes in those types of files.

For input in languages other than those that have a parser, the script
only identifies if a file has been added, removed, modified,
permissions changed, etc. but cannot understand the change in content.

The C Parser
------------

The C parser is capable of parsing C programs with preprocessor macros
in place, as if they were part of the language.  This presents some
challenges with parsing code that expands macros on the fly and to
help work around that, a vcstocl_quirks.py file has transformations to
ease things.

The C parser currently can identify macro definitions and scopes and
all global and static declarations and definitions.  It cannot parse
(and compare) changes inside functions yet, it could be a future
enhancement if the need for it arises.

Testing
-------

The script has been tested with the glibc repository up to glibc-2.29
and also in the past with emacs.  While it would be ideal to have
something like this in a repository like gnulib, that should not be a
bottleneck for glibc to start using this, so this patch proposes to
add these scripts into glibc.

And here is (hopefully!) one of the last ChangeLog entries we'd have
to write for glibc:

	* scripts/gitlog_to_changelog.py: New script to auto-generate
	ChangeLog.
	* scripts/vcs_to_changelog/frontend_c.py: New file.
	* scripts/vcs_to_changelog/misc_util.py: New file.
	* scripts/vcs_to_changelog/vcs_git.py: New file.
	* scripts/vcs_to_changelog/vcstocl_quirks.py: Likewise.
2019-09-20 11:46:52 -07:00
argp Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
assert Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
benchtests Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
bits Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
catgets Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
ChangeLog.old Correct the spelling of more contributors 2019-08-29 02:50:04 -07:00
conform Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
crypt Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
csu Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
ctype Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
debug Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
dirent Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
dlfcn Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
elf Add UNSUPPORTED check in elf/tst-pldd. 2019-09-18 12:42:39 +02:00
gmon Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
gnulib Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
grp Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
gshadow Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
hesiod Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
htl Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
hurd Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
iconv Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
iconvdata Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
include Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
inet Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
intl Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
io Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
libio Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
locale Regenerate charmap-kw.h, locfile-kw.h 2019-09-09 14:16:40 -07:00
localedata Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
login Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
mach Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
malloc Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
manual Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
math Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
mathvec Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
misc Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
nis Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
nptl Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
nptl_db Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
nscd Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
nss Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
po Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
posix Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
pwd Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
resolv Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
resource Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
rt Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
scripts Script to generate ChangeLog-like output from git log 2019-09-20 11:46:52 -07:00
setjmp Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
shadow Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
signal Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
socket Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
soft-fp Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
stdio-common Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
stdlib Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
string Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
sunrpc Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
support Fix building support_ptrace.c on i686-gnu. 2019-09-19 12:26:18 +02:00
sysdeps [powerpc] SET_RESTORE_ROUND optimizations and bug fix 2019-09-19 13:02:30 -05:00
sysvipc Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
termios Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
time Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
timezone Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
wcsmbs Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
wctype Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
.gitattributes Assume __NR_openat is always defined 2016-03-23 23:35:08 +01:00
.gitignore Add *.pyc to .gitignore 2015-05-18 15:26:26 +05:30
abi-tags Remove the bulk of the NaCl port. 2017-05-20 08:09:10 -04:00
aclocal.m4 LIBC_SLIBDIR_RTLDDIR: substitute arguments in single quotes 2018-01-25 17:20:28 +01:00
ChangeLog [powerpc] SET_RESTORE_ROUND optimizations and bug fix 2019-09-19 13:02:30 -05:00
config.h.in S390: Add configure check to detect support for arch13. 2019-03-22 11:14:08 +01:00
config.make.in Make --bindir effective 2019-05-14 11:04:33 -03:00
configure Fix http: URL in 'configure' 2019-09-09 14:16:40 -07:00
configure.ac Fix http: URL in 'configure' 2019-09-09 14:16:40 -07:00
COPYING Update to latest versions of GPL-2.0 and LGPL-2.1 2013-09-09 12:52:48 +10:00
COPYING.LIB Update to latest versions of GPL-2.0 and LGPL-2.1 2013-09-09 12:52:48 +10:00
extra-lib.mk Rename cppflags-iterator.mk to libof-iterator.mk, remove extra-modules.mk. 2017-05-09 07:06:29 -04:00
gen-locales.mk Improve gen-locales.mk and gen-locale.sh to make test files with @ options work 2018-02-27 17:01:57 +01:00
INSTALL Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
libc-abis libc-abis: Define ABSOLUTE ABI [BZ #19818][BZ #23307] 2018-07-05 18:06:43 +01:00
libof-iterator.mk Rename cppflags-iterator.mk to libof-iterator.mk, remove extra-modules.mk. 2017-05-09 07:06:29 -04:00
LICENSES Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
MAINTAINERS Add MAINTAINERS 2017-05-11 13:38:30 -04:00
Makeconfig Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
Makefile Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
Makefile.in New make target to only build benchmark binaries 2016-04-20 10:23:28 +05:30
Makerules Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
NEWS Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
o-iterator.mk Fri Mar 17 12:58:37 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu> 1995-03-17 18:42:51 +00:00
README Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
Rules Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
shlib-versions Extend NSS test suite 2017-07-17 15:52:44 -04:00
test-skeleton.c Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
version.h Open master for 2.31 development. 2019-08-01 00:41:53 -04:00

This directory contains the sources of the GNU C Library.
See the file "version.h" for what release version you have.

The GNU C Library is the standard system C library for all GNU systems,
and is an important part of what makes up a GNU system.  It provides the
system API for all programs written in C and C-compatible languages such
as C++ and Objective C; the runtime facilities of other programming
languages use the C library to access the underlying operating system.

In GNU/Linux systems, the C library works with the Linux kernel to
implement the operating system behavior seen by user applications.
In GNU/Hurd systems, it works with a microkernel and Hurd servers.

The GNU C Library implements much of the POSIX.1 functionality in the
GNU/Hurd system, using configurations i[4567]86-*-gnu.

When working with Linux kernels, this version of the GNU C Library
requires Linux kernel version 3.2 or later.

Also note that the shared version of the libgcc_s library must be
installed for the pthread library to work correctly.

The GNU C Library supports these configurations for using Linux kernels:

	aarch64*-*-linux-gnu
	alpha*-*-linux-gnu
	arm-*-linux-gnueabi
	csky-*-linux-gnuabiv2
	hppa-*-linux-gnu
	i[4567]86-*-linux-gnu
	x86_64-*-linux-gnu	Can build either x86_64 or x32
	ia64-*-linux-gnu
	m68k-*-linux-gnu
	microblaze*-*-linux-gnu
	mips-*-linux-gnu
	mips64-*-linux-gnu
	powerpc-*-linux-gnu	Hardware or software floating point, BE only.
	powerpc64*-*-linux-gnu	Big-endian and little-endian.
	s390-*-linux-gnu
	s390x-*-linux-gnu
	riscv64-*-linux-gnu
	sh[34]-*-linux-gnu
	sparc*-*-linux-gnu
	sparc64*-*-linux-gnu

If you are interested in doing a port, please contact the glibc
maintainers; see https://www.gnu.org/software/libc/ for more
information.

See the file INSTALL to find out how to configure, build, and install
the GNU C Library.  You might also consider reading the WWW pages for
the C library at https://www.gnu.org/software/libc/.

The GNU C Library is (almost) completely documented by the Texinfo manual
found in the `manual/' subdirectory.  The manual is still being updated
and contains some known errors and omissions; we regret that we do not
have the resources to work on the manual as much as we would like.  For
corrections to the manual, please file a bug in the `manual' component,
following the bug-reporting instructions below.  Please be sure to check
the manual in the current development sources to see if your problem has
already been corrected.

Please see https://www.gnu.org/software/libc/bugs.html for bug reporting
information.  We are now using the Bugzilla system to track all bug reports.
This web page gives detailed information on how to report bugs properly.

The GNU C Library is free software.  See the file COPYING.LIB for copying
conditions, and LICENSES for notices about a few contributions that require
these additional notices to be distributed.  License copyright years may be
listed using range notation, e.g., 1996-2015, indicating that every year in
the range, inclusive, is a copyrightable year that would otherwise be listed
individually.