| 12345678910111213141516171819202122232425262728293031323334353637383940 | /*Package hercules contains the functions which are needed to gather the lineburndown statistics from a Git repository.Analyser is the main object which concentrates the high level logic. Itprovides Commits() and Analyse() methods to get the work done. The followingexample was taken from cmd/hercules:	var repository *git.Repository	// ... initialize repository ...	analyser := hercules.Analyser{		Repository: repository,		OnProgress: func(commit, length int) {			fmt.Fprintf(os.Stderr, "%d / %d\r", commit, length)		},		Granularity:         30,		Sampling:            15,		SimilarityThreshold: 90,		Debug:               false,	}	commits := analyser.Commits()  // or specify a custom list	statuses := analyser.Analyse(commits)	// [y][x]int64 where y is the snapshot index and x is the granulated time index.As commented in the code, the list of commits can be any valid slice of *object.Commit.The returned statuses slice of slices is a rectangular 2D matrix wherethe number of rows equals to the repository's lifetime divided by the samplingvalue (detail factor) and the number of columns is the repository's lifetimedivided by the granularity value (number of bands).Analyser depends heavily on https://github.com/src-d/go-git and leverages thediff algorithm through https://github.com/sergi/go-diff.Besides, hercules defines File and RBTree. These are low level data structuresrequired by Analyser. File carries an instance of RBTree and the current lineburndown state. RBTree implements the red-black balanced binary tree and isbased on https://github.com/yasushi-saito/rbtree.*/package hercules
 |