Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommitStats ¶
type CommitStats struct {
// Files add/modified/removed by this commit.
Files int
// Code stats of the code lines.
Code KindStats
// Comment stats of the comment lines.
Comment KindStats
// Blank stats of the blank lines.
Blank KindStats
// Other stats of files that are not from a recognized or format language.
Other KindStats
// Total the sum of the previous stats.
Total KindStats
}
CommitStats represents the stats for a commit.
func Calculate ¶
func Calculate(r *git.Repository, from, to *object.Commit) (*CommitStats, error)
Calculate calculates the CommitStats for from commit to another. if from is nil the first parent is used, if the commit is orphan the stats are compared against a empty commit.
func (*CommitStats) Add ¶
func (s *CommitStats) Add(stats *CommitStats)
Add adds the given stats to this stats.
func (*CommitStats) String ¶
func (s *CommitStats) String() string
type KindStats ¶
type KindStats struct {
// Additions number of lines added.
Additions int
// Deletions number of lines deleted.
Deletions int
}
KindStats represents the stats for a kind of lines in a file.
Click to show internal directories.
Click to hide internal directories.