Re: Bug: `git init` with hook `reference-transaction` running `git rev-parse --git-dir` fails

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Oct 11, 2024 at 12:09:18PM +0200, Gabriel Nützi wrote:
> > namely by checking whether the HEAD file exists in the Git directory. 
> 
> The problem here is the chicken-egg problem: How do I know inside a
> hook where to look for HEAD, so the non. env. way of doing this would
> be 'git rev-parse —git-dir' which crahshes… So there should be cleary
> some better way of knowing if a Git repo is on the way of beeing
> created, and when it is fully initialized. What about
> GIT_DIR_INITIALIZING and this variable does not exist once it is done
> or whats about making ‚git rev-parse —git-dir‘ not panic if the env.
> variables are defined. I guess for a good solution we need both?

Our documentation in githooks(5) says that the GIT_DIR environment
variable is always set so that the hook can identify the location of the
Git repository. So I'd argue that using git-rev-parse(1) is unnecessary
in the first place. Or am I missing something?

Patrick




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux