I wanted to get a list of all my commits to a repository since the start of the year. I tried with the obvious command, but it doesn't include any of them:
$ git log --pretty='format:%h %ae %cI %s' [email protected] --since=2017-01-01 $
Oddly, I have to use --since=2016-12-19
, which gets me some of them:
$ git log --pretty='format:%h %ae %cI %s' [email protected] --since=2016-12-20 $ git log --pretty='format:%h %ae %cI %s' [email protected] --since=2016-12-19 61569b5 [email protected] 2017-01-02T16:25:22+08:00 Bug 1324624 - Tweak stylo crashtest assertion annotations a bit more. 7fca5ff [email protected] 2016-12-29T16:32:01+08:00 Bug 1323892 - Followup to disable one more crashtest under stylo. cd875e7 [email protected] 2016-12-28T17:50:44+08:00 Bug 1326023 - Make Element::GetBindingURL return a strong reference. r=smaug 3c057d1 [email protected] 2017-01-02T15:44:23+08:00 Bug 1323717 - Re-enable 1290994-4.html. r=manishearth 7a45228 [email protected] 2016-12-28T17:50:44+08:00 Bug 1326023 - Make Element::GetBindingURL return a strong reference. r=smaug 171e45e [email protected] 2017-01-03T18:35:15+08:00 Bug 1328223 - stylo: Ignore invalid URLs from @import rules. r=emilio $
But it's not all of them:
$ git log --pretty='format:%h %ae %cI %s' [email protected] | grep 2017- | wc -l 19
What's going on here? Does --since
do something other than just remove commits from the output that are earlier than the given date?
For better or worse (me, I'm in the "worse" camp), git defaults to the current time of day when you specify a date. Try
--since='midnight 2016-12-20'
... okay. I haven't deciphered the code yet, but this looks awfully good for it:
Notice your commits are behind commit
c337ff9
, dated 2016-11-21. I'm betting there's an heuristic in there somewhere, that says if it encounters a commit dated more than a month before the cutoff it stops looking.