Re: [PATCH v8] setup: allow cwd/.git to be a symlink to a directory
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Feb 21, 2026, 17:20 UTC
- Message-ID
- <xmqqqzqerp21.fsf@gitster.g>
- In-Reply-To
- <60e4cbcd-6dfe-4e1a-9c63-be905c815bed@gmail.com>
Tian Yuchen <a3205153416@gmail.com> writes:
Show 13 quoted lines
>> This design decision may be debatable, but not tightening everything >> at once may be a prudent thing to do to avoid accidental regression. >> >> Having said that. >> >> If you have a directory ".git/" somewhere in your working tree, and >> the directory is somehow corrupt that is_git_directory() says "nope, >> that is not a valid Git directory", wouldn't you rather want to know >> about it as a potential problem? > > Great point. A corrupt '.git' dir is definitely a red flag. However, > silently ignoring it and moving on has been the historical behavior, > hasn't it?
Exactly. That is where my reference to "not tightening everything at once" comes from.
> Still, if we decide to tighten this in the future, it will be very > simple change within this new 'switch' structure. Nothing much to worry > about IMO.
Yup. Perhaps it would deserve a new "/* NEEDSWORK: should we catch a directory .git that is not a git directory here? */" comment there.
> Will send v9 soon, with commit message rewritten.
Thanks.