diff --git a/cmd/git-sv/handlers.go b/cmd/git-sv/handlers.go index 206f194..efe9fc4 100644 --- a/cmd/git-sv/handlers.go +++ b/cmd/git-sv/handlers.go @@ -376,6 +376,11 @@ func validateCommitMessageHandler(git sv.Git, messageProcessor sv.MessageProcess return nil } + if source := c.String("source"); source == "merge" { + warn("commit message validation skipped, ignoring source: %s...", source) + return nil + } + filepath := filepath.Join(c.String("path"), c.String("file")) commitMessage, err := readFile(filepath) diff --git a/cmd/git-sv/main.go b/cmd/git-sv/main.go index d39f5c5..885b68f 100644 --- a/cmd/git-sv/main.go +++ b/cmd/git-sv/main.go @@ -144,7 +144,7 @@ func main() { { Name: "validate-commit-message", Aliases: []string{"vcm"}, - Usage: "use as prepare-commit-message hook to validate message", + Usage: "use as prepare-commit-message hook to validate and enhance commit message", Action: validateCommitMessageHandler(git, messageProcessor), Flags: []cli.Flag{ &cli.StringFlag{Name: "path", Required: true, Usage: "git working directory"},