[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: improve error message from gitlog-to-changelog with too-old Git
From: |
Jim Meyering |
Subject: |
Re: improve error message from gitlog-to-changelog with too-old Git |
Date: |
Tue, 19 Aug 2008 08:23:37 +0200 |
Ben Pfaff <address@hidden> wrote:
> GNU PSPP has started using the gitlog-to-changelog script, via
> the corresponding gnulib module. One of the PSPP developers
> (CC'd) reported the following error from the script:
>
>> fatal: invalid --pretty format: format:%ct %an <%ae>%n%n%s%n%b%n
>> gitlog-to-changelog: error closing pipe from git log --log-size
>> '--since=2008-07-27' '--pretty=format:%ct %an
>> <%ae>%n%n%s%n%b%n'
>
> Later, he noticed:
>> It seems to work OK with git 1.5.5.3 but not with git 1.4.4.4
>
> Looking at Git's history, "--pretty=format:" was introduced
> between Git 1.5.0 and 1.5.1, so I'd propose helping the user to
> understand what went wrong with the following change.
>
> Alternatively, one could check the Git version number before
> trying "--pretty=format:", but this seems to require parsing the
> output of "git --version" and I'm not too enthusiastic about
> various things that can go wrong with that.
>
> 2008-08-18 Ben Pfaff <address@hidden>
>
> * build-aux/gitlog-to-changelog: Improve error message given when
> the available version of Git is too old.
Thanks. The patch looks fine.
I gave the log a summary line and pushed it:
>From 9462d43fbc0d873ee7e667ba952616d53b8585e4 Mon Sep 17 00:00:00 2001
From: Ben Pfaff <address@hidden>
Date: Tue, 19 Aug 2008 08:20:22 +0200
Subject: [PATCH] gitlog-to-changelog: give better diagnostic for failed
pipe-open
* build-aux/gitlog-to-changelog: Improve error message: suggest
that the version of Git may be too old.
---
ChangeLog | 6 ++++++
build-aux/gitlog-to-changelog | 5 +++--
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index a09e688..5e303c7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2008-08-18 Ben Pfaff <address@hidden>
+
+ gitlog-to-changelog: give better diagnostic for failed pipe-open
+ * build-aux/gitlog-to-changelog: Improve error message: suggest
+ that the version of Git may be too old.
+
2008-08-18 Simon Josefsson <address@hidden>
* m4/autobuild.m4: Use TZ=UTC to avoid time zone complexity. Use
diff --git a/build-aux/gitlog-to-changelog b/build-aux/gitlog-to-changelog
index 3efdb6d..50b1b2f 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 = '2008-02-10 10:03'; # UTC
+my $VERSION = '2008-08-19 05:01'; # 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
@@ -106,7 +106,8 @@ sub quoted_cmd(@)
my @cmd = (qw (git log --log-size), "--since=$since_date",
'--pretty=format:%ct %an <%ae>%n%n%s%n%b%n');
open PIPE, '-|', @cmd
- or die "$ME: failed to run `". quoted_cmd (@cmd) ."': $!\n";
+ or die ("$ME: failed to run `". quoted_cmd (@cmd) ."': $!\n"
+ . "(Is your Git too old? Version 1.5.1 or later is required.)\n");
my $prev_date_line = '';
while (1)
--
1.6.0.4.g750768