From b1b22d8cac72aa2259e79e45fcd8fc1028e9703d Mon Sep 17 00:00:00 2001 From: Richard Musiol Date: Mon, 18 Jan 2016 14:18:38 +0100 Subject: [PATCH] changed protobuf field names to camel case --- diff/diff.pb.go | 34 +++++++++++++++++----------------- diff/diff.proto | 34 +++++++++++++++++----------------- 2 files changed, 34 insertions(+), 34 deletions(-) diff --git a/diff/diff.pb.go b/diff/diff.pb.go index b869194..2e7c27f 100644 --- a/diff/diff.pb.go +++ b/diff/diff.pb.go @@ -37,17 +37,17 @@ var _ = math.Inf // +++ newname 2009-10-11 15:12:30.000000000 -0700 type FileDiff struct { // the original name of the file - OrigName string `protobuf:"bytes,1,opt,name=orig_name,proto3" json:"orig_name,omitempty"` + OrigName string `protobuf:"bytes,1,opt,name=OrigName,proto3" json:"OrigName,omitempty"` // the original timestamp (nil if not present) - OrigTime *pbtypes.Timestamp `protobuf:"bytes,2,opt,name=orig_time" json:"orig_time,omitempty"` + OrigTime *pbtypes.Timestamp `protobuf:"bytes,2,opt,name=OrigTime" json:"OrigTime,omitempty"` // the new name of the file (often same as OrigName) - NewName string `protobuf:"bytes,3,opt,name=new_name,proto3" json:"new_name,omitempty"` + NewName string `protobuf:"bytes,3,opt,name=NewName,proto3" json:"NewName,omitempty"` // the new timestamp (nil if not present) - NewTime *pbtypes.Timestamp `protobuf:"bytes,4,opt,name=new_time" json:"new_time,omitempty"` + NewTime *pbtypes.Timestamp `protobuf:"bytes,4,opt,name=NewTime" json:"NewTime,omitempty"` // extended header lines (e.g., git's "new mode ", "rename from ", etc.) - Extended []string `protobuf:"bytes,5,rep,name=extended" json:"extended,omitempty"` + Extended []string `protobuf:"bytes,5,rep,name=Extended" json:"Extended,omitempty"` // hunks that were changed from orig to new - Hunks []*Hunk `protobuf:"bytes,6,rep,name=hunks" json:"hunks,omitempty"` + Hunks []*Hunk `protobuf:"bytes,6,rep,name=Hunks" json:"Hunks,omitempty"` } func (m *FileDiff) Reset() { *m = FileDiff{} } @@ -58,24 +58,24 @@ func (*FileDiff) ProtoMessage() {} // unified diff. type Hunk struct { // starting line number in original file - OrigStartLine int32 `protobuf:"varint,1,opt,name=orig_start_line,proto3" json:"orig_start_line,omitempty"` + OrigStartLine int32 `protobuf:"varint,1,opt,name=OrigStartLine,proto3" json:"OrigStartLine,omitempty"` // number of lines the hunk applies to in the original file - OrigLines int32 `protobuf:"varint,2,opt,name=orig_lines,proto3" json:"orig_lines,omitempty"` + OrigLines int32 `protobuf:"varint,2,opt,name=OrigLines,proto3" json:"OrigLines,omitempty"` // if > 0, then the original file had a 'No newline at end of file' mark at this offset - OrigNoNewlineAt int32 `protobuf:"varint,3,opt,name=orig_no_newline_at,proto3" json:"orig_no_newline_at,omitempty"` + OrigNoNewlineAt int32 `protobuf:"varint,3,opt,name=OrigNoNewlineAt,proto3" json:"OrigNoNewlineAt,omitempty"` // starting line number in new file - NewStartLine int32 `protobuf:"varint,4,opt,name=new_start_line,proto3" json:"new_start_line,omitempty"` + NewStartLine int32 `protobuf:"varint,4,opt,name=NewStartLine,proto3" json:"NewStartLine,omitempty"` // number of lines the hunk applies to in the new file - NewLines int32 `protobuf:"varint,5,opt,name=new_lines,proto3" json:"new_lines,omitempty"` + NewLines int32 `protobuf:"varint,5,opt,name=NewLines,proto3" json:"NewLines,omitempty"` // optional section heading - Section string `protobuf:"bytes,6,opt,name=section,proto3" json:"section,omitempty"` + Section string `protobuf:"bytes,6,opt,name=Section,proto3" json:"Section,omitempty"` // 0-indexed line offset in unified file diff (including section headers); this is // only set when Hunks are read from entire file diff (i.e., when ReadAllHunks is // called) This accounts for hunk headers, too, so the StartPosition of the first // hunk will be 1. - StartPosition int32 `protobuf:"varint,7,opt,name=start_position,proto3" json:"start_position,omitempty"` + StartPosition int32 `protobuf:"varint,7,opt,name=StartPosition,proto3" json:"StartPosition,omitempty"` // hunk body (lines prefixed with '-', '+', or ' ') - Body []byte `protobuf:"bytes,8,opt,name=body,proto3" json:"body,omitempty"` + Body []byte `protobuf:"bytes,8,opt,name=Body,proto3" json:"Body,omitempty"` } func (m *Hunk) Reset() { *m = Hunk{} } @@ -85,11 +85,11 @@ func (*Hunk) ProtoMessage() {} // A Stat is a diff stat that represents the number of lines added/changed/deleted. type Stat struct { // number of lines added - Added int32 `protobuf:"varint,1,opt,name=added,proto3" json:""` + Added int32 `protobuf:"varint,1,opt,name=Added,proto3" json:""` // number of lines changed - Changed int32 `protobuf:"varint,2,opt,name=changed,proto3" json:""` + Changed int32 `protobuf:"varint,2,opt,name=Changed,proto3" json:""` // number of lines deleted - Deleted int32 `protobuf:"varint,3,opt,name=deleted,proto3" json:""` + Deleted int32 `protobuf:"varint,3,opt,name=Deleted,proto3" json:""` } func (m *Stat) Reset() { *m = Stat{} } diff --git a/diff/diff.proto b/diff/diff.proto index b381814..8915017 100644 --- a/diff/diff.proto +++ b/diff/diff.proto @@ -17,22 +17,22 @@ option (gogoproto.sizer_all) = true; // +++ newname 2009-10-11 15:12:30.000000000 -0700 message FileDiff { // the original name of the file - string orig_name = 1; + string OrigName = 1; // the original timestamp (nil if not present) - pbtypes.Timestamp orig_time = 2; + pbtypes.Timestamp OrigTime = 2; // the new name of the file (often same as OrigName) - string new_name = 3; + string NewName = 3; // the new timestamp (nil if not present) - pbtypes.Timestamp new_time = 4; + pbtypes.Timestamp NewTime = 4; // extended header lines (e.g., git's "new mode ", "rename from ", etc.) - repeated string extended = 5; + repeated string Extended = 5; // hunks that were changed from orig to new - repeated Hunk hunks = 6; + repeated Hunk Hunks = 6; } @@ -40,42 +40,42 @@ message FileDiff { // unified diff. message Hunk { // starting line number in original file - int32 orig_start_line = 1; + int32 OrigStartLine = 1; // number of lines the hunk applies to in the original file - int32 orig_lines = 2; + int32 OrigLines = 2; // if > 0, then the original file had a 'No newline at end of file' mark at this offset - int32 orig_no_newline_at = 3; + int32 OrigNoNewlineAt = 3; // starting line number in new file - int32 new_start_line = 4; + int32 NewStartLine = 4; // number of lines the hunk applies to in the new file - int32 new_lines = 5; + int32 NewLines = 5; // optional section heading - string section = 6; + string Section = 6; // 0-indexed line offset in unified file diff (including section headers); this is // only set when Hunks are read from entire file diff (i.e., when ReadAllHunks is // called) This accounts for hunk headers, too, so the StartPosition of the first // hunk will be 1. - int32 start_position = 7; + int32 StartPosition = 7; // hunk body (lines prefixed with '-', '+', or ' ') - bytes body = 8; + bytes Body = 8; } // A Stat is a diff stat that represents the number of lines added/changed/deleted. message Stat { // number of lines added - int32 added = 1 [(gogoproto.jsontag) = ""]; + int32 Added = 1 [(gogoproto.jsontag) = ""]; // number of lines changed - int32 changed = 2 [(gogoproto.jsontag) = ""]; + int32 Changed = 2 [(gogoproto.jsontag) = ""]; // number of lines deleted - int32 deleted = 3 [(gogoproto.jsontag) = ""]; + int32 Deleted = 3 [(gogoproto.jsontag) = ""]; }