* Which dates 'git log --since= --after=' compare?
@ 2009-10-19 10:01 Daniel
2009-10-20 8:37 ` Jeff King
0 siblings, 1 reply; 3+ messages in thread
From: Daniel @ 2009-10-19 10:01 UTC (permalink / raw)
To: git
Hi,
I can see that 'git log --since= --after=' compares commit's dates,
not author's dates.How can I limit commits by Author's date?
$ git log --format="%aD %cD"
Mon, 5 Oct 2009 14:54:57 +0200 Thu, 8 Oct 2009 10:31:40 +0200
Mon, 21 Sep 2009 11:11:35 +0200 Thu, 8 Oct 2009 10:31:40 +0200
Mon, 21 Sep 2009 10:14:41 +0200 Thu, 8 Oct 2009 10:31:40 +0200
Wed, 16 Sep 2009 14:23:30 +0200 Thu, 8 Oct 2009 10:31:40 +0200
Wed, 16 Sep 2009 10:27:39 +0200 Thu, 8 Oct 2009 10:31:38 +0200
Wed, 16 Sep 2009 09:15:32 +0200 Thu, 8 Oct 2009 10:30:31 +0200
Wed, 16 Sep 2009 08:02:23 +0200 Wed, 16 Sep 2009 09:02:29 +0200
$ git log --format="%aD %cD" --since=2009-09-01 --until=2009-10-01
Wed, 16 Sep 2009 08:02:23 +0200 Wed, 16 Sep 2009 09:02:29 +0200
--
Daniel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Which dates 'git log --since= --after=' compare?
2009-10-19 10:01 Which dates 'git log --since= --after=' compare? Daniel
@ 2009-10-20 8:37 ` Jeff King
2009-10-20 9:35 ` Daniel
0 siblings, 1 reply; 3+ messages in thread
From: Jeff King @ 2009-10-20 8:37 UTC (permalink / raw)
To: Daniel; +Cc: git
On Mon, Oct 19, 2009 at 12:01:49PM +0200, Daniel wrote:
> I can see that 'git log --since= --after=' compares commit's dates,
> not author's dates.How can I limit commits by Author's date?
AFAIK, there is currently no way to do it with a simple option. In fact,
we don't even parse the author date when doing revision limiting.
So it would need a patch, but the "obvious" solution of just parsing and
storing the author date in a "struct commit" might not be acceptable; as
I recall, some performance tuning went into keeping the per-commit
memory footprint as small as possible, which had a noticeable speed
benefit (I'm not saying it couldn't be done, but care needs to be taken
in that regard).
If it's not something you need to do often, I'd consider something like:
git log --format='%H %at' |
perl -ane '
BEGIN {
use DateTime::Format::Natural;
$max_age = DateTime::Format::Natural->new->parse_datetime(
"last friday"
)->epoch;
}
print $F[0], "\n" if $F[1] < $max_age;
'
Of course that's awful to type, and it will be much slower than git
doing the revision limiting itself.
-Peff
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Which dates 'git log --since= --after=' compare?
2009-10-20 8:37 ` Jeff King
@ 2009-10-20 9:35 ` Daniel
0 siblings, 0 replies; 3+ messages in thread
From: Daniel @ 2009-10-20 9:35 UTC (permalink / raw)
To: Jeff King; +Cc: git
Jeff King <peff@peff.net> wrote:
> On Mon, Oct 19, 2009 at 12:01:49PM +0200, Daniel wrote:
>
> > I can see that 'git log --since= --after=' compares commit's dates,
> > not author's dates.How can I limit commits by Author's date?
>
> AFAIK, there is currently no way to do it with a simple option. In fact,
> we don't even parse the author date when doing revision limiting.
>
> So it would need a patch, but the "obvious" solution of just parsing and
> storing the author date in a "struct commit" might not be acceptable; as
> I recall, some performance tuning went into keeping the per-commit
> memory footprint as small as possible, which had a noticeable speed
> benefit (I'm not saying it couldn't be done, but care needs to be taken
> in that regard).
>
> If it's not something you need to do often, I'd consider something like:
>
> git log --format='%H %at' |
> perl -ane '
> BEGIN {
> use DateTime::Format::Natural;
> $max_age = DateTime::Format::Natural->new->parse_datetime(
> "last friday"
> )->epoch;
> }
> print $F[0], "\n" if $F[1] < $max_age;
> '
>
> Of course that's awful to type, and it will be much slower than git
> doing the revision limiting itself.
>
> -Peff
Thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-10-20 9:35 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-19 10:01 Which dates 'git log --since= --after=' compare? Daniel
2009-10-20 8:37 ` Jeff King
2009-10-20 9:35 ` Daniel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).