From: Nicolas Pitre Date: Mon, 14 Jul 2008 23:39:08 GMT Subject: Re: [BUG] commit walk machinery is dangerous ! Message-ID: In-Reply-To: <7vod50dote.fsf@gitster.siamese.dyndns.org> On Mon, 14 Jul 2008, Junio C Hamano wrote: > Nicolas Pitre writes: > > > It is those with semantic meaning (e.g. object doesn't exist) which > > should be audited, especially if used in the context of repository > > modification, which pretty much limits it to the test case I produced. > > I've been wondering if we should make the change 8eca0b4 (implement some > resilience against pack corruptions, 2008-06-23) less aggressive. > > It makes loose objects and data from other packs to be used as fallback > where we used to just punt, which is a genuine improvement for "salvaging" > mode of operation, but at the same time, it now forbids the callers to > expect that the objects they learned to exist from has_sha1_file() or > nth_packed_object_sha1() should never result NULL return value from > read_sha1_file(). > > It may make it safe again to fail if you cannot salvage using fallback > method after all. Something like the attached. Well, I have a different solution which should restore the original "behavior" in the presence of existing but non-readable objects. Patch will follow later. Nicolas