git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Daniel <mjucde@o2.pl>
Cc: git@vger.kernel.org
Subject: Re: Which dates 'git log --since= --after=' compare?
Date: Tue, 20 Oct 2009 04:37:03 -0400	[thread overview]
Message-ID: <20091020083703.GA14740@coredump.intra.peff.net> (raw)
In-Reply-To: <4c067ee1.a34185.4adc390d.a980c@o2.pl>

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

  reply	other threads:[~2009-10-20  8:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-19 10:01 Which dates 'git log --since= --after=' compare? Daniel
2009-10-20  8:37 ` Jeff King [this message]
2009-10-20  9:35   ` Daniel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20091020083703.GA14740@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=mjucde@o2.pl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).