diff --git a/knotserver/git/diff.go b/knotserver/git/diff.go index cc065b1c..81b6c736 100644 --- a/knotserver/git/diff.go +++ b/knotserver/git/diff.go @@ -79,6 +79,9 @@ func (g *GitRepo) Diff() (*types.NiceDiff, error) { nd.Stat.FilesChanged = len(diffs) nd.Commit.This = c.Hash.String() + nd.Commit.PGPSignature = c.PGPSignature + nd.Commit.Committer = c.Committer + nd.Commit.Tree = c.TreeHash.String() if parent.Hash.IsZero() { nd.Commit.Parent = "" @@ -88,6 +91,10 @@ func (g *GitRepo) Diff() (*types.NiceDiff, error) { nd.Commit.Author = c.Author nd.Commit.Message = c.Message + if v, ok := c.ExtraHeaders["change-id"]; ok { + nd.Commit.ChangedId = string(v) + } + return &nd, nil } diff --git a/types/diff.go b/types/diff.go index a9a809b4..5978dc6d 100644 --- a/types/diff.go +++ b/types/diff.go @@ -40,10 +40,14 @@ func (d *Diff) Stats() DiffStat { // A nicer git diff representation. type NiceDiff struct { Commit struct { - Message string `json:"message"` - Author object.Signature `json:"author"` - This string `json:"this"` - Parent string `json:"parent"` + Message string `json:"message"` + Author object.Signature `json:"author"` + This string `json:"this"` + Parent string `json:"parent"` + PGPSignature string `json:"pgp_signature"` + Committer object.Signature `json:"committer"` + Tree string `json:"tree"` + ChangedId string `json:"change_id"` } `json:"commit"` Stat struct { FilesChanged int `json:"files_changed"`