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, 21:06 UTC
Message-ID
<xmqq4mn7m00c.fsf@gitster.dls.corp.google.com>
In-Reply-To
<CAGZ79kY7wg1JjshwZOtWhm_0qP=CBQqvhqayZpvhu35WuMhxWQ@mail.gmail.com>
Stefan Beller <sbeller@google.com> writes:
Show 10 quoted lines
> On Wed, May 20, 2015 at 1:39 PM, Junio C Hamano <gitster@pobox.com> wrote:
>>
>> So...
>
> maybe we need a command:
>
> Given this SHA1, tell me anything you know about it,
> Is it a {blob,tree,commit,tag}?
> Is it referenced from anywhere else in this repository and if so, which type?
> And if it is not referenced, nor an object, tell me so explicitely.
Let me add another to that list ;-)
  I have this prefix; please enumerate all known objects that share it.

I do not know the value of the first two in your list. If it is a known object, then you throw it at "git show", "git cat-file -t" and dig from there. If it is not known, there is nothing more to do.

I do not know if "need" is the right word, but I hope that you realize the last two among the four you listed need the equivalent of "git fsck". It is an expensive operation.

Previous: Stefan BellerNext: Stefan Beller
Message 10 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.