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
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Date
May 21, 2015, 08:09 UTC
Message-ID
<vpqd21ujqra.fsf@anie.imag.fr>
In-Reply-To
<alpine.DEB.2.11.1505202256330.9343@orwell.homelinux.org>
Faheem Mitha <faheem@faheem.info> writes:
> I was going by the answer (by CodeWizard) in
> http://stackoverflow.com/q/30348615/350713

OK, so the hash you got comes from a superproject which references it. My guess is that the superproject did a private commit in a submodule, added this submodule to the superproject, and forgot to push the submodule.

If so, it's a user error (that could arguably have been avoided with a better command-line interface, so Git is partly guilty), but not a repository corruption.

> If I just give a random hash to `git show` in that repos, I get
>
>     fatal: ambiguous argument '...': unknown revision or path not in the working tree.
Not "a random hash", but a random abreviated hash. Look:
Changing the last digit:

$ git show 280c12ab49223c64c6f914944287a7d049cf4d23 fatal: bad object 280c12ab49223c64c6f914944287a7d049cf4d23 $ git show 280c12ab49223c64c6f914944287a7d049cf4d24 fatal: bad object 280c12ab49223c64c6f914944287a7d049cf4d24 $ git show 280c12ab49223c64c6f914944287a7d049cf4d25 fatal: bad object 280c12ab49223c64c6f914944287a7d049cf4d25 $ git show 280c12ab49223c64c6f914944287a7d049cf4d26 fatal: bad object 280c12ab49223c64c6f914944287a7d049cf4d26

Removing the last digit:

$ git show 280c12ab49223c64c6f914944287a7d049cf4d2 fatal: ambiguous argument '280c12ab49223c64c6f914944287a7d049cf4d2': unknown revision or path not in the working tree. Use '--' to separate paths from revisions, like this: 'git <command> [<revision>...] -- [<file>...]'

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
Previous: Faheem Mitha
Message 19 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.