Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContributionCounter ¶
type ContributionCounter struct { Repo *gogit.Repository ShowFiles bool Verbose bool Since string IgnoredExtensions []string OnlyExtensions []string IgnoredPaths []string OnlyPaths []string Mailmap mailmap }
ContributionCounter represents a repository and options describing how to count changes and attribute them to collaborators to determine experience.
func (*ContributionCounter) BranchBehind ¶
func (r *ContributionCounter) BranchBehind() (bool, error)
BranchBehind determines if the current branch is "behind" by comparing the current branch HEAD reference to that of the local ref of the master branch.
func (*ContributionCounter) BuildMailmap ¶
func (r *ContributionCounter) BuildMailmap(paths ...string)
BuildMailmap builds a map of author name/email combinations to determine the canonical author for a given line or commit. This is useful if an author worked on a project under multiple identiies but we still want to attribute all contributions to the same person.
It attempts to open and read from any of the paths specified. If none are specified, it will attempt to open ~/.mailmap and read from there.
It will skip over any files it is unable to open without error. If none are parsed, it will result in an empty mailmap.
func (*ContributionCounter) FindFiles ¶
func (r *ContributionCounter) FindFiles() ([]string, error)
FindFiles returns a list of paths to files that have been changed in this branch with respect to "master".
func (*ContributionCounter) FindReviewers ¶
func (r *ContributionCounter) FindReviewers(paths []string) (string, error)
FindReviewers returns up to 3 of the top reviewers information as determined by percentage of owned lines of all lines in changed file.
NOTE: This previously use go-git to create a blame object for each file in 'paths', but the performance and concurrency errors proved to make this unsuitable for this method. We're falling back to making and parsing shell commands to Git to calculate blame statistics.
Relevant src-d/go-git issues - https://github.com/src-d/go-git/issues/457 - https://github.com/src-d/go-git/issues/458
type NoReviewersErr ¶
type Stat ¶
Stat contains information about a collaborator and the total "experience" in a branch as determined by the percentage of lines owned out of the total number of lines of code in a changed file.
type Stats ¶
type Stats []*Stat
Stats is a collection of all the collaboration statistics obtained across changes in a repository. By defining our own slice type, we are able to add methods to implement the Heap interface, which we use to determine collaborators with the most experience without sorting the entire list.