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

[PATCH v4 00/21] fsck: better "invalid object" error reporting

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Jun 24, 2021, 19:23 UTC
Message-ID
<cover-00.21-00000000000-20210624T191754Z-avarab@gmail.com>
In-Reply-To
<cover-00.17-0000000000-20210520T111610Z-avarab@gmail.com>

A late re-roll of the v3[1] that's in "seen" and causing a couple of CI errors, both are solved with this version. For a recap of what this is about see v3's summary[1].

One was a "mv -v" issue on OSX, it asks interactively, and defaults to no, now moved to "mv -f" (as in other tests that move .git/objects/* files directly).

The other happened on one of the docker32 Linux boxes, and turned out to be an uninitialized variable bug, which happened to be initialized to a negative value there, and zero (or positive) everywhere else.

I also went through all the commentary on the v3 (particularly good feedback from Jonathan Tan) and hopefully addressed everything in one way or another. In particular the 12/21 is new here, split off from what's now 14/21. That change was the most complex one in the previous series.

1. https://lore.kernel.org/git/cover-00.17-0000000000-20210520T111610Z-avarab@gmail.com/
Ævar Arnfjörð Bjarmason (21):
  fsck tests: refactor one test to use a sub-repo
  fsck tests: add test for fsck-ing an unknown type
  cat-file tests: test for missing object with -t and -s
  cat-file tests: test that --allow-unknown-type isn't on by default
  rev-list tests: test for behavior with invalid object types
  cat-file tests: add corrupt loose object test
  cat-file tests: test for current --allow-unknown-type behavior
  cache.h: move object functions to object-store.h
  object-file.c: don't set "typep" when returning non-zero
  object-file.c: make parse_loose_header_extended() public
  object-file.c: add missing braces to loose_object_info()
  object-file.c: simplify unpack_loose_short_header()
  object-file.c: split up ternary in parse_loose_header()
  object-file.c: stop dying in parse_loose_header()
  object-file.c: guard against future bugs in loose_object_info()
  object-file.c: return -1, not "status" from unpack_loose_header()
  object-file.c: return -2 on "header too long" in unpack_loose_header()
  fsck: don't hard die on invalid object types
  object-store.h: move read_loose_object() below 'struct object_info'
  fsck: report invalid types recorded in objects
  fsck: report invalid object type-path combinations
 builtin/fast-export.c  |   2 +-
 builtin/fsck.c         |  28 ++++++-
 builtin/index-pack.c   |   2 +-
 builtin/mktag.c        |   3 +-
 cache.h                |  10 ---
 object-file.c          | 178 +++++++++++++++++++++--------------------
 object-store.h         |  62 +++++++++++---
 object.c               |   4 +-
 pack-check.c           |   3 +-
 streaming.c            |  10 ++-
 t/t1006-cat-file.sh    | 169 ++++++++++++++++++++++++++++++++++++++
 t/t1450-fsck.sh        |  64 +++++++++++----
 t/t6115-rev-list-du.sh |  11 +++
 13 files changed, 407 insertions(+), 139 deletions(-)
Range-diff against v3:
 1:  aa38b2bf9e7 =  1:  2e37971c016 fsck tests: refactor one test to use a sub-repo
 2:  82b64abd250 =  2:  79630a99433 fsck tests: add test for fsck-ing an unknown type
 3:  7c3c2fe25d9 =  3:  2b5366bfb9d cat-file tests: test for missing object with -t and -s
 4:  871b8200035 !  4:  ea9a5ef0920 cat-file tests: test that --allow-unknown-type isn't on by default
    @@ Metadata
      ## Commit message ##
         cat-file tests: test that --allow-unknown-type isn't on by default
     
    -    Fix a blindspot in the tests added in the tests for the
    -    --allow-unknown-type feature, added in 39e4ae38804 (cat-file: teach
    -    cat-file a '--allow-unknown-type' option, 2015-05-03).
    +    Fix a blindspot in the tests for the --allow-unknown-type feature
    +    added in 39e4ae38804 (cat-file: teach cat-file a
    +    '--allow-unknown-type' option, 2015-05-03). We should check that
    +    --allow-unknown-type isn't on by default.
     
         Before this change all the tests would succeed if --allow-unknown-type
         was on by default, let's fix that by asserting that -t and -s die on a
 5:  b98da9cc89e =  5:  8eaf0e6ddda rev-list tests: test for behavior with invalid object types
 6:  04cc1d20f62 !  6:  f0e9d92414e cat-file tests: add corrupt loose object test
    @@ t/t1006-cat-file.sh: test_expect_success "Size of large broken object is correct
     +		test_cmp out.expect out.actual &&
     +
     +		# Swap the two to corrupt the repository
    -+		mv -v "$other_path" "$empty_path" &&
    ++		mv -f "$other_path" "$empty_path" &&
     +		test_must_fail git fsck 2>err.fsck &&
     +		grep "hash mismatch" err.fsck &&
     +
    @@ t/t1006-cat-file.sh: test_expect_success "Size of large broken object is correct
     +
     +		# So far "cat-file" has been happy to spew the found
     +		# content out as-is. Try to make it zlib-invalid.
    -+		mv -v other.blob "$empty_path" &&
    ++		mv -f other.blob "$empty_path" &&
     +		test_must_fail git fsck 2>err.fsck &&
     +		grep "^error: inflate: data stream error (" err.fsck
     +	)
 7:  9217320888f =  7:  d797d2e8e9d cat-file tests: test for current --allow-unknown-type behavior
 8:  12dd4538794 =  8:  96310a0bb59 cache.h: move object functions to object-store.h
 -:  ----------- >  9:  54fb9189408 object-file.c: don't set "typep" when returning non-zero
 9:  6a5b78dcad8 = 10:  9d36fcbc44a object-file.c: make parse_loose_header_extended() public
10:  5d31d7e1a54 ! 11:  74c308adc19 object-file.c: add missing braces to loose_object_info()
    @@ object-file.c: static int loose_object_info(struct repository *r,
     +	}
      
      	munmap(map, mapsize);
    - 	if (status && oi->typep)
    + 	if (oi->sizep == &size_scratch)
11:  ee28089219f ! 12:  3f52149bfde object-file.c: stop dying in parse_loose_header()
    @@ Metadata
     Author: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
     
      ## Commit message ##
    -    object-file.c: stop dying in parse_loose_header()
    +    object-file.c: simplify unpack_loose_short_header()
     
    -    Start the libification of parse_loose_header() by making it return
    -    error codes and data instead of invoking die() by itself. For now
    -    we'll move the relevant die() call to loose_object_info() and
    -    read_loose_object() to keep this change smaller, but in subsequent
    -    commits we'll also libify those.
    +    Combine the unpack_loose_short_header(),
    +    unpack_loose_header_to_strbuf() and unpack_loose_header() functions
    +    into one.
     
    -    The reason this makes sense is that with the refactoring of
    -    parse_loose_header_extended() in an earlier commit the public
    -    interface for parse_loose_header() no longer just accepts a "unsigned
    -    long *sizep". Rather it accepts a "struct object_info *", that
    -    structure will be populated with information about the object.
    -
    -    It thus makes sense to further libify the interface so that it stops
    -    calling die() when it encounters OBJ_BAD, and instead rely on its
    -    callers to check the populated "oi->typep".
    -
    -    This also allows us to simplify away the
    -    unpack_loose_header_to_strbuf() function added in
    +    The unpack_loose_header_to_strbuf() function was added in
         46f034483eb (sha1_file: support reading from a loose object of unknown
    -    type, 2015-05-03). Its code was mostly copy/pasted between it and both
    -    of unpack_loose_header() and unpack_loose_short_header(). We now have
    -    a single unpack_loose_header() function which accepts an optional
    +    type, 2015-05-03).
    +
    +    Its code was mostly copy/pasted between it and both of
    +    unpack_loose_header() and unpack_loose_short_header(). We now have a
    +    single unpack_loose_header() function which accepts an optional
         "struct strbuf *" instead.
     
         I think the remaining unpack_loose_header() function could be further
         simplified, we're carrying some complexity just to be able to emit a
         garbage type longer than MAX_HEADER_LEN, we could alternatively just
    -    say "we found a garbage type <first 32 bytes>..." instead, but let's
    -    leave this in place for now.
    +    say "we found a garbage type <first 32 bytes>..." instead. But let's
    +    leave the current behavior in place for now.
     
         Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
     
    @@ object-file.c: static int unpack_loose_short_header(git_zstream *stream,
      		return 0;
      
     +	/*
    -+	 * We have a header longer than MAX_HEADER_LEN. We abort early
    -+	 * unless under we're running as e.g. "cat-file
    ++	 * We have a header longer than MAX_HEADER_LEN. The "header"
    ++	 * here is only non-NULL when we run "cat-file
     +	 * --allow-unknown-type".
     +	 */
     +	if (!header)
    @@ object-file.c: static int unpack_loose_short_header(git_zstream *stream,
      	/*
      	 * buffer[0..bufsiz] was not large enough.  Copy the partial
      	 * result out to header, and then append the result of further
    -@@ object-file.c: static void *unpack_loose_rest(git_zstream *stream,
    -  * too permissive for what we want to check. So do an anal
    -  * object header parse by hand.
    -  */
    --int parse_loose_header(const char *hdr,
    --		       struct object_info *oi,
    --		       unsigned int flags)
    -+int parse_loose_header(const char *hdr, struct object_info *oi)
    - {
    - 	const char *type_buf = hdr;
    - 	unsigned long size;
    -@@ object-file.c: int parse_loose_header(const char *hdr,
    - 	type = type_from_string_gently(type_buf, type_len, 1);
    - 	if (oi->type_name)
    - 		strbuf_add(oi->type_name, type_buf, type_len);
    --	/*
    --	 * Set type to 0 if its an unknown object and
    --	 * we're obtaining the type using '--allow-unknown-type'
    --	 * option.
    --	 */
    --	if ((flags & OBJECT_INFO_ALLOW_UNKNOWN_TYPE) && (type < 0))
    --		type = 0;
    --	else if (type < 0)
    --		die(_("invalid object type"));
    - 	if (oi->typep)
    - 		*oi->typep = type;
    - 
    -@@ object-file.c: int parse_loose_header(const char *hdr,
    - 	/*
    - 	 * The length must be followed by a zero byte
    - 	 */
    --	return *hdr ? -1 : type;
    -+	if (*hdr)
    -+		return -1;
    -+
    -+	/*
    -+	 * The format is valid, but the type may still be bogus. The
    -+	 * Caller needs to check its oi->typep.
    -+	 */
    -+	return 0;
    - }
    - 
    - static int loose_object_info(struct repository *r,
     @@ object-file.c: static int loose_object_info(struct repository *r,
      	unsigned long mapsize;
      	void *map;
    @@ object-file.c: static int loose_object_info(struct repository *r,
      	char hdr[MAX_HEADER_LEN];
      	struct strbuf hdrbuf = STRBUF_INIT;
      	unsigned long size_scratch;
    -+	enum object_type type_scratch;
     +	int allow_unknown = flags & OBJECT_INFO_ALLOW_UNKNOWN_TYPE;
      
      	if (oi->delta_base_oid)
      		oidclr(oi->delta_base_oid);
     @@ object-file.c: static int loose_object_info(struct repository *r,
      
    - 	if (!oi->sizep)
    - 		oi->sizep = &size_scratch;
    -+	if (!oi->typep)
    -+		oi->typep = &type_scratch;
    - 
      	if (oi->disk_sizep)
      		*oi->disk_sizep = mapsize;
     -	if ((flags & OBJECT_INFO_ALLOW_UNKNOWN_TYPE)) {
    @@ object-file.c: static int loose_object_info(struct repository *r,
      		status = error(_("unable to unpack %s header"),
      			       oid_to_hex(oid));
      	}
    --
    --	if (status < 0) {
    --		/* Do nothing */
    --	} else if (hdrbuf.len) {
    --		if ((status = parse_loose_header(hdrbuf.buf, oi, flags)) < 0)
    --			status = error(_("unable to parse %s header with --allow-unknown-type"),
    --				       oid_to_hex(oid));
    --	} else if ((status = parse_loose_header(hdr, oi, flags)) < 0) {
    -+	if (!status && parse_loose_header(hdrbuf.len ? hdrbuf.buf : hdr, oi) < 0) {
    - 		status = error(_("unable to parse %s header"), oid_to_hex(oid));
    - 	}
    -+	if (!allow_unknown && *oi->typep < 0)
    -+		die(_("invalid object type"));
    - 
    - 	if (status >= 0 && oi->contentp) {
    - 		*oi->contentp = unpack_loose_rest(&stream, hdr,
    -@@ object-file.c: static int loose_object_info(struct repository *r,
    - 		*oi->typep = status;
    - 	if (oi->sizep == &size_scratch)
    - 		oi->sizep = NULL;
    --	strbuf_release(&hdrbuf);
    -+	if (oi->typep == &type_scratch)
    -+		oi->typep = NULL;
    - 	oi->whence = OI_LOOSE;
    - 	return (status < 0) ? status : 0;
    - }
    -@@ object-file.c: int read_loose_object(const char *path,
    - 	git_zstream stream;
    - 	char hdr[MAX_HEADER_LEN];
    - 	struct object_info oi = OBJECT_INFO_INIT;
    -+	oi.typep = type;
    - 	oi.sizep = size;
    - 
    - 	*contents = NULL;
     @@ object-file.c: int read_loose_object(const char *path,
      		goto out;
      	}
    @@ object-file.c: int read_loose_object(const char *path,
      		error(_("unable to unpack header of %s"), path);
      		goto out;
      	}
    - 
    --	*type = parse_loose_header(hdr, &oi, 0);
    --	if (*type < 0) {
    -+	if (parse_loose_header(hdr, &oi) < 0) {
    - 		error(_("unable to parse header of %s"), path);
    - 		git_inflate_end(&stream);
    - 		goto out;
    - 	}
    -+	if (*type < 0)
    -+		die(_("invalid object type"));
    - 
    - 	if (*type == OBJ_BLOB && *size > big_file_threshold) {
    - 		if (check_stream_oid(&stream, hdr, *size, path, expected_oid) < 0)
     
      ## object-store.h ##
     @@ object-store.h: int for_each_object_in_pack(struct packed_git *p,
    @@ object-store.h: int for_each_object_in_pack(struct packed_git *p,
      int unpack_loose_header(git_zstream *stream, unsigned char *map,
      			unsigned long mapsize, void *buffer,
     -			unsigned long bufsiz);
    --int parse_loose_header(const char *hdr, struct object_info *oi,
    --		       unsigned int flags);
     +			unsigned long bufsiz, struct strbuf *hdrbuf);
    -+
    -+/**
    -+ * parse_loose_header() parses the starting "<type> <len>\0" of an
    -+ * object. If it doesn't follow that format -1 is returned. To check
    -+ * the validity of the <type> populate the "typep" in the "struct
    -+ * object_info". It will be OBJ_BAD if the object type is unknown.
    -+ */
    -+int parse_loose_header(const char *hdr, struct object_info *oi);
    -+
    + int parse_loose_header(const char *hdr, struct object_info *oi,
    + 		       unsigned int flags);
      int check_object_signature(struct repository *r, const struct object_id *oid,
    - 			   void *buf, unsigned long size, const char *type);
    - int finalize_object_file(const char *tmpfile, const char *filename);
     
      ## streaming.c ##
    -@@ streaming.c: static int open_istream_loose(struct git_istream *st, struct repository *r,
    - {
    - 	struct object_info oi = OBJECT_INFO_INIT;
    - 	oi.sizep = &st->size;
    -+	oi.typep = type;
    - 
    - 	st->u.loose.mapped = map_loose_object(r, oid, &st->u.loose.mapsize);
    - 	if (!st->u.loose.mapped)
     @@ streaming.c: static int open_istream_loose(struct git_istream *st, struct repository *r,
      				 st->u.loose.mapped,
      				 st->u.loose.mapsize,
      				 st->u.loose.hdr,
     -				 sizeof(st->u.loose.hdr)) < 0) ||
    --	    (parse_loose_header(st->u.loose.hdr, &oi, 0) < 0)) {
     +				 sizeof(st->u.loose.hdr),
     +				 NULL) < 0) ||
    -+	    (parse_loose_header(st->u.loose.hdr, &oi) < 0) ||
    -+	    *type < 0) {
    + 	    (parse_loose_header(st->u.loose.hdr, &oi, 0) < 0)) {
      		git_inflate_end(&st->z);
      		munmap(st->u.loose.mapped, st->u.loose.mapsize);
    - 		return -1;
 -:  ----------- > 13:  ba632be1520 object-file.c: split up ternary in parse_loose_header()
 -:  ----------- > 14:  ea4f446f5b1 object-file.c: stop dying in parse_loose_header()
 -:  ----------- > 15:  aacef784eab object-file.c: guard against future bugs in loose_object_info()
13:  d22d5b8b85e = 16:  050cfc7808c object-file.c: return -1, not "status" from unpack_loose_header()
12:  77f2cd439c6 ! 17:  78e3152fd94 object-file.c: return -2 on "header too long" in unpack_loose_header()
    @@ Commit message
         MAX_HEADER_LEN limit, or other negative values for "unable to unpack
         <OID> header".
     
    +    I tried setting up an enum just for these three return values, but I
    +    think the result was less readable. Let's consider doing that if we
    +    gain even more return values. For now let's do the next best thing and
    +    enumerate our known return values, and BUG() if we encounter one we
    +    don't know about.
    +
         Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
     
      ## object-file.c ##
     @@ object-file.c: int unpack_loose_header(git_zstream *stream,
    - 	/*
    - 	 * We have a header longer than MAX_HEADER_LEN. We abort early
    - 	 * unless under we're running as e.g. "cat-file
    --	 * --allow-unknown-type".
    -+	 * --allow-unknown-type". A -2 is "header too long"
    + 	 * --allow-unknown-type".
      	 */
      	if (!header)
     -		return -1;
    @@ object-file.c: int unpack_loose_header(git_zstream *stream,
      
      static void *unpack_loose_rest(git_zstream *stream,
     @@ object-file.c: static int loose_object_info(struct repository *r,
    + 
      	hdr_ret = unpack_loose_header(&stream, map, mapsize, hdr, sizeof(hdr),
      				      allow_unknown ? &hdrbuf : NULL);
    - 	if (hdr_ret < 0) {
    --		status = error(_("unable to unpack %s header"),
    --			       oid_to_hex(oid));
    -+		if (hdr_ret == -2)
    -+			status = error(_("header for %s too long, exceeds %d bytes"),
    -+				       oid_to_hex(oid), MAX_HEADER_LEN);
    -+		else
    -+			status = error(_("unable to unpack %s header"),
    -+				       oid_to_hex(oid));
    - 	}
    -+
    - 	if (!status && parse_loose_header(hdrbuf.len ? hdrbuf.buf : hdr, oi) < 0) {
    - 		status = error(_("unable to parse %s header"), oid_to_hex(oid));
    +-	if (hdr_ret < 0) {
    ++	switch (hdr_ret) {
    ++	case 0:
    ++		break;
    ++	case -1:
    + 		status = error(_("unable to unpack %s header"),
    + 			       oid_to_hex(oid));
    ++		break;
    ++	case -2:
    ++		status = error(_("header for %s too long, exceeds %d bytes"),
    ++			       oid_to_hex(oid), MAX_HEADER_LEN);
    ++		break;
    ++	default:
    ++		BUG("unknown hdr_ret value %d", hdr_ret);
      	}
    + 	if (!status) {
    + 		if (!parse_loose_header(hdrbuf.len ? hdrbuf.buf : hdr, oi))
     
      ## object-store.h ##
     @@ object-store.h: int for_each_packed_object(each_packed_object_fn, void *,
14:  260e9888a3e = 18:  f9bb1b799ac fsck: don't hard die on invalid object types
15:  e2afb813b28 = 19:  acbea7e2a2a object-store.h: move read_loose_object() below 'struct object_info'
16:  328f05c51b3 = 20:  edc28de229d fsck: report invalid types recorded in objects
17:  c5e6686765d ! 21:  e588c05f461 fsck: report invalid object type-path combinations
    @@ pack-check.c: static int verify_packfile(struct repository *r,
      ## t/t1006-cat-file.sh ##
     @@ t/t1006-cat-file.sh: test_expect_success 'cat-file -t and -s on corrupt loose object' '
      		# Swap the two to corrupt the repository
    - 		mv -v "$other_path" "$empty_path" &&
    + 		mv -f "$other_path" "$empty_path" &&
      		test_must_fail git fsck 2>err.fsck &&
     -		grep "hash mismatch" err.fsck &&
     +		grep "hash-path mismatch" err.fsck &&
-- 
2.32.0.606.g2e440ee2c94
Previous: Felipe ContrerasNext: Ævar Arnfjörð Bjarmason
Message 55 of 245 in “usage.c: add a non-fatal bug() + misc doc fixes”
  1. 0/4 usage.c: add a non-fatal bug() + misc doc fixesÆvar Arnfjörð Bjarmason, Mar 28, 2021
  2. 3/4 api docs: document that BUG() emits a trace2 error eventÆvar Arnfjörð Bjarmason, Mar 28, 2021
  3. 1/4 usage.c: don't copy/paste the same comment three timesÆvar Arnfjörð Bjarmason, Mar 28, 2021
  4. Eric SunshineMar 28, 2021
  5. 2/4 api docs: document BUG() in api-error-handling.txtÆvar Arnfjörð Bjarmason, Mar 28, 2021
  6. Bagas SanjayaMar 29, 2021
  7. 4/4 usage.c: add a non-fatal bug() function to go with BUG()Ævar Arnfjörð Bjarmason, Mar 28, 2021
  8. 0/5 fsck: improve error reportingÆvar Arnfjörð Bjarmason, Mar 28, 2021
  9. 2/5 fsck tests: refactor one test to use a sub-repoÆvar Arnfjörð Bjarmason, Mar 28, 2021
  10. 1/5 cache.h: move object functions to object-store.hÆvar Arnfjörð Bjarmason, Mar 28, 2021
  11. 3/5 fsck: don't hard die on invalid object typesÆvar Arnfjörð Bjarmason, Mar 28, 2021
  12. 4/5 fsck: improve the error on invalid object typesÆvar Arnfjörð Bjarmason, Mar 28, 2021
  13. Johannes SixtMar 28, 2021
  14. 5/5 fsck: improve error on loose object hash mismatchÆvar Arnfjörð Bjarmason, Mar 28, 2021
  15. 0/6 fsck: better "invalid object" error reportingÆvar Arnfjörð Bjarmason, Apr 13, 2021
  16. 1/6 cache.h: move object functions to object-store.hÆvar Arnfjörð Bjarmason, Apr 13, 2021
  17. 2/6 fsck tests: refactor one test to use a sub-repoÆvar Arnfjörð Bjarmason, Apr 13, 2021
  18. 4/6 object-store.h: move read_loose_object() below 'struct object_info'Ævar Arnfjörð Bjarmason, Apr 13, 2021
  19. Jeff KingApr 23, 2021
  20. 5/6 fsck: report invalid types recorded in objectsÆvar Arnfjörð Bjarmason, Apr 13, 2021
  21. Jeff KingApr 23, 2021
  22. Ævar Arnfjörð BjarmasonApr 26, 2021
  23. Jeff KingApr 26, 2021
  24. 3/6 fsck: don't hard die on invalid object typesÆvar Arnfjörð Bjarmason, Apr 13, 2021
  25. Jeff KingApr 23, 2021
  26. 6/6 fsck: report invalid object type-path combinationsÆvar Arnfjörð Bjarmason, Apr 13, 2021
  27. 00/17 fsck: better "invalid object" error reportingÆvar Arnfjörð Bjarmason, May 20, 2021
  28. 01/17 fsck tests: refactor one test to use a sub-repoÆvar Arnfjörð Bjarmason, May 20, 2021
  29. 02/17 fsck tests: add test for fsck-ing an unknown typeÆvar Arnfjörð Bjarmason, May 20, 2021
  30. 04/17 cat-file tests: test that --allow-unknown-type isn't on by defaultÆvar Arnfjörð Bjarmason, May 20, 2021
  31. Jonathan NiederMay 27, 2021
  32. Ævar Arnfjörð BjarmasonMay 28, 2021
  33. 03/17 cat-file tests: test for missing object with -t and -sÆvar Arnfjörð Bjarmason, May 20, 2021
  34. 05/17 rev-list tests: test for behavior with invalid object typesÆvar Arnfjörð Bjarmason, May 20, 2021
  35. 06/17 cat-file tests: add corrupt loose object testÆvar Arnfjörð Bjarmason, May 20, 2021
  36. 07/17 cat-file tests: test for current --allow-unknown-type behaviorÆvar Arnfjörð Bjarmason, May 20, 2021
  37. 09/17 object-file.c: make parse_loose_header_extended() publicÆvar Arnfjörð Bjarmason, May 20, 2021
  38. 11/17 object-file.c: stop dying in parse_loose_header()Ævar Arnfjörð Bjarmason, May 20, 2021
  39. Jonathan TanMay 27, 2021
  40. 10/17 object-file.c: add missing braces to loose_object_info()Ævar Arnfjörð Bjarmason, May 20, 2021
  41. 08/17 cache.h: move object functions to object-store.hÆvar Arnfjörð Bjarmason, May 20, 2021
  42. 14/17 fsck: don't hard die on invalid object typesÆvar Arnfjörð Bjarmason, May 20, 2021
  43. Jonathan TanMay 27, 2021
  44. 17/17 fsck: report invalid object type-path combinationsÆvar Arnfjörð Bjarmason, May 20, 2021
  45. Jonathan TanMay 27, 2021
  46. 15/17 object-store.h: move read_loose_object() below 'struct object_info'Ævar Arnfjörð Bjarmason, May 20, 2021
  47. 13/17 object-file.c: return -1, not "status" from unpack_loose_header()Ævar Arnfjörð Bjarmason, May 20, 2021
  48. 12/17 object-file.c: return -2 on "header too long" in unpack_loose_header()Ævar Arnfjörð Bjarmason, May 20, 2021
  49. Jonathan TanMay 27, 2021
  50. 16/17 fsck: report invalid types recorded in objectsÆvar Arnfjörð Bjarmason, May 20, 2021
  51. Jonathan TanMay 27, 2021
  52. Jonathan TanMay 27, 2021
  53. Junio C HamanoMay 28, 2021
  54. Felipe ContrerasMay 28, 2021
  55. 00/21 fsck: better "invalid object" error reportingÆvar Arnfjörð Bjarmason, Jun 24, 2021
  56. 01/21 fsck tests: refactor one test to use a sub-repoÆvar Arnfjörð Bjarmason, Jun 24, 2021
  57. Andrei RybakJun 24, 2021
  58. Ævar Arnfjörð BjarmasonJun 24, 2021
  59. 02/21 fsck tests: add test for fsck-ing an unknown typeÆvar Arnfjörð Bjarmason, Jun 24, 2021
  60. 03/21 cat-file tests: test for missing object with -t and -sÆvar Arnfjörð Bjarmason, Jun 24, 2021
  61. 04/21 cat-file tests: test that --allow-unknown-type isn't on by defaultÆvar Arnfjörð Bjarmason, Jun 24, 2021
  62. 05/21 rev-list tests: test for behavior with invalid object typesÆvar Arnfjörð Bjarmason, Jun 24, 2021
  63. 06/21 cat-file tests: add corrupt loose object testÆvar Arnfjörð Bjarmason, Jun 24, 2021
  64. 07/21 cat-file tests: test for current --allow-unknown-type behaviorÆvar Arnfjörð Bjarmason, Jun 24, 2021
  65. 08/21 cache.h: move object functions to object-store.hÆvar Arnfjörð Bjarmason, Jun 24, 2021
  66. 10/21 object-file.c: make parse_loose_header_extended() publicÆvar Arnfjörð Bjarmason, Jun 24, 2021
  67. 09/21 object-file.c: don't set "typep" when returning non-zeroÆvar Arnfjörð Bjarmason, Jun 24, 2021
  68. 11/21 object-file.c: add missing braces to loose_object_info()Ævar Arnfjörð Bjarmason, Jun 24, 2021
  69. 12/21 object-file.c: simplify unpack_loose_short_header()Ævar Arnfjörð Bjarmason, Jun 24, 2021
  70. 13/21 object-file.c: split up ternary in parse_loose_header()Ævar Arnfjörð Bjarmason, Jun 24, 2021
  71. 14/21 object-file.c: stop dying in parse_loose_header()Ævar Arnfjörð Bjarmason, Jun 24, 2021
  72. 15/21 object-file.c: guard against future bugs in loose_object_info()Ævar Arnfjörð Bjarmason, Jun 24, 2021
  73. 16/21 object-file.c: return -1, not "status" from unpack_loose_header()Ævar Arnfjörð Bjarmason, Jun 24, 2021
  74. 17/21 object-file.c: return -2 on "header too long" in unpack_loose_header()Ævar Arnfjörð Bjarmason, Jun 24, 2021
  75. 18/21 fsck: don't hard die on invalid object typesÆvar Arnfjörð Bjarmason, Jun 24, 2021
  76. 19/21 object-store.h: move read_loose_object() below 'struct object_info'Ævar Arnfjörð Bjarmason, Jun 24, 2021
  77. 20/21 fsck: report invalid types recorded in objectsÆvar Arnfjörð Bjarmason, Jun 24, 2021
  78. 21/21 fsck: report invalid object type-path combinationsÆvar Arnfjörð Bjarmason, Jun 24, 2021
  79. 00/21 fsck: lib-ify object-file.c & better fsck "invalid object" error reportingÆvar Arnfjörð Bjarmason, Jul 10, 2021
  80. 01/21 fsck tests: refactor one test to use a sub-repoÆvar Arnfjörð Bjarmason, Jul 10, 2021
  81. 05/21 rev-list tests: test for behavior with invalid object typesÆvar Arnfjörð Bjarmason, Jul 10, 2021
  82. 02/21 fsck tests: add test for fsck-ing an unknown typeÆvar Arnfjörð Bjarmason, Jul 10, 2021
  83. 06/21 cat-file tests: add corrupt loose object testÆvar Arnfjörð Bjarmason, Jul 10, 2021
  84. 04/21 cat-file tests: test that --allow-unknown-type isn't on by defaultÆvar Arnfjörð Bjarmason, Jul 10, 2021
  85. 03/21 cat-file tests: test for missing object with -t and -sÆvar Arnfjörð Bjarmason, Jul 10, 2021
  86. 07/21 cat-file tests: test for current --allow-unknown-type behaviorÆvar Arnfjörð Bjarmason, Jul 10, 2021
  87. 08/21 cache.h: move object functions to object-store.hÆvar Arnfjörð Bjarmason, Jul 10, 2021
  88. 10/21 object-file.c: make parse_loose_header_extended() publicÆvar Arnfjörð Bjarmason, Jul 10, 2021
  89. 09/21 object-file.c: don't set "typep" when returning non-zeroÆvar Arnfjörð Bjarmason, Jul 10, 2021
  90. 12/21 object-file.c: simplify unpack_loose_short_header()Ævar Arnfjörð Bjarmason, Jul 10, 2021
  91. 11/21 object-file.c: add missing braces to loose_object_info()Ævar Arnfjörð Bjarmason, Jul 10, 2021
  92. 13/21 object-file.c: split up ternary in parse_loose_header()Ævar Arnfjörð Bjarmason, Jul 10, 2021
  93. 14/21 object-file.c: stop dying in parse_loose_header()Ævar Arnfjörð Bjarmason, Jul 10, 2021
  94. 15/21 object-file.c: guard against future bugs in loose_object_info()Ævar Arnfjörð Bjarmason, Jul 10, 2021
  95. 16/21 object-file.c: return -1, not "status" from unpack_loose_header()Ævar Arnfjörð Bjarmason, Jul 10, 2021
  96. 17/21 object-file.c: return -2 on "header too long" in unpack_loose_header()Ævar Arnfjörð Bjarmason, Jul 10, 2021
  97. 19/21 object-store.h: move read_loose_object() below 'struct object_info'Ævar Arnfjörð Bjarmason, Jul 10, 2021
  98. 18/21 fsck: don't hard die on invalid object typesÆvar Arnfjörð Bjarmason, Jul 10, 2021
  99. 20/21 fsck: report invalid types recorded in objectsÆvar Arnfjörð Bjarmason, Jul 10, 2021
  100. 21/21 fsck: report invalid object type-path combinationsÆvar Arnfjörð Bjarmason, Jul 10, 2021
  101. 00/22 fsck: lib-ify object-file.c & better fsck "invalid object" error reportingÆvar Arnfjörð Bjarmason, Sep 7, 2021
  102. 01/22 fsck tests: refactor one test to use a sub-repoÆvar Arnfjörð Bjarmason, Sep 7, 2021
  103. Taylor BlauSep 16, 2021
  104. Ævar Arnfjörð BjarmasonSep 17, 2021
  105. 02/22 fsck tests: add test for fsck-ing an unknown typeÆvar Arnfjörð Bjarmason, Sep 7, 2021
  106. Taylor BlauSep 16, 2021
  107. Ævar Arnfjörð BjarmasonSep 17, 2021
  108. 03/22 cat-file tests: test for missing object with -t and -sÆvar Arnfjörð Bjarmason, Sep 7, 2021
  109. Taylor BlauSep 16, 2021
  110. Taylor BlauSep 16, 2021
  111. Ævar Arnfjörð BjarmasonSep 16, 2021
  112. 04/22 cat-file tests: test that --allow-unknown-type isn't on by defaultÆvar Arnfjörð Bjarmason, Sep 7, 2021
  113. 05/22 rev-list tests: test for behavior with invalid object typesÆvar Arnfjörð Bjarmason, Sep 7, 2021
  114. Taylor BlauSep 16, 2021
  115. Ævar Arnfjörð BjarmasonSep 17, 2021
  116. 06/22 cat-file tests: add corrupt loose object testÆvar Arnfjörð Bjarmason, Sep 7, 2021
  117. 07/22 cat-file tests: test for current --allow-unknown-type behaviorÆvar Arnfjörð Bjarmason, Sep 7, 2021
  118. 08/22 object-file.c: don't set "typep" when returning non-zeroÆvar Arnfjörð Bjarmason, Sep 7, 2021
  119. Taylor BlauSep 16, 2021
  120. Jeff KingSep 16, 2021
  121. 09/22 cache.h: move object functions to object-store.hÆvar Arnfjörð Bjarmason, Sep 7, 2021
  122. Taylor BlauSep 16, 2021
  123. 10/22 object-file.c: make parse_loose_header_extended() publicÆvar Arnfjörð Bjarmason, Sep 7, 2021
  124. Taylor BlauSep 16, 2021
  125. 11/22 object-file.c: add missing braces to loose_object_info()Ævar Arnfjörð Bjarmason, Sep 7, 2021
  126. 12/22 object-file.c: simplify unpack_loose_short_header()Ævar Arnfjörð Bjarmason, Sep 7, 2021
  127. 14/22 object-file.c: stop dying in parse_loose_header()Ævar Arnfjörð Bjarmason, Sep 7, 2021
  128. Taylor BlauSep 17, 2021
  129. 13/22 object-file.c: split up ternary in parse_loose_header()Ævar Arnfjörð Bjarmason, Sep 7, 2021
  130. Taylor BlauSep 16, 2021
  131. 16/22 object-file.c: return -1, not "status" from unpack_loose_header()Ævar Arnfjörð Bjarmason, Sep 7, 2021
  132. 17/22 object-file.c: return -2 on "header too long" in unpack_loose_header()Ævar Arnfjörð Bjarmason, Sep 7, 2021
  133. 15/22 object-file.c: guard against future bugs in loose_object_info()Ævar Arnfjörð Bjarmason, Sep 7, 2021
  134. Taylor BlauSep 17, 2021
  135. 18/22 object-file.c: use "enum" return type for unpack_loose_header()Ævar Arnfjörð Bjarmason, Sep 7, 2021
  136. Taylor BlauSep 17, 2021
  137. 19/22 fsck: don't hard die on invalid object typesÆvar Arnfjörð Bjarmason, Sep 7, 2021
  138. Taylor BlauSep 17, 2021
  139. 20/22 object-store.h: move read_loose_object() below 'struct object_info'Ævar Arnfjörð Bjarmason, Sep 7, 2021
  140. 21/22 fsck: report invalid types recorded in objectsÆvar Arnfjörð Bjarmason, Sep 7, 2021
  141. Taylor BlauSep 17, 2021
  142. 22/22 fsck: report invalid object type-path combinationsÆvar Arnfjörð Bjarmason, Sep 7, 2021
  143. Taylor BlauSep 17, 2021
  144. Taylor BlauSep 17, 2021
  145. 00/17 fsck: lib-ify object-file.c & better fsck "invalid object" error reportingÆvar Arnfjörð Bjarmason, Sep 20, 2021
  146. 01/17 fsck tests: add test for fsck-ing an unknown typeÆvar Arnfjörð Bjarmason, Sep 20, 2021
  147. 02/17 fsck tests: refactor one test to use a sub-repoÆvar Arnfjörð Bjarmason, Sep 20, 2021
  148. 03/17 fsck tests: test current hash/type mismatch behaviorÆvar Arnfjörð Bjarmason, Sep 20, 2021
  149. 07/17 cat-file tests: add corrupt loose object testÆvar Arnfjörð Bjarmason, Sep 20, 2021
  150. 06/17 cat-file tests: test for missing/bogus object with -t, -s and -pÆvar Arnfjörð Bjarmason, Sep 20, 2021
  151. Taylor BlauSep 21, 2021
  152. 05/17 cat-file tests: move bogus_* variable declarations earlierÆvar Arnfjörð Bjarmason, Sep 20, 2021
  153. 04/17 fsck tests: test for garbage appended to a loose objectÆvar Arnfjörð Bjarmason, Sep 20, 2021
  154. 09/17 object-file.c: don't set "typep" when returning non-zeroÆvar Arnfjörð Bjarmason, Sep 20, 2021
  155. 08/17 cat-file tests: test for current --allow-unknown-type behaviorÆvar Arnfjörð Bjarmason, Sep 20, 2021
  156. 10/17 object-file.c: return -1, not "status" from unpack_loose_header()Ævar Arnfjörð Bjarmason, Sep 20, 2021
  157. 11/17 object-file.c: make parse_loose_header_extended() publicÆvar Arnfjörð Bjarmason, Sep 20, 2021
  158. 14/17 object-file.c: return ULHR_TOO_LONG on "header too long"Ævar Arnfjörð Bjarmason, Sep 20, 2021
  159. 12/17 object-file.c: simplify unpack_loose_short_header()Ævar Arnfjörð Bjarmason, Sep 20, 2021
  160. 15/17 object-file.c: stop dying in parse_loose_header()Ævar Arnfjörð Bjarmason, Sep 20, 2021
  161. 13/17 object-file.c: use "enum" return type for unpack_loose_header()Ævar Arnfjörð Bjarmason, Sep 20, 2021
  162. 16/17 fsck: don't hard die on invalid object typesÆvar Arnfjörð Bjarmason, Sep 20, 2021
  163. 17/17 fsck: report invalid object type-path combinationsÆvar Arnfjörð Bjarmason, Sep 20, 2021
  164. 00/17 fsck: lib-ify object-file.c & better fsck "invalid object" error reportingÆvar Arnfjörð Bjarmason, Sep 28, 2021
  165. 01/17 fsck tests: add test for fsck-ing an unknown typeÆvar Arnfjörð Bjarmason, Sep 28, 2021
  166. 02/17 fsck tests: refactor one test to use a sub-repoÆvar Arnfjörð Bjarmason, Sep 28, 2021
  167. 03/17 fsck tests: test current hash/type mismatch behaviorÆvar Arnfjörð Bjarmason, Sep 28, 2021
  168. 04/17 fsck tests: test for garbage appended to a loose objectÆvar Arnfjörð Bjarmason, Sep 28, 2021
  169. 05/17 cat-file tests: move bogus_* variable declarations earlierÆvar Arnfjörð Bjarmason, Sep 28, 2021
  170. 06/17 cat-file tests: test for missing/bogus object with -t, -s and -pÆvar Arnfjörð Bjarmason, Sep 28, 2021
  171. 07/17 cat-file tests: add corrupt loose object testÆvar Arnfjörð Bjarmason, Sep 28, 2021
  172. 08/17 cat-file tests: test for current --allow-unknown-type behaviorÆvar Arnfjörð Bjarmason, Sep 28, 2021
  173. 09/17 object-file.c: don't set "typep" when returning non-zeroÆvar Arnfjörð Bjarmason, Sep 28, 2021
  174. 11/17 object-file.c: make parse_loose_header_extended() publicÆvar Arnfjörð Bjarmason, Sep 28, 2021
  175. 10/17 object-file.c: return -1, not "status" from unpack_loose_header()Ævar Arnfjörð Bjarmason, Sep 28, 2021
  176. 12/17 object-file.c: simplify unpack_loose_short_header()Ævar Arnfjörð Bjarmason, Sep 28, 2021
  177. 14/17 object-file.c: return ULHR_TOO_LONG on "header too long"Ævar Arnfjörð Bjarmason, Sep 28, 2021
  178. 13/17 object-file.c: use "enum" return type for unpack_loose_header()Ævar Arnfjörð Bjarmason, Sep 28, 2021
  179. 15/17 object-file.c: stop dying in parse_loose_header()Ævar Arnfjörð Bjarmason, Sep 28, 2021
  180. 16/17 fsck: don't hard die on invalid object typesÆvar Arnfjörð Bjarmason, Sep 28, 2021
  181. 17/17 fsck: report invalid object type-path combinationsÆvar Arnfjörð Bjarmason, Sep 28, 2021
  182. Taylor BlauSep 29, 2021
  183. 00/17 fsck: lib-ify object-file.c & better fsck "invalid object" error reportingÆvar Arnfjörð Bjarmason, Sep 30, 2021
  184. 01/17 fsck tests: add test for fsck-ing an unknown typeÆvar Arnfjörð Bjarmason, Sep 30, 2021
  185. Andrei RybakSep 30, 2021
  186. Ævar Arnfjörð BjarmasonOct 1, 2021
  187. 03/17 fsck tests: test current hash/type mismatch behaviorÆvar Arnfjörð Bjarmason, Sep 30, 2021
  188. 02/17 fsck tests: refactor one test to use a sub-repoÆvar Arnfjörð Bjarmason, Sep 30, 2021
  189. 04/17 fsck tests: test for garbage appended to a loose objectÆvar Arnfjörð Bjarmason, Sep 30, 2021
  190. 05/17 cat-file tests: move bogus_* variable declarations earlierÆvar Arnfjörð Bjarmason, Sep 30, 2021
  191. 06/17 cat-file tests: test for missing/bogus object with -t, -s and -pÆvar Arnfjörð Bjarmason, Sep 30, 2021
  192. 07/17 cat-file tests: add corrupt loose object testÆvar Arnfjörð Bjarmason, Sep 30, 2021
  193. 08/17 cat-file tests: test for current --allow-unknown-type behaviorÆvar Arnfjörð Bjarmason, Sep 30, 2021
  194. 09/17 object-file.c: don't set "typep" when returning non-zeroÆvar Arnfjörð Bjarmason, Sep 30, 2021
  195. 10/17 object-file.c: return -1, not "status" from unpack_loose_header()Ævar Arnfjörð Bjarmason, Sep 30, 2021
  196. 12/17 object-file.c: simplify unpack_loose_short_header()Ævar Arnfjörð Bjarmason, Sep 30, 2021
  197. 11/17 object-file.c: make parse_loose_header_extended() publicÆvar Arnfjörð Bjarmason, Sep 30, 2021
  198. 13/17 object-file.c: use "enum" return type for unpack_loose_header()Ævar Arnfjörð Bjarmason, Sep 30, 2021
  199. 14/17 object-file.c: return ULHR_TOO_LONG on "header too long"Ævar Arnfjörð Bjarmason, Sep 30, 2021
  200. 15/17 object-file.c: stop dying in parse_loose_header()Ævar Arnfjörð Bjarmason, Sep 30, 2021
  201. 16/17 fsck: don't hard die on invalid object typesÆvar Arnfjörð Bjarmason, Sep 30, 2021
  202. 17/17 fsck: report invalid object type-path combinationsÆvar Arnfjörð Bjarmason, Sep 30, 2021
  203. Junio C HamanoSep 30, 2021
  204. Taylor BlauSep 30, 2021
  205. 00/17 fsck: lib-ify object-file.c & better fsck "invalid object" error reportingÆvar Arnfjörð Bjarmason, Oct 1, 2021
  206. 01/17 fsck tests: add test for fsck-ing an unknown typeÆvar Arnfjörð Bjarmason, Oct 1, 2021
  207. 02/17 fsck tests: refactor one test to use a sub-repoÆvar Arnfjörð Bjarmason, Oct 1, 2021
  208. 03/17 fsck tests: test current hash/type mismatch behaviorÆvar Arnfjörð Bjarmason, Oct 1, 2021
  209. 05/17 cat-file tests: move bogus_* variable declarations earlierÆvar Arnfjörð Bjarmason, Oct 1, 2021
  210. 06/17 cat-file tests: test for missing/bogus object with -t, -s and -pÆvar Arnfjörð Bjarmason, Oct 1, 2021
  211. 04/17 fsck tests: test for garbage appended to a loose objectÆvar Arnfjörð Bjarmason, Oct 1, 2021
  212. 07/17 cat-file tests: add corrupt loose object testÆvar Arnfjörð Bjarmason, Oct 1, 2021
  213. 08/17 cat-file tests: test for current --allow-unknown-type behaviorÆvar Arnfjörð Bjarmason, Oct 1, 2021
  214. 09/17 object-file.c: don't set "typep" when returning non-zeroÆvar Arnfjörð Bjarmason, Oct 1, 2021
  215. 10/17 object-file.c: return -1, not "status" from unpack_loose_header()Ævar Arnfjörð Bjarmason, Oct 1, 2021
  216. 11/17 object-file.c: make parse_loose_header_extended() publicÆvar Arnfjörð Bjarmason, Oct 1, 2021
  217. 12/17 object-file.c: simplify unpack_loose_short_header()Ævar Arnfjörð Bjarmason, Oct 1, 2021
  218. 13/17 object-file.c: use "enum" return type for unpack_loose_header()Ævar Arnfjörð Bjarmason, Oct 1, 2021
  219. 14/17 object-file.c: return ULHR_TOO_LONG on "header too long"Ævar Arnfjörð Bjarmason, Oct 1, 2021
  220. 15/17 object-file.c: stop dying in parse_loose_header()Ævar Arnfjörð Bjarmason, Oct 1, 2021
  221. 16/17 fsck: don't hard die on invalid object typesÆvar Arnfjörð Bjarmason, Oct 1, 2021
  222. 17/17 fsck: report invalid object type-path combinationsÆvar Arnfjörð Bjarmason, Oct 1, 2021
  223. Junio C HamanoOct 1, 2021
  224. Ævar Arnfjörð BjarmasonOct 1, 2021
  225. Han XinNov 11, 2021
  226. Junio C HamanoNov 11, 2021
  227. Han XinNov 11, 2021
  228. 0/2 v2.34.0-rc2 regression: free() of uninitialized in ab/fsck-unexpected-typeÆvar Arnfjörð Bjarmason, Nov 11, 2021
  229. 1/2 object-file: fix SEGV on free() regression in v2.34.0-rc2Ævar Arnfjörð Bjarmason, Nov 11, 2021
  230. Jeff KingNov 11, 2021
  231. Junio C HamanoNov 11, 2021
  232. Ævar Arnfjörð BjarmasonNov 13, 2021
  233. 2/2 object-file: free(*contents) only in read_loose_object() callerÆvar Arnfjörð Bjarmason, Nov 11, 2021
  234. Junio C HamanoNov 11, 2021
  235. Junio C HamanoMar 28, 2021
  236. Jeff KingMar 28, 2021
  237. Ævar Arnfjörð BjarmasonMar 29, 2021
  238. Jeff KingMar 31, 2021
  239. 0/3 trace2 docs: note that BUG() sends an "error" eventÆvar Arnfjörð Bjarmason, Apr 13, 2021
  240. 3/3 api docs: document that BUG() emits a trace2 error eventÆvar Arnfjörð Bjarmason, Apr 13, 2021
  241. 1/3 usage.c: don't copy/paste the same comment three timesÆvar Arnfjörð Bjarmason, Apr 13, 2021
  242. Jeff KingApr 15, 2021
  243. 2/3 api docs: document BUG() in api-error-handling.txtÆvar Arnfjörð Bjarmason, Apr 13, 2021
  244. Jeff KingApr 15, 2021
  245. Jeff KingApr 15, 2021

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.