MCPcopy Create free account
hub / github.com/alibaba/open-code-review / getCommitMessage

Function getCommitMessage

cmd/opencodereview/git.go:27–36  ·  view source on GitHub ↗
(repoDir, commit string)

Source from the content-addressed store, hash-verified

25}
26
27func getCommitMessage(repoDir, commit string) (string, error) {
28 // stdout only: CombinedOutput would prepend git warnings / GIT_TRACE
29 // lines to the commit message, which ocr review --commit then sends
30 // to the LLM as the review background.
31 out, err := runGitCmdStdout(repoDir, "log", "-1", "--format=%B", "--end-of-options", commit)
32 if err != nil {
33 return "", fmt.Errorf("git log failed: %w", err)
34 }
35 return strings.TrimSpace(string(out)), nil
36}

Callers 4

TestGetCommitMessageFunction · 0.85
resolveBackgroundFunction · 0.85

Calls 1

runGitCmdStdoutFunction · 0.85