git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Git Bug report

From
Phil Hord <phil.hord@gmail.com>
Date
Oct 6, 2011, 16:54 UTC
Message-ID
<CABURp0pGatN=i2V8sycD=w7EedYxMFHbw6JZNVaQV0vYRG8Hww@mail.gmail.com>
In-Reply-To
<7vy5wy145q.fsf@alter.siamese.dyndns.org>
On Thu, Oct 6, 2011 at 12:22 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 32 quoted lines
> Phil Hord <phil.hord@gmail.com> writes:
>
>> On Oct 5, 2011 9:14 PM, "SZEDER Gábor" <szeder@ira.uka.de> wrote:
>>>
>>> On Wed, Oct 05, 2011 at 05:44:54PM -0700, Junio C Hamano wrote:
>>> > SZEDER Gábor <szeder@ira.uka.de> writes:
>>> >
>>> > > And what about unreadable .git files?
>>> >
>>> > Having then inside a working tree is so sick that I do not think it
>>> > deserves consideration.
>>>
>>> I'm not sure why is this any different than having a .git directory
>>> that is not a repository inside a working tree.
>>
>> What should happen here? Ignore it and keep searching? Or fail?
>>
>> I just added some common gitfile detection code and I noticed that the
>> oddball case now is the one that dies on error rather than continuing to
>> search for alternate explanations.  I left the oddball behavior assuming it
>> is desireable, but now you have me rethinking it.
>
> Yeah, after thinking about it a bit more, whenever we see ".git" during
> the upward discovery process, we should always warn if we know it is _not_
> a GIT_DIR before looking for another ".git" at higher levels, as anything
> in that directory cannot be added. If we cannot tell if it is or is not
> a GIT_DIR, we should error out---the reason we cannot tell most likely is
> because we cannot read it, and such a file, if it is not a GIT_DIR, cannot
> be tracked in the real GIT_DIR at a higher level, and if it is a GIT_DIR,
> we cannot use it to record updates or inspect existing history.
>
> How's that sound as a guideline?
Ok.  Three cases, then:

if .git is valid, we use it. If .git is bogus, we warn about it and keep searching. If .git is unverifiable (permissions, IO-fail, etc.), we die.

Phil
Previous: Matthieu MoyNext: Aaron Schrab
Message 14 of 15 in “Git Bug report”
  1. Federico LucifrediOct 4, 2011
  2. Johannes SixtOct 5, 2011
  3. Report errors related to .git access during repository discoveryNguyễn Thái Ngọc Duy, Oct 5, 2011
  4. Federico LucifrediOct 5, 2011
  5. Fredrik GustafssonOct 5, 2011
  6. Junio C HamanoOct 5, 2011
  7. Nguyen Thai Ngoc DuyOct 5, 2011
  8. SZEDER GáborOct 6, 2011
  9. Junio C HamanoOct 6, 2011
  10. SZEDER GáborOct 6, 2011
  11. Phil HordOct 6, 2011
  12. Junio C HamanoOct 6, 2011
  13. Matthieu MoyOct 6, 2011
  14. Phil HordOct 6, 2011
  15. Aaron SchrabOct 6, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.