drop support for "experimental" loose objects
commitb039718d925475124cb431a05f5933bd191bae27
authorJeff King <peff@peff.net>
Thu, 21 Nov 2013 11:48:37 +0000 (21 06:48 -0500)
committerJunio C Hamano <gitster@pobox.com>
Thu, 21 Nov 2013 19:43:42 +0000 (21 11:43 -0800)
treecf2ef205e9568365a643bfbaa4dfae9c4cd1479d
parentbecb4336cb05c5ec456babaeafefa2e24ee85773
drop support for "experimental" loose objects

In git v1.4.3, we introduced a new loose object format that
encoded some object information outside of the zlib stream.
Ultimately the format was dropped in v1.5.3, but we kept the
reading side around to help people migrate objects. Each
time we open a loose object, we use a heuristic to check
whether it is in the normal loose format, or the
experimental one.

This heuristic is robust in the face of valid data, but it
tends to treat corrupted or garbage data as an experimental
object. With the regular format, we would notice quickly
that zlib's crc does not check out and complain. With the
experimental object, we are likely to extract a nonsensical
object size and try to allocate a huge buffer, resulting in
xmalloc calling "die".

This latter behavior is much worse, for two reasons. One,
git reports an allocation error when the real error is
corruption. And two, the program dies unconditionally, so
you cannot even run fsck (which would otherwise ignore the
broken object and keep going).

We could try to improve the heuristic to err on the side of
normal objects in the face of corruption, but there is
really little point. The experimental format is long-dead,
and was never enabled by default to begin with. We can
instead simply remove it. The only affected repository would
be one that explicitly set core.legacyheaders in 2007, and
then never repacked in the intervening 6 years.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
19 files changed:
sha1_file.c
t/t1013-loose-object-format.sh [deleted file]
t/t1013/objects/14/9cedb5c46929d18e0f118e9fa31927487af3b6 [deleted file]
t/t1013/objects/16/56f9233d999f61ef23ef390b9c71d75399f435 [deleted file]
t/t1013/objects/1e/72a6b2c4a577ab0338860fa9fe87f761fc9bbd [deleted file]
t/t1013/objects/25/7cc5642cb1a054f08cc83f2d943e56fd3ebe99 [deleted file]
t/t1013/objects/2e/65efe2a145dda7ee51d1741299f848e5bf752e [deleted file]
t/t1013/objects/6b/aee0540ea990d9761a3eb9ab183003a71c3696 [deleted file]
t/t1013/objects/70/e6a83d8dcb26fc8bc0cf702e2ddeb6adca18fd [deleted file]
t/t1013/objects/76/e7fa9941f4d5f97f64fea65a2cba436bc79cbb [deleted file]
t/t1013/objects/78/75c6237d3fcdd0ac2f0decc7d3fa6a50b66c09 [deleted file]
t/t1013/objects/7a/37b887a73791d12d26c0d3e39568a8fb0fa6e8 [deleted file]
t/t1013/objects/85/df50785d62d3b05ab03d9cbf7e4a0b49449730 [deleted file]
t/t1013/objects/8d/4e360d6c70fbd72411991c02a09c442cf7a9fa [deleted file]
t/t1013/objects/95/b1625de3ba8b2214d1e0d0591138aea733f64f [deleted file]
t/t1013/objects/9a/e9e86b7bd6cb1472d9373702d8249973da0832 [deleted file]
t/t1013/objects/bd/15045f6ce8ff75747562173640456a394412c8 [deleted file]
t/t1013/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391 [deleted file]
t/t1013/objects/f8/16d5255855ac160652ee5253b06cd8ee14165a [deleted file]