Grit::Repo#commits_since incorrectly lists all commits #133

Closed
CodeGnome opened this Issue Jul 16, 2012 · 2 comments

Projects

None yet

3 participants

@CodeGnome

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
0

However, with Grit v2.5.0, #commits_since incorrectly lists all the commits in the repository:

> repo.class
=> Grit::Repo

> repo.commits_since('master', '2012-07-12').count
=> 5
@snh
snh commented Aug 5, 2012

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))
@bkeepers
Collaborator
bkeepers commented Feb 3, 2014

Grit is no longer maintained. See #183 and check out libgit2/rugged.

@bkeepers bkeepers closed this Feb 3, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment