Closed nf-brentsaner closed 23 hours ago
@nf-brentsaner : Thanks alot for the pointers. I have seen this on the Windows build fail! But not on the Linux, obviously its also a Linux problem.
So what I see is that git init
already lunches some hooks, apparently and now Githooks fails, which is pretty bad.
I need to investigate, I guess its a new Git feature...?
@nf-brentsaner : This seems to be an issue in Githooks with Git 2.46, I need to find out what git init
does, which hook it triggers and then somehow fix it.
Maybe you can add also some more info: Can you run:
GITHOOKS_LOG_LEVEL=debug git init
# or
export GITHOOKS_LOG_LEVEL=debug
git init
Maybe you can add also some more info: Can you run:
GITHOOKS_LOG_LEVEL=debug git init # or export GITHOOKS_LOG_LEVEL=debug git init
of course, would be glad to- give me about 30m-1h when i'll be back at my keyboard.
@nf-brentsaner : Ok, it seems that reference-transaction
hook runs on git init
and inside the hook a git rev-parse --git-dir
does not work althoug the GIT_DIR
variable is defined AND the docs says the git rev-parse --git-dir
command reads $GIT_DIR
if defined. This is sad. So I probably have to workaround this, by first looking at GIT_DIR
myself.
Maybe report this upstream.
@nf-brentsaner : Fast fix: Disable reference-transaction
with git hooks installer --maintained-hooks "all,!reference-transaction" ...
OR do not use --centralized
, which will not run hooks on git init
(since you have no global core.hooksPath
set).
Closed by #176
Just checking in (...it took a bit longer than an hour to get back to my keyboard, heh), I've just tried 3.0.3 and I wanted to confirm the issue is fixed for me, looks like you nailed it. Thank you for being so responsive and fixing it so quickly!
This seems to be related to a recent update.
This creates a half-created broken .git subdirectory:
This seems to be triggered by ~/.githooks/release/githooks/git/gitcommon.go, i.e.
git(x).GetGitDirWorktree()
(https://github.com/gabyx/Githooks/blob/main/githooks/git/gitcommon.go#L113).This being called on a repo as part of initialization will (and does, as seen) fail.