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

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

From
Shawn O. Pearce <spearce@spearce.org>
Date
Aug 8, 2008, 16:36 UTC
Message-ID
<20080808163628.GF9152@spearce.org>
In-Reply-To
<90E12BC7-1950-41DF-8BE5-C6B63CE060D9@ai.rug.nl>
Pieter de Bie <pdebie@ai.rug.nl> wrote:
Show 11 quoted lines
> On 8 aug 2008, at 18:19, Shawn O. Pearce wrote:
>
>> The unpack-objects process will
>> fail when it finds this bad object, and everything after that in
>> the pack file will be dropped on the floor and not get unpacked.
>
> Even with the -r switch?
>
>        -r     When unpacking a corrupt packfile, the command dies at the 
> first corruption. This flag tells it to keep going and make
>               the best effort to recover as many objects as possible.

Oh, thanks for reminding me. I had forgotten that Linus added -r when someone else had corruption in a packed object. Yea, if you use -r it may be able to resume and pick up where it left off.

I haven't studied the -r code so I'm not sure how it knows where its safe to restart unpacking from. But if you have a .idx file we probably could make a really good guess based on the offsets it stores. I doubt unpack-objects makes use of the .idx.

-- 
Shawn.
Previous: Johannes SchindelinNext: Johannes Schindelin
Message 12 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.