eli-schwartz / aurpublish

PKGBUILD management framework for the Arch User Repository
GNU General Public License v2.0
246 stars 18 forks source link

`aurpublish setup` doesn't effectively work when `global core.hooksPath` is set #21

Open thiagowfx opened 2 years ago

thiagowfx commented 2 years ago

If the user as a global core.hooksPath hook set (example: yours truly), aurpublish setup doesn't work.

One needs to explicitly set git config core.hooksPath .git/hooks in the aurpublish-backed repository.

Thinking a bit deeper about this, I don't think it's an aurpublish bug per se, it feels more like a bug in git.

I'd argue git should honor the implicit local hooks path over the global one if at least one hook exists therein.

Anyway, just wanted to file this as a heads up. aurpublish could optionally take care of this defensively by calling git config core.hooksPath .git/hooks as part of aurpublish setup. If you would like a PR I am happy do send you one. If you think this is unnecessary, feel free to close the issue, of course.

eli-schwartz commented 9 months ago

Thinking a bit deeper about this, I don't think it's an aurpublish bug per se, it feels more like a bug in git.

I'd argue git should honor the implicit local hooks path over the global one if at least one hook exists therein.

A counter-argument is that if you temporarily override the hooks location you should not need to delete your hooks directory just to make git respect your explicitly set option.

If you would like a PR I am happy do send you one. If you think this is unnecessary, feel free to close the issue, of course.

I would accept a patch for this, yes.

thiagowfx commented 9 months ago

I would accept a patch for this, yes.

Oh, it has been a while :D

Do you agree with the suggested proposal, then?

aurpublish could optionally take care of this defensively by calling git config core.hooksPath .git/hooks as part of aurpublish setup