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

Re: Debugging corrupt object generation

From
Shawn O. Pearce <spearce@spearce.org>
Date
Nov 2, 2007, 05:15 UTC
Message-ID
<20071102051555.GB14735@spearce.org>
In-Reply-To
<Pine.LNX.4.64.0711020018400.18429@beast.quantumfyre.co.uk>
Julian Phillips <julian@quantumfyre.co.uk> wrote:
Show 10 quoted lines
> On Thu, 1 Nov 2007, Nicolas Pitre wrote:
> >
> >Maybe fast-import hasn't flushed the needed data to the pack yet?
> 
> Well, fast-import completes quite happily and outputs the normal summary 
> status.  I can look at logs and trees etc provided that I don't try and 
> look at one particular part of the tree on one particular commit.  I 
> think the problem is that I've managed to do something inside fast-import 
> that corrupts one particular tree object (though I've no idea what that 
> might be).

Ahhh. I'm betting you messed up the version 0 and version 1 arrays inside of the struct tree_entry. This could cause the delta generator to look at the wrong base information when it creates the delta, thus causing the delta to be created for a different base than what the object is actually using in the packfile.

The version[0] is meant to hold the mode and SHA-1 of the tree_entry in the base object. The version[1] is meant to hold the current mode and SHA-1 of the tree_entry in the new object. A mode of 0 means the entry doesn't exist in that particular tree; so an add is shown as "version[0].mode = 0; version[1].mode = 0100644".

Look at the store_tree function, this is where we regenerate the canonical representation of both the version[0] and the version[1] trees so the store_object function can generate a delta. Note that we assume the base object name is root->versions[0].sha1. Maybe the version[0] array doesn't actually match the tree named by that sha1?

-- 
Shawn.
Previous: Julian Phillips
Message 4 of 4 in “Debugging corrupt object generation”
  1. Julian PhillipsNov 1, 2007
  2. Nicolas PitreNov 1, 2007
  3. Julian PhillipsNov 2, 2007
  4. Shawn O. PearceNov 2, 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.