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

Re: How to replace a single corrupt, packed object?

From
Nicolas Pitre <nico@cam.org>
Date
Sep 15, 2008, 16:26 UTC
Message-ID
<alpine.LFD.1.10.0809151223570.6279@xanadu.home>
In-Reply-To
<alpine.DEB.1.00.0809151603390.13830@pacific.mpi-cbg.de.mpi-cbg.de>
On Mon, 15 Sep 2008, Johannes Schindelin wrote:
Show 35 quoted lines
> On Sun, 10 Aug 2008, Nicolas Pitre wrote:
> 
> > On Fri, 8 Aug 2008, Johannes Schindelin wrote:
> > 
> > > my auto gc kicked in, and shows this:
> > > 
> > > fatal: corrupt packed object for 2c1e128aa51e3a64bd61556c0cd488628b423ccf
> > > error: failed to run repack
> > > 
> > > Fortunately, I have the uncorrupted object somewhere else.  So I copy the 
> > > single object as a loose one, and all is fine.  Right?
> > > 
> > > Wrong.
> > 
> > Well, to be sure things are then right or wrong, just do a 
> > 
> > 	git show 2c1e128aa51e3a64bd61556c0cd488628b423ccf
> > 
> > If you can't see the object before, and are able to see it once it has 
> > been copied over, then things are "right".
> > 
> > > Repack still picks up the corrupt object instead of the good one.  
> > > What's the best way out?
> > 
> > How do you repack?  The only way to get rid of a corrupted object in 
> > that case is to 'git repack -a -f'.
> 
> Turns out I am a complete, utter moron.  And I am sure René will quote me 
> on that.
> 
> Git would probably have taken the copied-over object, and now took the 
> copied-over pack (finally!).
> 
> My mistake was to keep the .keep file.  And the corrupt object was -- you 
> guessed it -- in the corresponding .pack file.

OK. Then I'll dig my patch out and write a test for it before submitting it to Junio.

Nicolas
Previous: Johannes SchindelinNext: Johannes Schindelin
Message 10 of 18 in “How to replace a single corrupt, packed object?”
  1. Johannes SchindelinAug 8, 2008
  2. Shawn O. PearceAug 8, 2008
  3. Johannes SchindelinAug 8, 2008
  4. Johannes SchindelinAug 8, 2008
  5. Shawn O. PearceAug 8, 2008
  6. Pieter de BieAug 8, 2008
  7. Shawn O. PearceAug 8, 2008
  8. Nicolas PitreAug 11, 2008
  9. Johannes SchindelinSep 15, 2008
  10. Nicolas PitreSep 15, 2008
  11. Johannes SchindelinSep 15, 2008
  12. Shawn O. PearceAug 8, 2008
  13. Johannes SchindelinAug 8, 2008
  14. Nicolas PitreAug 11, 2008
  15. Shawn O. PearceAug 11, 2008
  16. Nicolas PitreAug 11, 2008
  17. Shawn O. PearceAug 11, 2008
  18. Johannes SchindelinAug 11, 2008

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.