[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] gitlog-to-changelog pass args to git-log
From: |
William Pursell |
Subject: |
[PATCH] gitlog-to-changelog pass args to git-log |
Date: |
Sat, 20 Dec 2008 15:53:08 +0000 |
User-agent: |
Thunderbird 2.0.0.18 (Macintosh/20081105) |
This is a simple modification to gitlog-to-changelog
that allows arguments to be passed to git-log
to allow finer control over construction
of the ChangeLog. The intended use case is to allow
a ChangeLog to be built for a branch without requiring
that branch to be checked out.
diff --git a/build-aux/gitlog-to-changelog b/build-aux/gitlog-to-changelog
index 50b1b2f..b40d346 100755
--- a/build-aux/gitlog-to-changelog
+++ b/build-aux/gitlog-to-changelog
@@ -50,9 +50,10 @@ sub usage ($)
else
{
print $STREAM <<EOF;
-Usage: $ME [OPTIONS]
+Usage: $ME [OPTIONS] [ARGS]
-Convert git log output to ChangeLog format.
+Convert git log output to ChangeLog format. If present, any ARGS
+are passed to git-log.
OPTIONS:
@@ -65,6 +66,7 @@ OPTIONS:
EXAMPLE:
$ME --since=2008-01-01 > ChangeLog
+ $ME branch-foo > foo.Changelog
EOF
}
@@ -100,11 +102,9 @@ sub quoted_cmd(@)
'since=s' => \$since_date,
) or usage 1;
- @ARGV
- and (warn "$ME: too many arguments\n"), usage 1;
-
my @cmd = (qw (git log --log-size), "--since=$since_date",
'--pretty=format:%ct %an <%ae>%n%n%s%n%b%n');
+ push @cmd, $_ foreach (@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");
--
William Pursell
- [PATCH] gitlog-to-changelog pass args to git-log,
William Pursell <=