Re: [PATCH 4/4] commit: don't lazy-fetch commits
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Nov 30, 2022, 23:56 UTC
- Message-ID
- <xmqq5yewuhc0.fsf@gitster.g>
- In-Reply-To
- <6af8dcebd14d803fc8d2a01fbcc7f42ff380719d.1669839849.git.jonathantanmy@google.com>
Jonathan Tan <jonathantanmy@google.com> writes:
Show 11 quoted lines
> When parsing commits, fail fast when the commit is missing or > corrupt, instead of attempting to fetch them. This is done by > inlining repo_read_object_file() and setting the flag that > prevents fetching. > > This is motivated by a situation in which through a bug (not > necessarily through Git), there was corruption in the object store > of a partial clone. In this particular case, the problem was > exposed when "git gc" tried to expire reflogs, which calls > repo_parse_commit(), which triggers fetches of the missing > commits.
The assumption is that there will never be a filtering mode that says "give us tags and we will lazy-fetch everything reachable from it when we need it", with which the "solution" will break down, I think, and I would say it is probably good enough.