Documentation ¶
Index ¶
- Constants
- func ParseMailmap(contents string) map[string]object.Signature
- type Detector
- func (detector *Detector) Configure(facts map[string]interface{}) error
- func (detector *Detector) Consume(deps map[string]interface{}) (map[string]interface{}, error)
- func (detector *Detector) Fork(n int) []core.PipelineItem
- func (detector *Detector) GeneratePeopleDict(commits []*object.Commit)
- func (detector *Detector) Initialize(repository *git.Repository) error
- func (detector *Detector) ListConfigurationOptions() []core.ConfigurationOption
- func (detector *Detector) LoadPeopleDict(path string) error
- func (detector Detector) MergeReversedDicts(rd1, rd2 []string) (map[string][3]int, []string)
- func (detector *Detector) Name() string
- func (detector *Detector) Provides() []string
- func (detector *Detector) Requires() []string
Constants ¶
const ( // AuthorMissing is the internal author index which denotes any unmatched identities // (Detector.Consume()). It may *not* be (1 << 18) - 1, see BurndownAnalysis.packPersonWithDay(). AuthorMissing = (1 << 18) - 2 // AuthorMissingName is the string name which corresponds to AuthorMissing. AuthorMissingName = "<unmatched>" // FactIdentityDetectorPeopleDict is the name of the fact which is inserted in // Detector.Configure(). It corresponds to Detector.PeopleDict - the mapping // from the signatures to the author indices. FactIdentityDetectorPeopleDict = "IdentityDetector.PeopleDict" // FactIdentityDetectorReversedPeopleDict is the name of the fact which is inserted in // Detector.Configure(). It corresponds to Detector.ReversedPeopleDict - // the mapping from the author indices to the main signature. FactIdentityDetectorReversedPeopleDict = "IdentityDetector.ReversedPeopleDict" // ConfigIdentityDetectorPeopleDictPath is the name of the configuration option // (Detector.Configure()) which allows to set the external PeopleDict mapping from a file. ConfigIdentityDetectorPeopleDictPath = "IdentityDetector.PeopleDictPath" // FactIdentityDetectorPeopleCount is the name of the fact which is inserted in // Detector.Configure(). It is equal to the overall number of unique authors // (the length of ReversedPeopleDict). FactIdentityDetectorPeopleCount = "IdentityDetector.PeopleCount" // DependencyAuthor is the name of the dependency provided by Detector. DependencyAuthor = "author" )
Variables ¶
This section is empty.
Functions ¶
func ParseMailmap ¶
ParseMailmap parses the contents of .mailmap and returns the mapping between signature parts. It does *not* follow the full signature matching convention, that is, developers are identified by email and by name independently.
Types ¶
type Detector ¶
type Detector struct { core.NoopMerger // PeopleDict maps email || name -> developer id PeopleDict map[string]int // ReversedPeopleDict maps developer id -> description ReversedPeopleDict []string }
Detector determines the author of a commit. Same person can commit under different signatures, and we apply some heuristics to merge those together. It is a PipelineItem.
func (*Detector) Configure ¶
Configure sets the properties previously published by ListConfigurationOptions().
func (*Detector) Consume ¶
Consume runs this PipelineItem on the next commit data. `deps` contain all the results from upstream PipelineItem-s as requested by Requires(). Additionally, DependencyCommit is always present there and represents the analysed *object.Commit. This function returns the mapping with analysis results. The keys must be the same as in Provides(). If there was an error, nil is returned.
func (*Detector) Fork ¶
func (detector *Detector) Fork(n int) []core.PipelineItem
Fork clones this PipelineItem.
func (*Detector) GeneratePeopleDict ¶
GeneratePeopleDict loads author signatures from the specified list of Git commits.
func (*Detector) Initialize ¶
Initialize resets the temporary caches and prepares this PipelineItem for a series of Consume() calls. The repository which is going to be analysed is supplied as an argument.
func (*Detector) ListConfigurationOptions ¶
func (detector *Detector) ListConfigurationOptions() []core.ConfigurationOption
ListConfigurationOptions returns the list of changeable public properties of this PipelineItem.
func (*Detector) LoadPeopleDict ¶
LoadPeopleDict loads author signatures from a text file. The format is one signature per line, and the signature consists of several keys separated by "|". The first key is the main one and used to reference all the rest.
func (Detector) MergeReversedDicts ¶
MergeReversedDicts joins two identity lists together, excluding duplicates, in-order. The returned mapping's values are: final index, index in first, index in second (-1 for a miss).
func (*Detector) Name ¶
Name of this PipelineItem. Uniquely identifies the type, used for mapping keys, etc.
func (*Detector) Provides ¶
Provides returns the list of names of entities which are produced by this PipelineItem. Each produced entity will be inserted into `deps` of dependent Consume()-s according to this list. Also used by core.Registry to build the global map of providers.