MCPcopy Create free account
hub / github.com/MiniCodeMonkey/chief / GetDiffStatsForCommit

Function GetDiffStatsForCommit

internal/git/git.go:140–148  ·  view source on GitHub ↗

GetDiffStatsForCommit returns the diffstat for a single commit.

(dir, commitHash string)

Source from the content-addressed store, hash-verified

138
139// GetDiffStatsForCommit returns the diffstat for a single commit.
140func GetDiffStatsForCommit(dir, commitHash string) (string, error) {
141 cmd := exec.Command("git", "show", "--format=", "--stat", commitHash)
142 cmd.Dir = dir
143 output, err := cmd.Output()
144 if err != nil {
145 return "", err
146 }
147 return strings.TrimSpace(string(output)), nil
148}
149
150// FindCommitForStory searches the git log for a commit whose subject line
151// matches the chief commit format "feat: <storyID> - <title>".

Callers 1

loadDiffMethod · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected