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

Re: [PUB]corrupt repos does not return error with `git fsck`

From
Junio C Hamano <gitster@pobox.com>
Date
May 20, 2015, 20:39 UTC
Message-ID
<xmqqlhgjm19z.fsf@gitster.dls.corp.google.com>
In-Reply-To
<20150520183115.GB7142@peff.net>
Jeff King <peff@peff.net> writes:
> I should have looked before replying. It would indeed break "cat-file
> -e" horribly. So the right answer may be to just improve the "bad
> object" message (probably by checking has_sha1_file there and diagnosing
> it either as missing or corrupted).
I should have looked before replying, too ;-)

Yeah, "bad object" sounds as if we tried to parse something that exists and it was corrupt. So classifying "a file or a pack index entry exists where a valid object with that name should reside in" as "bad object" and "there is no such file or a pack index entry that would house the named object" as "missing object" _might_ make things better.

But let's think about it a bit more. Would it have prevented the original confusion if we said "missing object"? I have a feeling that it wouldn't have. Faheem was so convinced that the object named with the 40-hex *must* exist in the cloned repository, and if we told "missing object" to such a person, it will just enforce the (mis)conception that the repository is somehow corrupt, when it is not.

So...
Previous: Jeff KingNext: Stefan Beller
Message 8 of 19 in “corrupt repos does not return error with `git fsck`”
  1. Faheem MithaMay 20, 2015
  2. Matthieu MoyMay 20, 2015
  3. Johannes SchindelinMay 20, 2015
  4. Stefan BellerMay 20, 2015
  5. John KeepingMay 20, 2015
  6. Jeff KingMay 20, 2015
  7. Jeff KingMay 20, 2015
  8. Junio C HamanoMay 20, 2015
  9. Stefan BellerMay 20, 2015
  10. Junio C HamanoMay 20, 2015
  11. Stefan BellerMay 20, 2015
  12. Jeff KingMay 20, 2015
  13. Junio C HamanoMay 20, 2015
  14. Faheem MithaMay 20, 2015
  15. Stefan BellerMay 20, 2015
  16. Faheem MithaMay 20, 2015
  17. Matthieu MoyMay 20, 2015
  18. Faheem MithaMay 20, 2015
  19. Matthieu MoyMay 21, 2015

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.