Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add num_commits_to_* methods to Project object #10

Open
ChrisTimperley opened this issue Dec 4, 2017 · 2 comments
Open

Add num_commits_to_* methods to Project object #10

ChrisTimperley opened this issue Dec 4, 2017 · 2 comments
Assignees
Labels

Comments

@ChrisTimperley
Copy link
Contributor

ChrisTimperley commented Dec 4, 2017

This family of methods should be used to calculate the number of commits to a given repository, file, line or function within a given range of commits.

def num_commits_to_repo(...) -> int:
def num_commits_to_file(...) -> int:
def num_commits_to_function(...) -> int:
def num_commits_to_line(...) -> int:

Each of these functions should have a similar header:

def num_commits_to_repo(repo: git.Repo,
                        before: Optional[git.Commit] = None,
                        after: Optional[git.Commit] = None,
                        ...) -> int:

Internally, each of these methods should call commits_to_* method to obtain a set of commits, before returning the length of that list.

def commits_to_repo(...) -> List[git.Commit]
def commits_to_file(...) -> List[git.Commit]
def commits_to_function(...) -> List[git.Commit]
def commits_to_line(...) -> List[git.Commit]

One could argue that the num_commits_to_* methods are superfluous. Either way, we still need to implement commits_to_function and commits_to_repo.

@ChrisTimperley ChrisTimperley changed the title Add num_commits_to_* functions to util module Add num_commits_to_* methods to util module Dec 4, 2017
@jlacomis jlacomis self-assigned this Dec 4, 2017
@jlacomis jlacomis changed the title Add num_commits_to_* methods to util module Add num_commits_to_* methods to Project object Dec 6, 2017
jlacomis added a commit that referenced this issue Dec 6, 2017
jlacomis added a commit that referenced this issue Dec 6, 2017
jlacomis added a commit that referenced this issue Dec 6, 2017
jlacomis added a commit that referenced this issue Dec 6, 2017
ChrisTimperley pushed a commit that referenced this issue Dec 6, 2017
ChrisTimperley pushed a commit that referenced this issue Dec 6, 2017
@jlacomis
Copy link
Collaborator

This functionality exists now.

@jlacomis
Copy link
Collaborator

Whoops, forgot that "commits_to_function" isn't done yet

@jlacomis jlacomis reopened this Dec 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants