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

Re: [PATCH 0/2] recover from "failed to apply delta"

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 14, 2013, 22:23 UTC
Message-ID
<7vbo78miwb.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20130614215618.GB29138@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 9 quoted lines
>> +     # At the beginning of the REF_DELTA representation of $blob_3,
>> +     # write 20-byte base object name for $blob_1, instead of $blob_2.
>> +     # The binary representation of object name for $blob_1 is found
>> +     # at offset 4 + 4 + 256*4 = 1032 for 20 bytes.
>> +     dd if=${pack}.idx bs=1 count=20 skip=1032 | do_corrupt_object $blob_3 2 20 &&
>> +     test_must_fail git cat-file blob $blob_3 >/dev/null &&
>
> I didn't want to bother coming up with the binary version of the
> REF_DELTA sha1, so I used OFS_DELTA. :)
Yeah, I contemplated on doing something like this
	printf "$(echo $blob_3 | sed -e 's/\(..\)/\\x\1/g')"

but of course printf "\xAA" is not in POSIX and at that point I punted and instead read from .idx at the known offset ;-)

Previous: Jeff KingNext: Jeff King
Message 7 of 11 in “unpack_entry: do not die when we fail to apply a delta”
  1. unpack_entry: do not die when we fail to apply a deltaJeff King, Jun 13, 2013
  2. Nicolas PitreJun 14, 2013
  3. 0/2 recover from "failed to apply delta"Jeff King, Jun 14, 2013
  4. 1/2 t5303: drop "count=1" from corruption ddJeff King, Jun 14, 2013
  5. Junio C HamanoJun 14, 2013
  6. Jeff KingJun 14, 2013
  7. Junio C HamanoJun 14, 2013
  8. 2/2 unpack_entry: do not die when we fail to apply a deltaJeff King, Jun 14, 2013
  9. Junio C HamanoJun 14, 2013
  10. Jeff KingJun 14, 2013
  11. Junio C HamanoJun 14, 2013

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.