GetDiffStatsForCommit returns the diffstat for a single commit.
(dir, commitHash string)
| 138 | |
| 139 | // GetDiffStatsForCommit returns the diffstat for a single commit. |
| 140 | func 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>". |