Skip to content

Commit b133e05

Browse files
committed
MINOR: more informational log messages
1 parent f3b61c8 commit b133e05

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

check-commit/check.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,11 +305,14 @@ func getCommitSubjects(repo *git.Repository, repoEnv *gitEnv) ([]string, error)
305305
if c.Hash == mergeBase[0].Hash {
306306
return ErrReachedMergeBase
307307
}
308-
log.Printf("collected commit hash %s", c.Hash)
308+
subjectOnly := strings.Split(c.Message, "\n")[0]
309309

310310
if !(repoEnv.EnvName == "Github" && repoEnv.Event == "pull_request" && gitlabMergeRegex.Match([]byte(c.Message))) {
311311
// ignore github pull request commits with subject "Merge x into y", these get added automatically by github
312-
subjects = append(subjects, strings.Split(c.Message, "\n")[0])
312+
subjects = append(subjects, subjectOnly)
313+
log.Printf("collected commit hash %s, subject '%s'", c.Hash, subjectOnly)
314+
} else {
315+
log.Printf("ignoring a pull_request Merge commit hash, %s subject '%s'", c.Hash, subjectOnly)
313316
}
314317

315318
return nil

0 commit comments

Comments
 (0)