Browse Source

Add blame info per file with --burndown-file

Signed-off-by: Vadim Markovtsev <vadim@sourced.tech>
Vadim Markovtsev 6 years ago
parent
commit
de3c384242
7 changed files with 403 additions and 183 deletions
  1. 22 14
      internal/burndown/file.go
  2. 134 102
      internal/pb/pb.pb.go
  3. 9 2
      internal/pb/pb.proto
  4. 146 51
      internal/pb/pb_pb2.py
  5. BIN
      internal/test_data/burndown.pb
  6. 66 6
      leaves/burndown.go
  7. 26 8
      leaves/burndown_test.go

+ 22 - 14
internal/burndown/file.go

@@ -123,12 +123,12 @@ func (file *File) Delete() {
 
 // Len returns the File's size - that is, the maximum key in the tree of line
 // intervals.
-func (file *File) Len() int {
+func (file File) Len() int {
 	return int(file.tree.Max().Item().Key)
 }
 
 // Nodes returns the number of RBTree nodes in the file.
-func (file *File) Nodes() int {
+func (file File) Nodes() int {
 	return file.tree.Len()
 }
 
@@ -327,18 +327,11 @@ func (file *File) Merge(day int, others ...*File) {
 
 // Dump formats the underlying line interval tree into a string.
 // Useful for error messages, panic()-s and debugging.
-func (file *File) Dump() string {
+func (file File) Dump() string {
 	buffer := ""
-	for iter := file.tree.Min(); !iter.Limit(); iter = iter.Next() {
-		node := iter.Item()
-		var val int
-		if node.Value == math.MaxUint32 {
-			val = -1
-		} else {
-			val = int(node.Value)
-		}
-		buffer += fmt.Sprintf("%d %d\n", node.Key, val)
-	}
+	file.ForEach(func(line, value int) {
+		buffer += fmt.Sprintf("%d %d\n", line, value)
+	})
 	return buffer
 }
 
@@ -351,7 +344,7 @@ func (file *File) Dump() string {
 // which marks the ending of the last line interval.
 //
 // 3. Node keys must monotonically increase and never duplicate.
-func (file *File) Validate() {
+func (file File) Validate() {
 	if file.tree.Min().Item().Key != 0 {
 		log.Panic("the tree must start with key 0")
 	}
@@ -371,6 +364,21 @@ func (file *File) Validate() {
 	}
 }
 
+// ForEach visits each node in the underlying tree, in ascending key order.
+func (file File) ForEach(callback func(line, value int)) {
+	for iter := file.tree.Min(); !iter.Limit(); iter = iter.Next() {
+		item := iter.Item()
+		key := int(item.Key)
+		var value int
+		if item.Value == math.MaxUint32 {
+			value = -1
+		} else {
+			value = int(item.Value)
+		}
+		callback(key, value)
+	}
+}
+
 // flatten represents the file as a slice of lines, each line's value being the corresponding day.
 func (file *File) flatten() []int {
 	lines := make([]int, 0, file.Len())

+ 134 - 102
internal/pb/pb.pb.go

@@ -11,6 +11,7 @@ It has these top-level messages:
 	Metadata
 	BurndownSparseMatrixRow
 	BurndownSparseMatrix
+	FilesOwnership
 	BurndownAnalysisResults
 	CompressedSparseRowMatrix
 	Couples
@@ -186,6 +187,23 @@ func (m *BurndownSparseMatrix) GetRows() []*BurndownSparseMatrixRow {
 	return nil
 }
 
+type FilesOwnership struct {
+	// The sum always equals to the total number of lines in the file.
+	Value map[int32]int32 `protobuf:"bytes,1,rep,name=value" json:"value,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"`
+}
+
+func (m *FilesOwnership) Reset()                    { *m = FilesOwnership{} }
+func (m *FilesOwnership) String() string            { return proto.CompactTextString(m) }
+func (*FilesOwnership) ProtoMessage()               {}
+func (*FilesOwnership) Descriptor() ([]byte, []int) { return fileDescriptorPb, []int{3} }
+
+func (m *FilesOwnership) GetValue() map[int32]int32 {
+	if m != nil {
+		return m.Value
+	}
+	return nil
+}
+
 type BurndownAnalysisResults struct {
 	// how many days are in each band [burndown_project, burndown_file, burndown_developer]
 	Granularity int32 `protobuf:"varint,1,opt,name=granularity,proto3" json:"granularity,omitempty"`
@@ -193,18 +211,20 @@ type BurndownAnalysisResults struct {
 	Sampling int32 `protobuf:"varint,2,opt,name=sampling,proto3" json:"sampling,omitempty"`
 	// always exists
 	Project *BurndownSparseMatrix `protobuf:"bytes,3,opt,name=project" json:"project,omitempty"`
-	// this is included if `-burndown-files` was specified
+	// this is included if `--burndown-files` was specified
 	Files []*BurndownSparseMatrix `protobuf:"bytes,4,rep,name=files" json:"files,omitempty"`
-	// these two are included if `-burndown-people` was specified
+	// these two are included if `--burndown-people` was specified
 	People []*BurndownSparseMatrix `protobuf:"bytes,5,rep,name=people" json:"people,omitempty"`
 	// rows and cols order correspond to `burndown_developer`
 	PeopleInteraction *CompressedSparseRowMatrix `protobuf:"bytes,6,opt,name=people_interaction,json=peopleInteraction" json:"people_interaction,omitempty"`
+	// How many lines belong to relevant developers for each file. The order is the same as in `files`.
+	FilesOwnership []*FilesOwnership `protobuf:"bytes,7,rep,name=files_ownership,json=filesOwnership" json:"files_ownership,omitempty"`
 }
 
 func (m *BurndownAnalysisResults) Reset()                    { *m = BurndownAnalysisResults{} }
 func (m *BurndownAnalysisResults) String() string            { return proto.CompactTextString(m) }
 func (*BurndownAnalysisResults) ProtoMessage()               {}
-func (*BurndownAnalysisResults) Descriptor() ([]byte, []int) { return fileDescriptorPb, []int{3} }
+func (*BurndownAnalysisResults) Descriptor() ([]byte, []int) { return fileDescriptorPb, []int{4} }
 
 func (m *BurndownAnalysisResults) GetGranularity() int32 {
 	if m != nil {
@@ -248,6 +268,13 @@ func (m *BurndownAnalysisResults) GetPeopleInteraction() *CompressedSparseRowMat
 	return nil
 }
 
+func (m *BurndownAnalysisResults) GetFilesOwnership() []*FilesOwnership {
+	if m != nil {
+		return m.FilesOwnership
+	}
+	return nil
+}
+
 type CompressedSparseRowMatrix struct {
 	NumberOfRows    int32 `protobuf:"varint,1,opt,name=number_of_rows,json=numberOfRows,proto3" json:"number_of_rows,omitempty"`
 	NumberOfColumns int32 `protobuf:"varint,2,opt,name=number_of_columns,json=numberOfColumns,proto3" json:"number_of_columns,omitempty"`
@@ -260,7 +287,7 @@ type CompressedSparseRowMatrix struct {
 func (m *CompressedSparseRowMatrix) Reset()                    { *m = CompressedSparseRowMatrix{} }
 func (m *CompressedSparseRowMatrix) String() string            { return proto.CompactTextString(m) }
 func (*CompressedSparseRowMatrix) ProtoMessage()               {}
-func (*CompressedSparseRowMatrix) Descriptor() ([]byte, []int) { return fileDescriptorPb, []int{4} }
+func (*CompressedSparseRowMatrix) Descriptor() ([]byte, []int) { return fileDescriptorPb, []int{5} }
 
 func (m *CompressedSparseRowMatrix) GetNumberOfRows() int32 {
 	if m != nil {
@@ -307,7 +334,7 @@ type Couples struct {
 func (m *Couples) Reset()                    { *m = Couples{} }
 func (m *Couples) String() string            { return proto.CompactTextString(m) }
 func (*Couples) ProtoMessage()               {}
-func (*Couples) Descriptor() ([]byte, []int) { return fileDescriptorPb, []int{5} }
+func (*Couples) Descriptor() ([]byte, []int) { return fileDescriptorPb, []int{6} }
 
 func (m *Couples) GetIndex() []string {
 	if m != nil {
@@ -330,7 +357,7 @@ type TouchedFiles struct {
 func (m *TouchedFiles) Reset()                    { *m = TouchedFiles{} }
 func (m *TouchedFiles) String() string            { return proto.CompactTextString(m) }
 func (*TouchedFiles) ProtoMessage()               {}
-func (*TouchedFiles) Descriptor() ([]byte, []int) { return fileDescriptorPb, []int{6} }
+func (*TouchedFiles) Descriptor() ([]byte, []int) { return fileDescriptorPb, []int{7} }
 
 func (m *TouchedFiles) GetFiles() []int32 {
 	if m != nil {
@@ -351,7 +378,7 @@ type CouplesAnalysisResults struct {
 func (m *CouplesAnalysisResults) Reset()                    { *m = CouplesAnalysisResults{} }
 func (m *CouplesAnalysisResults) String() string            { return proto.CompactTextString(m) }
 func (*CouplesAnalysisResults) ProtoMessage()               {}
-func (*CouplesAnalysisResults) Descriptor() ([]byte, []int) { return fileDescriptorPb, []int{7} }
+func (*CouplesAnalysisResults) Descriptor() ([]byte, []int) { return fileDescriptorPb, []int{8} }
 
 func (m *CouplesAnalysisResults) GetFileCouples() *Couples {
 	if m != nil {
@@ -392,7 +419,7 @@ type UASTChange struct {
 func (m *UASTChange) Reset()                    { *m = UASTChange{} }
 func (m *UASTChange) String() string            { return proto.CompactTextString(m) }
 func (*UASTChange) ProtoMessage()               {}
-func (*UASTChange) Descriptor() ([]byte, []int) { return fileDescriptorPb, []int{8} }
+func (*UASTChange) Descriptor() ([]byte, []int) { return fileDescriptorPb, []int{9} }
 
 func (m *UASTChange) GetFileName() string {
 	if m != nil {
@@ -436,7 +463,7 @@ type UASTChangesSaverResults struct {
 func (m *UASTChangesSaverResults) Reset()                    { *m = UASTChangesSaverResults{} }
 func (m *UASTChangesSaverResults) String() string            { return proto.CompactTextString(m) }
 func (*UASTChangesSaverResults) ProtoMessage()               {}
-func (*UASTChangesSaverResults) Descriptor() ([]byte, []int) { return fileDescriptorPb, []int{9} }
+func (*UASTChangesSaverResults) Descriptor() ([]byte, []int) { return fileDescriptorPb, []int{10} }
 
 func (m *UASTChangesSaverResults) GetChanges() []*UASTChange {
 	if m != nil {
@@ -455,7 +482,7 @@ type ShotnessRecord struct {
 func (m *ShotnessRecord) Reset()                    { *m = ShotnessRecord{} }
 func (m *ShotnessRecord) String() string            { return proto.CompactTextString(m) }
 func (*ShotnessRecord) ProtoMessage()               {}
-func (*ShotnessRecord) Descriptor() ([]byte, []int) { return fileDescriptorPb, []int{10} }
+func (*ShotnessRecord) Descriptor() ([]byte, []int) { return fileDescriptorPb, []int{11} }
 
 func (m *ShotnessRecord) GetType() string {
 	if m != nil {
@@ -492,7 +519,7 @@ type ShotnessAnalysisResults struct {
 func (m *ShotnessAnalysisResults) Reset()                    { *m = ShotnessAnalysisResults{} }
 func (m *ShotnessAnalysisResults) String() string            { return proto.CompactTextString(m) }
 func (*ShotnessAnalysisResults) ProtoMessage()               {}
-func (*ShotnessAnalysisResults) Descriptor() ([]byte, []int) { return fileDescriptorPb, []int{11} }
+func (*ShotnessAnalysisResults) Descriptor() ([]byte, []int) { return fileDescriptorPb, []int{12} }
 
 func (m *ShotnessAnalysisResults) GetRecords() []*ShotnessRecord {
 	if m != nil {
@@ -508,7 +535,7 @@ type FileHistory struct {
 func (m *FileHistory) Reset()                    { *m = FileHistory{} }
 func (m *FileHistory) String() string            { return proto.CompactTextString(m) }
 func (*FileHistory) ProtoMessage()               {}
-func (*FileHistory) Descriptor() ([]byte, []int) { return fileDescriptorPb, []int{12} }
+func (*FileHistory) Descriptor() ([]byte, []int) { return fileDescriptorPb, []int{13} }
 
 func (m *FileHistory) GetCommits() []string {
 	if m != nil {
@@ -524,7 +551,7 @@ type FileHistoryResultMessage struct {
 func (m *FileHistoryResultMessage) Reset()                    { *m = FileHistoryResultMessage{} }
 func (m *FileHistoryResultMessage) String() string            { return proto.CompactTextString(m) }
 func (*FileHistoryResultMessage) ProtoMessage()               {}
-func (*FileHistoryResultMessage) Descriptor() ([]byte, []int) { return fileDescriptorPb, []int{13} }
+func (*FileHistoryResultMessage) Descriptor() ([]byte, []int) { return fileDescriptorPb, []int{14} }
 
 func (m *FileHistoryResultMessage) GetFiles() map[string]*FileHistory {
 	if m != nil {
@@ -542,7 +569,7 @@ type LineStats struct {
 func (m *LineStats) Reset()                    { *m = LineStats{} }
 func (m *LineStats) String() string            { return proto.CompactTextString(m) }
 func (*LineStats) ProtoMessage()               {}
-func (*LineStats) Descriptor() ([]byte, []int) { return fileDescriptorPb, []int{14} }
+func (*LineStats) Descriptor() ([]byte, []int) { return fileDescriptorPb, []int{15} }
 
 func (m *LineStats) GetAdded() int32 {
 	if m != nil {
@@ -574,7 +601,7 @@ type DevDay struct {
 func (m *DevDay) Reset()                    { *m = DevDay{} }
 func (m *DevDay) String() string            { return proto.CompactTextString(m) }
 func (*DevDay) ProtoMessage()               {}
-func (*DevDay) Descriptor() ([]byte, []int) { return fileDescriptorPb, []int{15} }
+func (*DevDay) Descriptor() ([]byte, []int) { return fileDescriptorPb, []int{16} }
 
 func (m *DevDay) GetCommits() int32 {
 	if m != nil {
@@ -604,7 +631,7 @@ type DayDevs struct {
 func (m *DayDevs) Reset()                    { *m = DayDevs{} }
 func (m *DayDevs) String() string            { return proto.CompactTextString(m) }
 func (*DayDevs) ProtoMessage()               {}
-func (*DayDevs) Descriptor() ([]byte, []int) { return fileDescriptorPb, []int{16} }
+func (*DayDevs) Descriptor() ([]byte, []int) { return fileDescriptorPb, []int{17} }
 
 func (m *DayDevs) GetDevs() map[int32]*DevDay {
 	if m != nil {
@@ -621,7 +648,7 @@ type DevsAnalysisResults struct {
 func (m *DevsAnalysisResults) Reset()                    { *m = DevsAnalysisResults{} }
 func (m *DevsAnalysisResults) String() string            { return proto.CompactTextString(m) }
 func (*DevsAnalysisResults) ProtoMessage()               {}
-func (*DevsAnalysisResults) Descriptor() ([]byte, []int) { return fileDescriptorPb, []int{17} }
+func (*DevsAnalysisResults) Descriptor() ([]byte, []int) { return fileDescriptorPb, []int{18} }
 
 func (m *DevsAnalysisResults) GetDays() map[int32]*DayDevs {
 	if m != nil {
@@ -646,7 +673,7 @@ type Sentiment struct {
 func (m *Sentiment) Reset()                    { *m = Sentiment{} }
 func (m *Sentiment) String() string            { return proto.CompactTextString(m) }
 func (*Sentiment) ProtoMessage()               {}
-func (*Sentiment) Descriptor() ([]byte, []int) { return fileDescriptorPb, []int{18} }
+func (*Sentiment) Descriptor() ([]byte, []int) { return fileDescriptorPb, []int{19} }
 
 func (m *Sentiment) GetValue() float32 {
 	if m != nil {
@@ -676,7 +703,7 @@ type CommentSentimentResults struct {
 func (m *CommentSentimentResults) Reset()                    { *m = CommentSentimentResults{} }
 func (m *CommentSentimentResults) String() string            { return proto.CompactTextString(m) }
 func (*CommentSentimentResults) ProtoMessage()               {}
-func (*CommentSentimentResults) Descriptor() ([]byte, []int) { return fileDescriptorPb, []int{19} }
+func (*CommentSentimentResults) Descriptor() ([]byte, []int) { return fileDescriptorPb, []int{20} }
 
 func (m *CommentSentimentResults) GetSentimentByDay() map[int32]*Sentiment {
 	if m != nil {
@@ -694,7 +721,7 @@ type AnalysisResults struct {
 func (m *AnalysisResults) Reset()                    { *m = AnalysisResults{} }
 func (m *AnalysisResults) String() string            { return proto.CompactTextString(m) }
 func (*AnalysisResults) ProtoMessage()               {}
-func (*AnalysisResults) Descriptor() ([]byte, []int) { return fileDescriptorPb, []int{20} }
+func (*AnalysisResults) Descriptor() ([]byte, []int) { return fileDescriptorPb, []int{21} }
 
 func (m *AnalysisResults) GetHeader() *Metadata {
 	if m != nil {
@@ -714,6 +741,7 @@ func init() {
 	proto.RegisterType((*Metadata)(nil), "Metadata")
 	proto.RegisterType((*BurndownSparseMatrixRow)(nil), "BurndownSparseMatrixRow")
 	proto.RegisterType((*BurndownSparseMatrix)(nil), "BurndownSparseMatrix")
+	proto.RegisterType((*FilesOwnership)(nil), "FilesOwnership")
 	proto.RegisterType((*BurndownAnalysisResults)(nil), "BurndownAnalysisResults")
 	proto.RegisterType((*CompressedSparseRowMatrix)(nil), "CompressedSparseRowMatrix")
 	proto.RegisterType((*Couples)(nil), "Couples")
@@ -737,86 +765,90 @@ func init() {
 func init() { proto.RegisterFile("pb.proto", fileDescriptorPb) }
 
 var fileDescriptorPb = []byte{
-	// 1289 bytes of a gzipped FileDescriptorProto
-	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x57, 0x4d, 0x73, 0xdc, 0x44,
-	0x13, 0x2e, 0xed, 0xf7, 0xf6, 0xfa, 0x23, 0x99, 0xe4, 0x8d, 0x95, 0x7d, 0xcb, 0x61, 0x51, 0x85,
-	0x60, 0x48, 0x50, 0xa8, 0x0d, 0x07, 0x08, 0x97, 0x38, 0x36, 0xa9, 0xb8, 0x2a, 0x06, 0x6a, 0x36,
-	0x81, 0xa3, 0x6a, 0xbc, 0x1a, 0x7b, 0x05, 0xab, 0x91, 0x6a, 0x46, 0x5a, 0x5b, 0x7f, 0x86, 0x1b,
-	0x07, 0xa8, 0xa2, 0x38, 0xf0, 0x07, 0x38, 0x70, 0xe1, 0x8f, 0xf0, 0x3b, 0xa8, 0xf9, 0xd2, 0x4a,
-	0x8b, 0x1c, 0xb8, 0x4d, 0x77, 0x3f, 0x3d, 0xf3, 0xcc, 0xd3, 0x3d, 0xbd, 0x5a, 0x18, 0xa4, 0x67,
-	0x7e, 0xca, 0x93, 0x2c, 0xf1, 0xfe, 0x6a, 0xc1, 0xe0, 0x94, 0x66, 0x24, 0x24, 0x19, 0x41, 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, 0xff, 0x0b, 0x16,
+	0xa3, 0xa0, 0x10, 0x0d, 0x00, 0x00,
 }

+ 9 - 2
internal/pb/pb.proto

@@ -33,6 +33,11 @@ message BurndownSparseMatrix {
     repeated BurndownSparseMatrixRow rows = 4;
 }
 
+message FilesOwnership {
+    // The sum always equals to the total number of lines in the file.
+    map<int32, int32> value = 1;
+}
+
 message BurndownAnalysisResults {
     // how many days are in each band [burndown_project, burndown_file, burndown_developer]
     int32 granularity = 1;
@@ -40,12 +45,14 @@ message BurndownAnalysisResults {
     int32 sampling = 2;
     // always exists
     BurndownSparseMatrix project = 3;
-    // this is included if `-burndown-files` was specified
+    // this is included if `--burndown-files` was specified
     repeated BurndownSparseMatrix files = 4;
-    // these two are included if `-burndown-people` was specified
+    // these two are included if `--burndown-people` was specified
     repeated BurndownSparseMatrix people = 5;
     // rows and cols order correspond to `burndown_developer`
     CompressedSparseRowMatrix people_interaction = 6;
+    // How many lines belong to relevant developers for each file. The order is the same as in `files`.
+    repeated FilesOwnership files_ownership = 7;
 }
 
 message CompressedSparseRowMatrix {

File diff suppressed because it is too large
+ 146 - 51
internal/pb/pb_pb2.py


BIN
internal/test_data/burndown.pb


+ 66 - 6
leaves/burndown.go

@@ -111,9 +111,13 @@ type BurndownResult struct {
 	// The number of samples depends on Sampling: the less Sampling, the bigger the number.
 	// The number of bands depends on Granularity: the less Granularity, the bigger the number.
 	GlobalHistory DenseHistory
-	// The key is the path inside the Git repository. The value's dimensions are the same as
+	// The key is a path inside the Git repository. The value's dimensions are the same as
 	// in GlobalHistory.
 	FileHistories map[string]DenseHistory
+	// The key is a path inside the Git repository. The value is a mapping from developer indexes
+	// (see reversedPeopleDict) and the owned line numbers. Their sum equals to the total number of
+	// lines in the file.
+	FileOwnership map[string]map[int]int
 	// [number of people][number of samples][number of bands]
 	PeopleHistories []DenseHistory
 	// [number of people][number of people + 2]
@@ -484,10 +488,28 @@ func (analyser *BurndownAnalysis) Boot() error {
 func (analyser *BurndownAnalysis) Finalize() interface{} {
 	globalHistory, lastDay := analyser.groupSparseHistory(analyser.globalHistory, -1)
 	fileHistories := map[string]DenseHistory{}
+	fileOwnership := map[string]map[int]int{}
 	for key, history := range analyser.fileHistories {
-		if len(history) > 0 {
-			fileHistories[key], _ = analyser.groupSparseHistory(history, lastDay)
+		if len(history) == 0 {
+			continue
 		}
+		fileHistories[key], _ = analyser.groupSparseHistory(history, lastDay)
+		file := analyser.files[key]
+		previousLine := 0
+		previousAuthor := identity.AuthorMissing
+		ownership := map[int]int{}
+		fileOwnership[key] = ownership
+		file.ForEach(func(line, value int) {
+			length := line - previousLine
+			if length > 0 {
+				ownership[previousAuthor] += length
+			}
+			previousLine = line
+			previousAuthor, _ = analyser.unpackPersonWithDay(int(value))
+			if previousAuthor == identity.AuthorMissing {
+				previousAuthor = -1
+			}
+		})
 	}
 	peopleHistories := make([]DenseHistory, analyser.PeopleNumber)
 	for i, history := range analyser.peopleHistories {
@@ -520,6 +542,7 @@ func (analyser *BurndownAnalysis) Finalize() interface{} {
 	return BurndownResult{
 		GlobalHistory:      globalHistory,
 		FileHistories:      fileHistories,
+		FileOwnership:      fileOwnership,
 		PeopleHistories:    peopleHistories,
 		PeopleMatrix:       peopleMatrix,
 		reversedPeopleDict: analyser.reversedPeopleDict,
@@ -559,8 +582,14 @@ func (analyser *BurndownAnalysis) Deserialize(pbmessage []byte) (interface{}, er
 	}
 	result.GlobalHistory = convertCSR(msg.Project)
 	result.FileHistories = map[string]DenseHistory{}
-	for _, mat := range msg.Files {
+	result.FileOwnership = map[string]map[int]int{}
+	for i, mat := range msg.Files {
 		result.FileHistories[mat.Name] = convertCSR(mat)
+		ownership := map[int]int{}
+		result.FileOwnership[mat.Name] = ownership
+		for key, val := range msg.FilesOwnership[i].Value {
+			ownership[int(key)] = int(val)
+		}
 	}
 	result.reversedPeopleDict = make([]string, len(msg.People))
 	result.PeopleHistories = make([]DenseHistory, len(msg.People))
@@ -613,6 +642,7 @@ func (analyser *BurndownAnalysis) MergeResults(
 				c1, c2)
 		}()
 	}
+	// we don't merge files
 	if len(merged.reversedPeopleDict) > 0 {
 		if len(bar1.PeopleHistories) > 0 || len(bar2.PeopleHistories) > 0 {
 			merged.PeopleHistories = make([]DenseHistory, len(merged.reversedPeopleDict))
@@ -924,6 +954,31 @@ func (analyser *BurndownAnalysis) serializeText(result *BurndownResult, writer i
 		for _, key := range keys {
 			yaml.PrintMatrix(writer, result.FileHistories[key], 4, key, true)
 		}
+		fmt.Fprintln(writer, "  files_ownership:")
+		okeys := make([]string, 0, len(result.FileOwnership))
+		for key := range result.FileOwnership {
+			okeys = append(okeys, key)
+		}
+		sort.Strings(okeys)
+		for _, key := range okeys {
+			owned := result.FileOwnership[key]
+			devs := make([]int, 0, len(owned))
+			for devi := range owned {
+				devs = append(devs, devi)
+			}
+			sort.Slice(devs, func(i, j int) bool {
+				return owned[devs[i]] > owned[devs[j]] // descending order
+			})
+			for x, devi := range devs {
+				var indent string
+				if x == 0 {
+					indent = "- "
+				} else {
+					indent = "  "
+				}
+				fmt.Fprintf(writer, "    %s%d: %d\n", indent, devi, owned[devi])
+			}
+		}
 	}
 
 	if len(result.PeopleHistories) > 0 {
@@ -950,11 +1005,16 @@ func (analyser *BurndownAnalysis) serializeBinary(result *BurndownResult, writer
 	}
 	if len(result.FileHistories) > 0 {
 		message.Files = make([]*pb.BurndownSparseMatrix, len(result.FileHistories))
+		message.FilesOwnership = make([]*pb.FilesOwnership, len(result.FileHistories))
 		keys := sortedKeys(result.FileHistories)
 		i := 0
 		for _, key := range keys {
-			message.Files[i] = pb.ToBurndownSparseMatrix(
-				result.FileHistories[key], key)
+			message.Files[i] = pb.ToBurndownSparseMatrix(result.FileHistories[key], key)
+			ownership := map[int32]int32{}
+			message.FilesOwnership[i] = &pb.FilesOwnership{Value: ownership}
+			for key, val := range result.FileOwnership[key] {
+				ownership[int32(key)] = int32(val)
+			}
 			i++
 		}
 	}

+ 26 - 8
leaves/burndown_test.go

@@ -316,10 +316,11 @@ func TestBurndownConsumeFinalize(t *testing.T) {
 	assert.Len(t, bd.fileHistories, 2)
 	out := bd.Finalize().(BurndownResult)
 	/*
-		GlobalHistory   [][]int64
-		FileHistories   map[string][][]int64
-		PeopleHistories [][][]int64
-		PeopleMatrix    [][]int64
+			GlobalHistory   [][]int64
+			FileHistories   map[string][][]int64
+		    FileOwnership   map[string]map[int]int
+			PeopleHistories [][][]int64
+			PeopleMatrix    [][]int64
 	*/
 	assert.Len(t, out.GlobalHistory, 2)
 	for i := 0; i < 2; i++ {
@@ -335,6 +336,9 @@ func TestBurndownConsumeFinalize(t *testing.T) {
 	assert.Len(t, out.FileHistories["burndown.go"], 2)
 	assert.Len(t, out.FileHistories["cmd/hercules/main.go"][0], 2)
 	assert.Len(t, out.FileHistories["burndown.go"][0], 2)
+	assert.Len(t, out.FileOwnership, 2)
+	assert.Equal(t, out.FileOwnership["cmd/hercules/main.go"], map[int]int{0: 171, 1: 119})
+	assert.Equal(t, out.FileOwnership["burndown.go"], map[int]int{0: 293, 1: 250})
 	assert.Len(t, out.PeopleMatrix, 2)
 	assert.Len(t, out.PeopleMatrix[0], 4)
 	assert.Len(t, out.PeopleMatrix[1], 4)
@@ -621,6 +625,11 @@ func TestBurndownSerialize(t *testing.T) {
     "cmd/hercules/main.go": |-
       207   0
       171 119
+  files_ownership:
+    - 0: 293
+      1: 250
+    - 0: 171
+      1: 119
   people_sequence:
     - "one@srcd"
     - "two@srcd"
@@ -659,6 +668,9 @@ func TestBurndownSerialize(t *testing.T) {
 	assert.Len(t, msg.Files[0].Rows[1].Columns, 2)
 	assert.Equal(t, msg.Files[0].Rows[1].Columns[0], uint32(293))
 	assert.Equal(t, msg.Files[0].Rows[1].Columns[1], uint32(250))
+	assert.Len(t, msg.FilesOwnership, 2)
+	assert.Equal(t, msg.FilesOwnership[0].Value, map[int32]int32{0: 293, 1: 250})
+	assert.Equal(t, msg.FilesOwnership[1].Value, map[int32]int32{0: 171, 1: 119})
 	assert.Len(t, msg.People, 2)
 	assert.Equal(t, msg.People[0].Name, "one@srcd")
 	assert.Equal(t, msg.People[1].Name, "two@srcd")
@@ -700,6 +712,11 @@ func TestBurndownSerializeAuthorMissing(t *testing.T) {
     "cmd/hercules/main.go": |-
       207   0
       171 119
+  files_ownership:
+    - 0: 293
+      -1: 250
+    - 0: 171
+      -1: 119
   people_sequence:
     - "one@srcd"
     - "two@srcd"
@@ -738,6 +755,9 @@ func TestBurndownSerializeAuthorMissing(t *testing.T) {
 	assert.Len(t, msg.Files[0].Rows[1].Columns, 2)
 	assert.Equal(t, msg.Files[0].Rows[1].Columns[0], uint32(293))
 	assert.Equal(t, msg.Files[0].Rows[1].Columns[1], uint32(250))
+	assert.Len(t, msg.FilesOwnership, 2)
+	assert.Equal(t, msg.FilesOwnership[0].Value, map[int32]int32{0: 293, -1: 250})
+	assert.Equal(t, msg.FilesOwnership[1].Value, map[int32]int32{0: 171, -1: 119})
 	assert.Len(t, msg.People, 2)
 	assert.Equal(t, msg.People[0].Name, "one@srcd")
 	assert.Equal(t, msg.People[1].Name, "two@srcd")
@@ -1255,15 +1275,13 @@ func TestBurndownMergeNils(t *testing.T) {
 func TestBurndownDeserialize(t *testing.T) {
 	allBuffer, err := ioutil.ReadFile(path.Join("..", "internal", "test_data", "burndown.pb"))
 	assert.Nil(t, err)
-	message := pb.AnalysisResults{}
-	err = proto.Unmarshal(allBuffer, &message)
-	assert.Nil(t, err)
 	bd := BurndownAnalysis{}
-	iresult, err := bd.Deserialize(message.Contents[bd.Name()])
+	iresult, err := bd.Deserialize(allBuffer)
 	assert.Nil(t, err)
 	result := iresult.(BurndownResult)
 	assert.True(t, len(result.GlobalHistory) > 0)
 	assert.True(t, len(result.FileHistories) > 0)
+	assert.Equal(t, len(result.FileOwnership), len(result.FileHistories))
 	assert.True(t, len(result.reversedPeopleDict) > 0)
 	assert.True(t, len(result.PeopleHistories) > 0)
 	assert.True(t, len(result.PeopleMatrix) > 0)