From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: Nicolas Pitre <nico@fluxnic.net>, git@vger.kernel.org
Subject: Re: [PATCH 0/2] recover from "failed to apply delta"
Date: Fri, 14 Jun 2013 15:23:16 -0700 [thread overview]
Message-ID: <7vbo78miwb.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <20130614215618.GB29138@sigill.intra.peff.net> (Jeff King's message of "Fri, 14 Jun 2013 17:56:18 -0400")
Jeff King <peff@peff.net> writes:
>> + # 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 ;-)
next prev parent reply other threads:[~2013-06-14 22:23 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-13 23:26 [PATCH] unpack_entry: do not die when we fail to apply a delta Jeff King
2013-06-14 0:05 ` Nicolas Pitre
2013-06-14 21:49 ` [PATCH 0/2] recover from "failed to apply delta" Jeff King
2013-06-14 21:51 ` [PATCH 1/2] t5303: drop "count=1" from corruption dd Jeff King
2013-06-14 21:51 ` [PATCH 0/2] recover from "failed to apply delta" Junio C Hamano
2013-06-14 21:56 ` Jeff King
2013-06-14 22:23 ` Junio C Hamano [this message]
2013-06-14 21:53 ` [PATCH 2/2] unpack_entry: do not die when we fail to apply a delta Jeff King
2013-06-14 21:59 ` Junio C Hamano
2013-06-14 22:19 ` Jeff King
2013-06-14 14:53 ` [PATCH] " Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7vbo78miwb.fsf@alter.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=nico@fluxnic.net \
--cc=peff@peff.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).