save git commit msg and repo namespace
This commit is contained in:
parent
aa06450042
commit
b412e50df0
|
@ -159,6 +159,7 @@ func (p *Patchset) addPatchFiles(repo *gitpb.Repo) error {
|
|||
patch.Data = data
|
||||
patch.parseData()
|
||||
patch.StartHash = repo.DevelHash()
|
||||
patch.RepoNamespace = repo.GetGoPath()
|
||||
if p.Patches == nil {
|
||||
p.Patches = new(Patches)
|
||||
}
|
||||
|
@ -182,6 +183,8 @@ func (p *Patch) parseData() string {
|
|||
switch fields[0] {
|
||||
case "From":
|
||||
p.CommitHash = fields[1]
|
||||
case "Subject:":
|
||||
p.Comment = line
|
||||
case "diff":
|
||||
p.Files = append(p.Files, line)
|
||||
}
|
||||
|
|
|
@ -5,15 +5,17 @@ package forgepb;
|
|||
import "google/protobuf/timestamp.proto"; // Import the well-known type for Timestamp
|
||||
|
||||
message Patch {
|
||||
string filename = 1; // `autogenpb:unique` `autogenpb:sort`
|
||||
bytes data = 2; //
|
||||
string repoPath = 3; // path to the git repo
|
||||
string branchName = 4; //
|
||||
string branchHash = 5; //
|
||||
google.protobuf.Timestamp ctime = 7; // the git commit timestamp of this patch
|
||||
string commitHash = 8; // the git commit hash of this patch
|
||||
string filename = 1; // `autogenpb:unique` `autogenpb:sort`
|
||||
bytes data = 2; //
|
||||
string repoPath = 3; // path to the git repo
|
||||
string branchName = 4; //
|
||||
string branchHash = 5; //
|
||||
google.protobuf.Timestamp ctime = 7; // the git commit timestamp of this patch
|
||||
string commitHash = 8; // the git commit hash of this patch
|
||||
string startHash = 9; // the start commit hash
|
||||
repeated string Files = 10; // the filenames this patch changes
|
||||
repeated string Files = 10; // the filenames this patch changes
|
||||
string comment = 11; // the git commit message (in patch form)
|
||||
string repoNamespace = 12; // the base repo git URL
|
||||
}
|
||||
|
||||
message Patches { // `autogenpb:marshal`
|
||||
|
|
Loading…
Reference in New Issue