[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] gitlog-to-changelog: provide a ChangeLog-repair mechanism
From: |
Jim Meyering |
Subject: |
Re: [PATCH] gitlog-to-changelog: provide a ChangeLog-repair mechanism |
Date: |
Wed, 02 Nov 2011 08:15:59 +0100 |
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.
...
>
> Here's a proposed patch. Though note that I will move some description
> and the example from the ChangeLog into the code:
> ======================================================================
>
>>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
...
> + # Barf if we fail to use an entry in the --amend=F specified file.
> + my $fail = 0;
> + if ($amend_code)
> + {
> + foreach my $sha (keys %$amend_code)
> + {
> + warn "$ME:$amend_file: unused entry: $sha\n";
> + $fail = 1;
> + }
> + }
That outer "if" was not needed:
diff --git a/build-aux/gitlog-to-changelog b/build-aux/gitlog-to-changelog
index 139f0af..33b5081 100755
--- a/build-aux/gitlog-to-changelog
+++ b/build-aux/gitlog-to-changelog
@@ -287,15 +287,12 @@ sub parse_amend_file($)
or die "$ME: error closing pipe from " . quoted_cmd (@cmd) . "\n";
# FIXME-someday: include $PROCESS_STATUS in the diagnostic
- # Barf if we fail to use an entry in the --amend=F specified file.
+ # Complain about any unused entry in the --amend=F specified file.
my $fail = 0;
- if ($amend_code)
+ foreach my $sha (keys %$amend_code)
{
- foreach my $sha (keys %$amend_code)
- {
- warn "$ME:$amend_file: unused entry: $sha\n";
- $fail = 1;
- }
+ warn "$ME:$amend_file: unused entry: $sha\n";
+ $fail = 1;
}
exit $fail;