[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Minor fix to gitlog-to-changelog
From: |
Sergey Poznyakoff |
Subject: |
Re: Minor fix to gitlog-to-changelog |
Date: |
Wed, 12 Aug 2009 19:51:58 +0300 |
Jim Meyering <address@hidden> ha escrit:
> That's fine, as long as you also add a line or two in --help output.
Sure. I have installed the following patch:
>From 2ae2a816e734b0332eac67b07e184589e9b5957e Mon Sep 17 00:00:00 2001
From: Sergey Poznyakoff <address@hidden>
Date: Wed, 12 Aug 2009 19:48:51 +0300
Subject: [PATCH] Minor improvement in gitlog-to-changelog
* build-aux/gitlog-to-changelog: New option `--format' makes
output format string configurable.
---
build-aux/gitlog-to-changelog | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/build-aux/gitlog-to-changelog b/build-aux/gitlog-to-changelog
index 1cc53eb..a0f8a08 100755
--- a/build-aux/gitlog-to-changelog
+++ b/build-aux/gitlog-to-changelog
@@ -1,7 +1,7 @@
#!/usr/bin/perl
# Convert git log output to ChangeLog format.
-my $VERSION = '2009-06-04 08:53'; # UTC
+my $VERSION = '2009-08-12 16:49'; # 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
@@ -60,6 +60,9 @@ OPTIONS:
--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;
+ see 'man git-log' for the list of format metacharacters;
+ the default is '%s%n%b%n'
--help display this help and exit
--version output version information and exit
@@ -96,15 +99,17 @@ sub quoted_cmd(@)
{
my $since_date = '1970-01-01 UTC';
+ my $format_string = '%s%n%b%n';
GetOptions
(
help => sub { usage 0 },
version => sub { print "$ME version $VERSION\n"; exit },
'since=s' => \$since_date,
+ 'format=s' => \$format_string,
) or usage 1;
my @cmd = (qw (git log --log-size), "--since=$since_date",
- '--pretty=format:%ct %an <%ae>%n%n%s%n%b%n', @ARGV);
+ '--pretty=format:%ct %an <%ae>%n%n'.$format_string, @ARGV);
open PIPE, '-|', @cmd
or die ("$ME: failed to run `". quoted_cmd (@cmd) ."': $!\n"
. "(Is your Git too old? Version 1.5.1 or later is required.)\n");
--
1.6.0
Regards,
Sergey