This is the mail archive of the
mailing list for the glibc project.
Re: [PATCH] Script to generate ChangeLog-like output from git log
- From: "Gabriel F. T. Gomes" <gabriel at inconstante dot net dot br>
- To: Siddhesh Poyarekar <siddhesh at gotplt dot org>
- Cc: <libc-alpha at sourceware dot org>, <carlos at redhat dot com>, <joseph at codesourcery dot com>
- Date: Fri, 20 Sep 2019 13:50:44 -0300
- Subject: Re: [PATCH] Script to generate ChangeLog-like output from git log
- References: <firstname.lastname@example.org>
Thank you so much for doing this. The patch looks good to me, although I
think it would be a little bit better to use the commit date, instead of
the author date, because it would make the order of the commits look a bit
more sane and it would more closely resemble what we have today.
To achieve this, you could apply the following patch on top of yours.
If you think that's nice, you have my OK to commit it with the change. If
you would prefer to have the Author Date in the ChangeLog output, I'm also
OK with it! Thanks again!
Also, 'git am' warned that misc_util.py adds a new blank line at EOF.
Here's the diff I mentioned above:
diff --git a/scripts/vcs_to_changelog/vcs_git.py b/scripts/vcs_to_changelog/vcs_git.py
index f17846c385..b5da93f804 100644
@@ -48,7 +48,7 @@ class GitRepo:
calling into helper functions as necessary.
- op = self.exec_git_cmd(['show', '--date=short', '--raw', commit])
+ op = self.exec_git_cmd(['show', '--pretty=fuller', '--date=short', '--raw', commit])
authors = 
date = ''
merge = False
@@ -64,8 +64,8 @@ class GitRepo:
author = l.split(':')
author = re.sub(r'([^ ]*)\s*(<.*)', r'\1 \2', author.strip())
- elif l.find('Date:') == 0:
- date = l[5:].strip()
+ elif l.find('CommitDate:') == 0:
+ date = l[11:].strip()
elif l.find('Merge:') == 0:
merge = True
elif not subject and date:
On Tue, 17 Sep 2019, Siddhesh Poyarekar wrote:
>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.
This is the fast-forward block I commented below.
It looks pretty cool to me as is, actually.
>The script has been tested with the glibc repository up to glibc-2.30
>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.
I checked on a Fedora 30 x86_64 machine, with and without the change to
CommitDate, and the results look good to me.
>And here is (hopefully!) one of the last ChangeLog entries we'd have
>to write for glibc:
>+ # Consume everything up to the ending brace of the function.
>+ (cur, loc) = self.fast_forward_scope(cur, op, loc)
Neat! I run this with extra printfs in the code, and notice that the
whole function implementation goes into the 'contents' field, which can
later be compared by 'compare_trees'.
>+ DebugUtil.eprint('Failed to decode: %s' % string)
New blank line at EOF, as warned by git am.