-
Notifications
You must be signed in to change notification settings - Fork 19
Description
I am just at the level of exploring githooks without having it
used fully yet, so maybe this is a bit early to raise an issue,
but here it goes anyway. :)
I noticed after installation of githooks, that -- as documented --
the githooks hooks are installed from the freshly generated
git template directory after I do a "git init". If I now change
any of the installed hooks in my local repository with something
else and do a "git hooks update/install", githooks will recognize
that one of its hooks have been overwritten and renames it
to something that won't be executed.
Why not do the following instead:
Move the non-githooks-hook to
$GIT_DIR/.githooks/<original-name-of-hook>/<NEW_NAME>
where NEW_NAME can be either generated to not collide
with the other hooks installed in that githooks subdirectory
and/or get entered by the user:
Enter new name for the pre-commit hook: 04-pre-commit
-- with 04-pre-commit having been generated and pre-filled at the
libreadline-supported prompt. And if you're really nice, you'll
let the prompt have a (at least temporary) history, so that when
some hook (like LFS (which is treated specially, I know)) gets
installed for 4 different events, the user doesn't have to type
"super-duper-hook" 4 times. Maybe you can check for existence
of "rlwrap".
It would also be nice if githooks would somehow detect overwritten
githooks hooks as early as possible (probably only possible by
making "git" a wrapper script).
Hopefully I haven't overlooked that all of this is long possible --
already spent an hour on reading the docs, but githooks is
quite a complex thing, despite it purportedly being "a simple
script". :)
P.S.: Thanks for all the work you already put into this project!
At least from the description, it seems to be the best of all
projects dealing with these kinds of git hooks problems. And
if you plan on rewriting this thing Go, then I'll just install the
last bash version and never update. :-P (Reason: Go is not
installed by default by many systems, also: one of the
"competing" git hooks projects required certain versions
of "Go", which strongly reminded me of "Best viewed with
Internet Explorer v1.2.3", which doesn't sound like a
desirable approach).