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

My git repo is broken, how to fix it ?

From
ALAlexander Litvinov <litvinov2004@gmail.com>
Date
Feb 28, 2007, 04:36 UTC
Message-ID
<200702281036.30539.litvinov2004@gmail.com>
Hello,

I use manualy compiled git under cygwin. Some time ago I have imported project from CVS and start to us it under git. To emulate 'separate remotes' schema for branches from CVS I clone imported git repo and work with it. From time to time I incrementaly update imported repo from cvs and sometimes use git-cvsexportcommit (from work repo) to export my changes and then get them using git-cvsimport.

Some times ago I descide to run fsck and found that by working repo is broken, while imported repo is correct. Is there way to fix it ?

>git version

git version 1.5.0.GIT (It was actualy compiled from e86d552 commit)

> git fsck
> git fsck --full

error: packed 7f5fed8131fb32972c602dede29b9257a053ba67 from .git/objects/pack/pack-c4554978bbe079c9a43d6a13546a2fa314fe0884.pack is corrupt sha1 mismatch 7f5fed8131fb32972c602dede29b9257a053ba67

(This is a blob, git cat-file blob 7f5fed813 shows me my c++ header file that is partialy broken with ^@ symbols)

The repo I get using git-cvsimport is correct and does not contains that blob. I also tried git-log -p for all by branches to force git to show me what is the commit was broken but git-log finished without errors.

By the way, several times I interrupt git's commands like commit and pull using Ctrl-C.

I tried to unpack all objects:
> git-unpack-objects -r 
< .git/objects/pack/pack-c4554978bbe079c9a43d6a13546a2fa314fe0884.pack; echo 
$?
Unpacking 12868 objects
 100% (12868/12868) done
0
No erorts here. But fsck find that broken blob:
> git fsck 
dangling blob beb992198d4d8813ea51fd1cbbf38313ef490c22
git-cat-file shows me this this is a broken object with correct sha1 sum.

As a cunclusion: my repo has broken file and I don't see there is the brakage. Can I reconstruct file by sha1 sum :-) or can I do something to stop fsck warn me ?

Next: Linus Torvalds
Message 1 of 28 in “My git repo is broken, how to fix it ?”
  1. Alexander LitvinovFeb 28, 2007
  2. Linus TorvaldsFeb 28, 2007
  3. Alexander LitvinovFeb 28, 2007
  4. Linus TorvaldsFeb 28, 2007
  5. Alex RiesenFeb 28, 2007
  6. Alexander LitvinovMar 19, 2007
  7. Linus TorvaldsMar 19, 2007
  8. Linus TorvaldsMar 20, 2007
  9. Alexander LitvinovMar 20, 2007
  10. Junio C HamanoMar 20, 2007
  11. Nicolas PitreMar 20, 2007
  12. Linus TorvaldsMar 22, 2007
  13. Nicolas PitreMar 22, 2007
  14. Linus TorvaldsMar 22, 2007
  15. Linus TorvaldsMar 22, 2007
  16. Linus TorvaldsMar 22, 2007
  17. Nicolas PitreMar 22, 2007
  18. Linus TorvaldsMar 22, 2007
  19. Nicolas PitreMar 22, 2007
  20. Jeff KingMar 22, 2007
  21. Linus TorvaldsMar 23, 2007
  22. Bill LearMar 23, 2007
  23. Jeff KingMar 23, 2007
  24. git-apply: Do not free the wrong buffer when we convert the data for writeoutJunio C Hamano, Mar 22, 2007
  25. Linus TorvaldsMar 22, 2007
  26. Alexander LitvinovMar 23, 2007
  27. Alexander LitvinovMar 23, 2007
  28. Johannes SixtMar 22, 2007

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.