Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommitFileStats ¶
type CommitFileStats struct { Path string Language string Code KindStats Comment KindStats Blank KindStats Other KindStats Total KindStats }
CommitFileStats represents the stats for a file in a commit.
func CalculateByFile ¶
func CalculateByFile(r *git.Repository, from, to *object.Commit) ([]CommitFileStats, error)
CalculateByFile calculates the stats for all files from a commit to another. If from is nil, the first parent is used. if the commit is an orphan, the stats are compared against an empty commit.
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) 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.