git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Which dates 'git log --since= --after=' compare?

From
DDaniel <mjucde@o2.pl>
Date
Oct 20, 2009, 09:35 UTC
Message-ID
<16ee5f3.236584ce.4add8467.a19be@o2.pl>
In-Reply-To
<20091020083703.GA14740@coredump.intra.peff.net>
Jeff King <peff@peff.net> wrote:
Show 32 quoted lines
> 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.
Previous: Jeff King
Message 3 of 3 in “Which dates 'git log --since= --after=' compare?”
  1. DanielOct 19, 2009
  2. Jeff KingOct 20, 2009
  3. DanielOct 20, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.