Documentation ¶
Index ¶
- func PairsToCommitsInCommon(filesOrComponents []string, componentOrFileToCommits map[string]CommitHashes) map[string]CommitHashes
- func SplitCommitsIntoBucketsOfDays(time time.Time, commitParts []*PartOfCommit, bucketDays []int) map[int][]*PartOfCommit
- type CommitHashes
- type CommitPartMap
- type CommitStats
- type PartOfCommit
- type Splitted
- func (ms *Splitted) CommitParts() []*PartOfCommit
- func (ms *Splitted) ComponentToCommitHashes() map[string]CommitHashes
- func (ms *Splitted) DayBuckets() map[int]*Splitted
- func (ms *Splitted) FileToCommitHashes() map[string]CommitHashes
- func (ms *Splitted) SplitByAuthor() CommitPartMap
- func (ms *Splitted) SplitByCommitHash() CommitPartMap
- func (ms *Splitted) SplitByComponent() CommitPartMap
- func (ms *Splitted) SplitByFile() CommitPartMap
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PairsToCommitsInCommon ¶ added in v0.1.0
func PairsToCommitsInCommon(filesOrComponents []string, componentOrFileToCommits map[string]CommitHashes) map[string]CommitHashes
PairsToCommitsInCommon Puts components or files into pairs and counts the number of commits that they share. Returns a map of the pair to the number of shared commits.
The structure of the map is: file1:file2 -> []string{CommitHashes...} The resulting map will contain pairs of components or files that have at least 1 shared commit.
func SplitCommitsIntoBucketsOfDays ¶
func SplitCommitsIntoBucketsOfDays(time time.Time, commitParts []*PartOfCommit, bucketDays []int) map[int][]*PartOfCommit
SplitCommitsIntoBucketsOfDays commits into buckets based on the number of days between the commit and the time passed in. The buckets are the number of days in the bucketDays array. For example, if bucketDays is [7, 30, 90], then the commits will be split into 7 days, 30 days, and 90 days. This is useful for seeing code churn over time. The buckets are returned as a map of days to commits. The time passed in is the time that the buckets are relative to. The commitParts are the commits to split into buckets, and they are assumed to be sorted by time in descending order.
Types ¶
type CommitHashes ¶
type CommitHashes []string
func SharedCommitsForGroup ¶ added in v0.1.0
func SharedCommitsForGroup(group []string, componentOrFileToCommits map[string]CommitHashes) CommitHashes
type CommitPartMap ¶
type CommitPartMap map[string][]*PartOfCommit
type CommitStats ¶
type CommitStats struct { CommitCount int AdditionCount int DeletionCount int UniqueFileChangeCount int UniqueComponentChangeCount int UniqueAuthorCount int OldestCommitAgeInDays int }
func GetStats ¶
func GetStats(basedOn time.Time, commitParts []*PartOfCommit) *CommitStats
GetStats Gets the stats for a group of commits. Assumes that commits are sorted in reverse chronological order.
type PartOfCommit ¶
type Splitted ¶
type Splitted struct {
// contains filtered or unexported fields
}
func (*Splitted) CommitParts ¶ added in v0.1.0
func (ms *Splitted) CommitParts() []*PartOfCommit
func (*Splitted) ComponentToCommitHashes ¶
func (ms *Splitted) ComponentToCommitHashes() map[string]CommitHashes
func (*Splitted) DayBuckets ¶
DayBuckets may return nil if the commits were not split by day buckets. This is the case if this set of Splitted commits were already split into day buckets.
func (*Splitted) FileToCommitHashes ¶
func (ms *Splitted) FileToCommitHashes() map[string]CommitHashes
func (*Splitted) SplitByAuthor ¶
func (ms *Splitted) SplitByAuthor() CommitPartMap
func (*Splitted) SplitByCommitHash ¶
func (ms *Splitted) SplitByCommitHash() CommitPartMap
func (*Splitted) SplitByComponent ¶
func (ms *Splitted) SplitByComponent() CommitPartMap
func (*Splitted) SplitByFile ¶
func (ms *Splitted) SplitByFile() CommitPartMap