Re: Git's database structure

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Jon Smirl <jonsmirl@...>
Cc: Git Mailing List <git@...>
Date: Tuesday, September 4, 2007 - 11:55 am

Jon Smirl wrote:


commit - SHA1 of its parent(s) and its root-tree, along with
         author info and a free-form field
blob - content addressable by *multiple trees*
file names - List of path-names inside a tree object.


To draw some sort of relationship model here, you'd have

commit 1<->M roottree
tree M<->M tree
tree M<->M blob

Assuming SHA1 never collides (collisions rule out any form of storage,
so we might as well hope it never happens), that leaves us with this:

Each root tree can only ever belong to a single commit, unless you
intentionally force git to make completely empty commits. git
won't complain about this, so long as you don't make two in the
same second, because it relies more heavily on the DAG than on
developer sanity.

Each root tree can point to multiple sub-trees. The sub-trees can be
linked to any number of root-trees. 

Blobs can be linked to any number of tree objects, or even multiple
times to the same tree object. This wouldn't be possible if the
blob objects had their own pathnames stored inside them, so to speak.


File names are not independant variables. They belong inside the
table created for them, which is the tree objects.


Do you realize that you're contradicting yourself in two upon each
other following sentences here?

Detecting renames after the fashion works fine. Not storing them
is part of the "detect them by comparing diffs".


Except that

git init
echo foo > a
cp -a a b
git add .
git commit -m testing
git count-objects

yields 3 objects at the moment; A commit-object, a tree object and *one*
blob object. With your scheme the 2 blob objects would differ, and there
would be 4 of them. If you propose to ignore the path-name you have
effectively broken support for having two identical files with different
names in the same directory.

Now, can you please tell me what gains you're hoping to see with this
new layout of yours?

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Git's database structure, Jon Smirl, (Tue Sep 4, 11:23 am)
Re: Git's database structure, Julian Phillips, (Tue Sep 4, 1:19 pm)
Re: Git's database structure, Jon Smirl, (Tue Sep 4, 1:30 pm)
Re: Git's database structure, Andreas Ericsson, (Tue Sep 4, 2:51 pm)
Re: Git's database structure, Jon Smirl, (Tue Sep 4, 12:28 pm)
Re: Git's database structure, Junio C Hamano, (Tue Sep 4, 1:25 pm)
Re: Git's database structure, Jon Smirl, (Tue Sep 4, 1:44 pm)
Re: Git's database structure, Theodore Tso, (Tue Sep 4, 5:25 pm)
Re: Git's database structure, Jon Smirl, (Tue Sep 4, 5:54 pm)
Re: Git's database structure, Andreas Ericsson, (Wed Sep 5, 3:18 am)
Re: Git's database structure, Jon Smirl, (Wed Sep 5, 9:41 am)
Re: Git's database structure, Andy Parkins, (Wed Sep 5, 3:52 pm)
Re: Git's database structure, Andreas Ericsson, (Wed Sep 5, 10:51 am)
Re: Git's database structure, Jon Smirl, (Wed Sep 5, 11:37 am)
Re: Git's database structure, Julian Phillips, (Wed Sep 5, 11:54 am)
Re: Git's database structure, Jon Smirl, (Wed Sep 5, 12:12 pm)
Re: Git's database structure, Martin Langhoff, (Thu Sep 6, 8:33 pm)
Re: Git's database structure, Johannes Schindelin, (Thu Sep 6, 8:56 am)
Re: Git's database structure, Steven Grimm, (Thu Sep 6, 2:14 pm)
Re: Git's database structure, Andreas Ericsson, (Thu Sep 6, 4:49 am)
Re: Git's database structure, Junio C Hamano, (Thu Sep 6, 5:09 am)
Re: Git's database structure, Wincent Colaiuta, (Thu Sep 6, 7:03 am)
Re: Git's database structure, Mike Hommey, (Wed Sep 5, 1:39 pm)
Re: Git's database structure, Julian Phillips, (Wed Sep 5, 1:31 pm)
Re: Git's database structure, Kyle Moffett, (Wed Sep 5, 9:27 pm)
Re: Git's database structure, Junio C Hamano, (Tue Sep 4, 2:06 pm)
Re: Git's database structure, Mike Hommey, (Tue Sep 4, 2:04 pm)
Re: Git's database structure, Reece Dunn, (Tue Sep 4, 3:44 pm)
Re: Git's database structure, Andreas Ericsson, (Tue Sep 4, 12:31 pm)
Re: Git's database structure, Jon Smirl, (Tue Sep 4, 12:47 pm)
Re: Git's database structure, Andreas Ericsson, (Tue Sep 4, 12:51 pm)
Re: Git's database structure, Andreas Ericsson, (Tue Sep 4, 11:55 am)
Re: Git's database structure, Junio C Hamano, (Tue Sep 4, 1:21 pm)
Re: Git's database structure, Jon Smirl, (Tue Sep 4, 12:19 pm)
Re: Git's database structure, David Tweed, (Tue Sep 4, 4:17 pm)
Re: Git's database structure, Jeff King, (Tue Sep 4, 1:09 pm)
Re: Git's database structure, Andreas Ericsson, (Tue Sep 4, 12:29 pm)
Re: Git's database structure, Mike Hommey, (Tue Sep 4, 12:07 pm)
Re: Git's database structure, Andreas Ericsson, (Tue Sep 4, 12:10 pm)