1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-22 10:19:57 +01:00

Extend gitlog-to-changelog option --tear-off.

--
It is now possible to suppress git log entries from being copied to
the ChangeLog by using the option --tear-off and having a "--" line
as the first line in the body (like this very log entry).

Note that the GnuPG master branch is the canonical source for our
version of the gitlog-to-changelog script.
This commit is contained in:
Werner Koch 2012-01-25 11:58:54 +01:00
parent deee8147aa
commit 2a5f61c477

View File

@ -3,13 +3,13 @@ eval '(exit $?0)' && eval 'exec perl -wS "$0" ${1+"$@"}'
if 0;
# Convert git log output to ChangeLog format.
my $VERSION = '2012-01-20 10:14'; # UTC
my $VERSION = '2012-01-24 15:58 (wk)'; # UTC
# The definition above must lie within the first 8 lines in order
# for the Emacs time-stamp write hook (at end) to update it.
# If you change this file with Emacs, please let the write hook
# do its job. Otherwise, update this string manually.
# Copyright (C) 2008-2011 Free Software Foundation, Inc.
# Copyright (C) 2008-2012 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -25,6 +25,7 @@ my $VERSION = '2012-01-20 10:14'; # UTC
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Written by Jim Meyering
# Custom bugs bred by Werner Koch
use strict;
use warnings;
@ -64,7 +65,8 @@ OPTIONS:
makes a change to SHA1's commit log text or metadata.
--append-dot append a dot to the first line of each commit message if
there is no other punctuation or blank at the end.
--tear-off tear off all commit log lines after a '--' line.
--tear-off tear off all commit log lines after a '--' line and
skip log entry with the first body line being '--'.
--since=DATE convert only the logs since DATE;
the default is to convert all log entries.
--format=FMT set format string for commit subject and body;
@ -222,6 +224,13 @@ sub parse_amend_file($)
$log =~ /^.*\n\nMerge branch '.*\n\s*/
and goto SKIPCOMMIT;
# Skip log entries if the body starts with a tear off marker.
if ($tear_off)
{
$log =~ /^.*\n\n.*\n--\s*/
and goto SKIPCOMMIT;
}
# Extract leading hash.
my ($sha, $rest) = split ':', $log, 2;
defined $sha
@ -360,7 +369,7 @@ sub parse_amend_file($)
# indent-tabs-mode: nil
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "my $VERSION = '"
# time-stamp-format: "%:y-%02m-%02d %02H:%02M"
# time-stamp-format: "%:y-%02m-%02d %02H:%02M (wk)"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "'; # UTC"
# End: