From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: "Shawn Pearce" <spearce@spearce.org>,
"René Scharfe" <l.s.r@web.de>,
"Martin von Gagern" <Martin.vGagern@gmx.net>,
git <git@vger.kernel.org>
Subject: Re: [PATCH 2/2] index-pack: handle duplicate base objects gracefully
Date: Sun, 31 Aug 2014 15:23:30 -0700 [thread overview]
Message-ID: <xmqq38cc47tp.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <20140831152437.GB17449@peff.net> (Jeff King's message of "Sun, 31 Aug 2014 11:24:38 -0400")
Jeff King <peff@peff.net> writes:
> Broken ident lines are annoying, but not _too_ fundamentally bad.
> Duplicate tree entries are a lot worse. Fsck even distinguishes between
> "error" and "warning", but "index-pack --strict" treats both as a reason
> to reject the object. We could perhaps loosen that, and make sure our
> error/warning categories are reasonable.
A pack stream that records the same object twice is not a breakage
that is buried deep in the history and cannot be corrected without a
wholesale history rewrite, unlike commit objects with broken ident
lines or tree objects with 0-filled file type designators.
As such, I think it is a reasonable thing to do the following:
- "git repack" should be taught to dedup, as a way to recover from
such a breakage, if not done already.
- "git fsck" should complain, suggesting users to repack to
recover. It may even want to exit with non-zero status.
- "git receive-pack" and "git fetch-pack" should warn, loudly,
without failing. They should ideally not keep such a corrupt
pack stream on disk at all, de-duping the objects while
streaming, but if that is not practical, at least they should
give an easy way for the user to cause de-duping immediately (I
do not mind if that is "we detected that the other side fed us a
pack stream that is broken. We automatically correct the
breakage for you by repacking. Be patient while we do so").
- If the other side of "receive-pack/fetch-pack" implements the
agent capability, upon detecting such a breakage, it may not be a
bad idea to offer the user to send an e-mail reporting the
version of the software to a wall-of-shame e-mail address ;-).
I agree that a tree that records the same path twice should be
outright rejected. There is no sane recovery path.
next prev parent reply other threads:[~2014-08-31 22:23 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-21 11:35 [BUG] resolved deltas Petr Stodulka
2014-08-21 18:25 ` Petr Stodulka
2014-08-22 19:41 ` Martin von Gagern
2014-08-23 10:12 ` René Scharfe
2014-08-23 10:56 ` Jeff King
2014-08-23 11:04 ` Jeff King
2014-08-23 11:18 ` Jeff King
2014-08-25 16:39 ` René Scharfe
2014-08-28 22:08 ` Jeff King
2014-08-28 22:15 ` Jeff King
2014-08-28 23:04 ` Jeff King
2014-08-28 22:22 ` Jeff King
2014-08-28 23:14 ` Junio C Hamano
2014-08-29 20:55 ` Jeff King
2014-08-29 20:57 ` [PATCH 1/2] index-pack: fix race condition with duplicate bases Jeff King
2014-08-29 20:58 ` [PATCH 2/2] index-pack: handle duplicate base objects gracefully Jeff King
2014-08-29 21:56 ` Junio C Hamano
2014-08-29 22:08 ` Jeff King
2014-08-30 2:59 ` Shawn Pearce
2014-08-30 13:16 ` Jeff King
2014-08-30 16:00 ` René Scharfe
2014-08-31 15:17 ` Jeff King
2014-08-31 16:30 ` René Scharfe
2014-08-31 1:10 ` Shawn Pearce
2014-08-31 15:24 ` Jeff King
2014-08-31 22:23 ` Junio C Hamano [this message]
2014-08-30 13:23 ` [PATCH 3/2] t5309: mark delta-cycle failover tests as passing Jeff King
2014-08-31 15:15 ` Jeff King
2014-09-02 17:19 ` Junio C Hamano
2014-08-25 17:19 ` [BUG] resolved deltas Shawn Pearce
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqq38cc47tp.fsf@gitster.dls.corp.google.com \
--to=gitster@pobox.com \
--cc=Martin.vGagern@gmx.net \
--cc=git@vger.kernel.org \
--cc=l.s.r@web.de \
--cc=peff@peff.net \
--cc=spearce@spearce.org \
/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.
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 NNTP newsgroup(s).