[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] gitlog-to-changelog pass args to git-log
From: |
Jim Meyering |
Subject: |
Re: [PATCH] gitlog-to-changelog pass args to git-log |
Date: |
Sun, 21 Dec 2008 08:51:24 +0100 |
William Pursell <address@hidden> wrote:
> 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.
Thanks.
That sounds useful.
However, with your proposed patch, you'd have to be careful if you
want to pass an option to git-log and not have it interpreted (likely,
rejected) as a gitlog-to-changelog option.
i.e., you'd have to precede any option with "--" to tell getopt
to stop processing gitlog-to-changelog options.
There are a couple ways around this:
- document it
- add a new option, e.g., --git-log-options-and-args=S (obviously
it'd need a better option name :-)
- or...
On the other hand, if the sole use case is to print the log for a
named branch, then just add a new option, say --branch=B.
Finally, if you send a new version of your patch, please use
"git format-patch ..." which will include a log entry describing
the change, as described here:
http://git.sv.gnu.org/gitweb/?p=coreutils.git;a=blob;f=HACKING;hb=HEAD
> ...
> 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);
BTW, there's no need for a loop or even a separate statement
to append the branch name to @cmd:
my @cmd = (qw (git log --log-size), "--since=$since_date",
'--pretty=format:%ct %an <%ae>%n%n%s%n%b%n', @ARGV);