Subject: Re: Git's database structure

From: Andy Parkins <[email-masked]>
Date: Wed, 5 Sep 2007 20:52:06 +0100

On Wednesday 2007, September 05, Jon Smirl wrote:

> The path name field needs to be moved back into the blobs to support
> alternative indexes. For example I want an index on the Signed-off-by
> field. I use this index to give me the SHAs for the blobs
> Signed-off-by a particular person. In the current design I have no way
> of recovering the path name for these blobs other than a brute force
> search following every path looking for the right SHA.

Erm, if that's your only way then you designed your index incorrectly.

 1. Signed-Off-By lines appear in commits, so your index should be an index
    of SOB name against commit hash
 2. Lookup the commit for that commit hash.  As usual this is blindlingly
    git-fastic.
 3. That commit blob contains a tree hash.  Look it up.  As usual this is 
    blindingly git-fastic
 4. Start gathering blobs for that tree.  Fast, fast, fast.
 5. Any subtree objects you come across, goto 4.

This is not a brute force lookup and it's stuff that git is really good at 
anyway.

I'm really not sure I see what problem you're trying to solve.  Whatever 
index you want, you could keep and maintain if you wanted to without 
impacting git's core storage at all.

Andy

-- 
Dr Andy Parkins, M Eng (hons), MIET
[email-masked]