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

Re: corrupt object on git-gc

From
Andreas Ericsson <ae@op5.se>
Date
Nov 9, 2007, 13:46 UTC
Message-ID
<473464A2.7080003@op5.se>
In-Reply-To
<4fe79b4b0711090538wf483ce7j89c518962e89780e@mail.gmail.com>
Yossi Leybovich wrote:
Show 16 quoted lines
> Yossi Leybovich wrote:
>>> Hi
>>>
>>>  I know its loose but still I think there are references in the
>>> repository to this object.
>>> How I can remove it from the repository ?
>>>
> 
>> That was not a very good idea. You just moved ALL objects whose hash
>> begin with 4b out of the object database.
> 
>> Try only moving the offending file out of the 4b directory.
> 
> Did not help still the repository look for this object?
> Any one know how can I track this object and understand which file is it
> 

Is this a super-secret project or you can make a tarball of the .git directory and send it to me? Trying to track down the cause through email is decidedly slow.

Show 12 quoted lines
> 
> 
> ib]$ mv .git/objects/4b/9458b3786228369c63936db65827de3cc06200 ../
> 
> ib]$ git-fsck --full
> dangling commit 0d43a63623237385e432572bf61171713dcd8e98
> dangling commit 4fc6b1127e4a7f4ff5b65a2dd8a90779b5aff3e0
> dangling commit 7da607374fe2b1ae09228d2035dd608c73dad7c8
> dangling commit 004ef09ae022c60a30f9cd61f90d18df5db3628e
> dangling commit 85112c6fabb6b8913ab244a8645d67380616eba6
> broken link from    tree 2d9263c6d23595e7cb2a21e5ebbb53655278dff8
>              to    blob 4b9458b3786228369c63936db65827de3cc06200

One tree uses the object. I'm not sure if any commit-objects use the tree. Try

for b in $(git branch --no-color -a | cut -b3-); do
for rev in $(git rev-list HEAD); do
	git ls-tree -r $rev | grep -q 2d9263c6d23595e7cb2a21e5ebbb53655278dff8
	test $? -eq 0 && echo $rev && break
done
done

If it turns up empty, you *should* be able to safely delete 2d9263c6d23595e7cb2a21e5ebbb53655278dff8 and 4b9458b3786228369c63936db65827de3cc06200

Make sure to take a backup first though.
-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231
Previous: Yossi LeybovichNext: Yossi Leybovich
Message 2 of 20 in “Re: corrupt object on git-gc”
  1. Yossi LeybovichNov 9, 2007
  2. Andreas EricssonNov 9, 2007
  3. Yossi LeybovichNov 9, 2007
  4. Johannes SixtNov 9, 2007
  5. Yossi LeybovichNov 9, 2007
  6. Johannes SixtNov 9, 2007
  7. Nicolas PitreNov 9, 2007
  8. Yossi LeybovichNov 9, 2007
  9. Nicolas PitreNov 9, 2007
  10. Linus TorvaldsNov 9, 2007
  11. add a howto document about corrupted blob recoveryNicolas Pitre, Nov 9, 2007
  12. Johannes SchindelinNov 9, 2007
  13. J. Bruce FieldsNov 26, 2007
  14. Yossi LeybovichNov 9, 2007
  15. Linus TorvaldsNov 9, 2007
  16. Yossi LeybovichNov 9, 2007
  17. Linus TorvaldsNov 9, 2007
  18. Mike HommeyNov 9, 2007
  19. Yossi LeybovichNov 9, 2007
  20. Mike HommeyNov 9, 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.