{"thread":{"id":"21280","subject":"Which dates 'git log --since= --after=' compare?","startedAt":"2009-10-19T10:01:49Z","lastAt":"2009-10-20T09:35:35Z","messageCount":3,"participants":["Daniel","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"125368","messageId":"4c067ee1.a34185.4adc390d.a980c@o2.pl","threadId":"21280","inReplyTo":null,"subject":"Which dates 'git log --since= --after=' compare?","fromName":"Daniel","fromEmail":"mjucde@o2.pl","sentAt":"2009-10-19T10:01:49Z","receivedAt":"2009-10-19T10:01:49Z","isPatch":false,"sender":{"key":"mjucde@o2.pl","avatar":null},"body":"Hi,\n\nI can see that 'git log --since= --after=' compares commit's dates,\nnot author's dates.How can I limit commits by Author's date?\n\n$ git log --format=\"%aD %cD\"\n\nMon, 5 Oct 2009 14:54:57 +0200 Thu, 8 Oct 2009 10:31:40 +0200\nMon, 21 Sep 2009 11:11:35 +0200 Thu, 8 Oct 2009 10:31:40 +0200\nMon, 21 Sep 2009 10:14:41 +0200 Thu, 8 Oct 2009 10:31:40 +0200\nWed, 16 Sep 2009 14:23:30 +0200 Thu, 8 Oct 2009 10:31:40 +0200\nWed, 16 Sep 2009 10:27:39 +0200 Thu, 8 Oct 2009 10:31:38 +0200\nWed, 16 Sep 2009 09:15:32 +0200 Thu, 8 Oct 2009 10:30:31 +0200\nWed, 16 Sep 2009 08:02:23 +0200 Wed, 16 Sep 2009 09:02:29 +0200\n\n$ git log --format=\"%aD %cD\" --since=2009-09-01 --until=2009-10-01\nWed, 16 Sep 2009 08:02:23 +0200 Wed, 16 Sep 2009 09:02:29 +0200\n\n-- \nDaniel\n"},{"id":"125454","messageId":"20091020083703.GA14740@coredump.intra.peff.net","threadId":"21280","inReplyTo":"4c067ee1.a34185.4adc390d.a980c@o2.pl","subject":"Re: Which dates 'git log --since= --after=' compare?","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2009-10-20T08:37:03Z","receivedAt":"2009-10-20T08:37:03Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, Oct 19, 2009 at 12:01:49PM +0200, Daniel wrote:\n\n> I can see that 'git log --since= --after=' compares commit's dates,\n> not author's dates.How can I limit commits by Author's date?\n\nAFAIK, there is currently no way to do it with a simple option. In fact,\nwe don't even parse the author date when doing revision limiting.\n\nSo it would need a patch, but the \"obvious\" solution of just parsing and\nstoring the author date in a \"struct commit\" might not be acceptable; as\nI recall, some performance tuning went into keeping the per-commit\nmemory footprint as small as possible, which had a noticeable speed\nbenefit (I'm not saying it couldn't be done, but care needs to be taken\nin that regard).\n\nIf it's not something you need to do often, I'd consider something like:\n\n  git log --format='%H %at' |\n    perl -ane '\n      BEGIN {\n        use DateTime::Format::Natural;\n        $max_age = DateTime::Format::Natural->new->parse_datetime(\n                      \"last friday\"\n                   )->epoch;\n      }\n      print $F[0], \"\\n\" if $F[1] < $max_age;\n  '\n\nOf course that's awful to type, and it will be much slower than git\ndoing the revision limiting itself.\n\n-Peff\n"},{"id":"125461","messageId":"16ee5f3.236584ce.4add8467.a19be@o2.pl","threadId":"21280","inReplyTo":"20091020083703.GA14740@coredump.intra.peff.net","subject":"Re: Which dates 'git log --since= --after=' compare?","fromName":"Daniel","fromEmail":"mjucde@o2.pl","sentAt":"2009-10-20T09:35:35Z","receivedAt":"2009-10-20T09:35:35Z","isPatch":false,"sender":{"key":"mjucde@o2.pl","avatar":null},"body":"Jeff King <peff@peff.net> wrote:\n\n> On Mon, Oct 19, 2009 at 12:01:49PM +0200, Daniel wrote:\n> \n> > I can see that 'git log --since= --after=' compares commit's dates,\n> > not author's dates.How can I limit commits by Author's date?\n> \n> AFAIK, there is currently no way to do it with a simple option. In fact,\n> we don't even parse the author date when doing revision limiting.\n> \n> So it would need a patch, but the \"obvious\" solution of just parsing and\n> storing the author date in a \"struct commit\" might not be acceptable; as\n> I recall, some performance tuning went into keeping the per-commit\n> memory footprint as small as possible, which had a noticeable speed\n> benefit (I'm not saying it couldn't be done, but care needs to be taken\n> in that regard).\n> \n> If it's not something you need to do often, I'd consider something like:\n> \n>   git log --format='%H %at' |\n>     perl -ane '\n>       BEGIN {\n>         use DateTime::Format::Natural;\n>         $max_age = DateTime::Format::Natural->new->parse_datetime(\n>                       \"last friday\"\n>                    )->epoch;\n>       }\n>       print $F[0], \"\\n\" if $F[1] < $max_age;\n>   '\n> \n> Of course that's awful to type, and it will be much slower than git\n> doing the revision limiting itself.\n> \n> -Peff\n\nThanks.\n"}]}