Improve logged messages

1. Quote commit message.
2. Log OK commits too.

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
Evgenii Stratonikov 2023-08-02 16:55:39 +03:00
parent 4d4511c407
commit 7616539e89

View file

@ -46,6 +46,8 @@ func main() {
lca = getMergeBase(r, head, from)
}
log.Printf("Resolved: %s", lca.Hash)
// Processing result.
var fail bool
@ -70,17 +72,18 @@ func main() {
header := lines[0]
if !rxHeader.MatchString(header) {
fail = true
fmt.Printf("Error: invalid header %s [%s]\n", header, id)
fmt.Printf("Error: invalid header '%s' [%s]\n", header, id)
return nil
}
// Check commit sign-off.
if !rxSignOff.MatchString(lines[len(lines)-1]) {
fail = true
fmt.Printf("Error: missing sign-off %s [%s]\n", header, id)
fmt.Printf("Error: missing sign-off '%s' [%s]\n", header, id)
return nil
}
fmt.Printf("OK: '%s' [%s]\n", header, id)
return nil
})