I have a repository with five total commits, and zero commits for today. From the command line:
$ git log --since='2012-07-12' --oneline | wc -l
However, with Grit v2.5.0, #commits_since incorrectly lists all the commits in the repository:
> repo.commits_since('master', '2012-07-12').count
Unless I'm misreading the source code, I believe Grit expects a Time object for since.
Below are some examples that should return commits since 1st August 2012 (examples provided for either Local Time or UTC Time):
Using the local class method of Time to generate a Time object for 1st August 2012 Midnight Local Time:
commits = repo.commits_since('master', Time.local(2012, 8, 1))
Or using the utc class method of Time to generate a Time object for 1st August 2012 Midnight UTC Time:
commits = repo.commits_since('master', Time.utc(2012, 8, 1))
Grit is no longer maintained. See #183 and check out libgit2/rugged.