bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] gitlog-to-changelog: provide a ChangeLog-repair mechanism


From: Eric Blake
Subject: Re: [PATCH] gitlog-to-changelog: provide a ChangeLog-repair mechanism
Date: Tue, 01 Nov 2011 11:44:29 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.23) Gecko/20110928 Fedora/3.1.15-1.fc14 Lightning/1.0b3pre Mnenhy/0.8.4 Thunderbird/3.1.15

On 11/01/2011 11:15 AM, Jim Meyering wrote:
I've been thinking about this for years, ever since the unpleasantness
of that first git commit that I mistakenly attributed to myself.

With this new --amend=FILE option, you'll be able to maintain
a list of<SHA,CODE+>  pairs where SHA is a 40-byte SHA1
(alone on a line) referring to a commit in the current project, and
CODE refers to one or more consecutive lines of Perl code.
Pairs must be separated by one or more blank lines.
Using that file, invoke gitlog-to-changelog with this new option,
and it'll do the rest.

Is there some way to use 'git notes' as a way of generating these fixups as notes attached to the various commits they are meant to fix, in a known namespace, and to thus generate FILE by doing a git notes listing of all commits with an attached note?

That would make using this a bit better than having to hand-maintain a touchup file. But even without 'git notes', having this option to fix history makes sense, and I'm glad to see it made available.

From c190d4ffca4643e40cc22a953ef55f2944bebdd8 Mon Sep 17 00:00:00 2001
From: Jim Meyering<address@hidden>
Date: Tue, 1 Nov 2011 18:04:21 +0100
Subject: [PATCH] gitlog-to-changelog: provide a ChangeLog-repair mechanism

Git logs are often treated as immutable, because editing them
changes the SHA1 checksums of all descendants.  Thus, errors in
git logs tend to stay there forever.  However, when we generate
a ChangeLog file -- typically for distribution -- from that git log,
we can actually make corrections in the generated file.  The key
lies in recording in machine-readable/applicable form the desired
corrections.  For example, here's one from coreutils:
     3a169f4c5d9159283548178668d2fae6fced3030
     # fix title:
     s/all tile types/all file types/
It specifies a commit SHA1 value (the first line), optional comments,
and a simple sed-style expression to perform the correction.  Note
that if you want to perform two substitutions, you must use a
semicolon to separate them, even if you put them on separate lines.
* build-aux/gitlog-to-changelog (parse_amend_file): New function.
(usage): Describe it; alphabetize option descriptions.
(main): Honor the new option, carefully.

Can this also be used in conjunction with Gary's proposed patches to add secondary authorship information, so that the changelog entry can be touched up to list multiple authors? That is, these touchups should be applied prior to the point of parsing for well-known markers used to alter changelog metadata.

--
Eric Blake   address@hidden    +1-801-349-2682
Libvirt virtualization library http://libvirt.org



reply via email to

[Prev in Thread] Current Thread [Next in Thread]