gradle-pre-commit-git-hooks icon indicating copy to clipboard operation
gradle-pre-commit-git-hooks copied to clipboard

Is there a way to disable the commit Message Hook ?

Open ErwanLeroux opened this issue 2 years ago • 4 comments

What would you like to be able to do?

Hello, I'm exploring the integration of this plugin inside one of my projects, and for now, I only want to use a pre commit hook, that part is working, but my commits are rejected because of the commit message hook :)

Is there a way to disable the creation of this hook ?

PS: nice work !

If you have any ideas on how this should be implemented, please tell us here.

Naively I would use something like this

commitMsg {
    disabled = true
}

Is this a feature you are interested in implementing yourself?

Yes

ErwanLeroux avatar Jan 15 '23 11:01 ErwanLeroux

I tried commitMsg {}, that created an empty file .git\hooks\commit-msg but the commit failed with "error: cannot spawn .git/hooks/commit-msg: No such file or directory" as if the empty file was not set with +x right

ErwanLeroux avatar Jan 15 '23 11:01 ErwanLeroux

Hi, I tried to reproduce this issue, and I was not able to. Can you provide a minimal reproduction example?

DanySK avatar Dec 10 '23 13:12 DanySK

I will be on holiday next week, I can try to do so then.

ErwanLeroux avatar Dec 10 '23 13:12 ErwanLeroux

Consider the following options:

  1. If you do not want a commit-msg, just omit that configuration block
  2. although commitMsg { } seems to work on Linux and OSX, it seems to be not to on Windows (sic). Try also commitMsg { from("#!/bin/sh") { "true" } }

DanySK avatar Dec 10 '23 14:12 DanySK