git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: sf <sf@b-i-t.de>
To: git@vger.kernel.org
Subject: Re: [RFC] Applying a graft to a tree and "rippling" the changes through
Date: Fri, 18 Nov 2005 14:57:05 +0100	[thread overview]
Message-ID: <437DDDB1.60103@b-i-t.de> (raw)
In-Reply-To: <20051117230723.GD26122@nowhere.earth>

Yann Dirson wrote:
...
> Current commit objects refer to a child tree, but to parent _commits_.
> Whereas it seems necessary to walk through the history line, and
> easily get a changelog, it is semantically quite not right: the
> changes we record with a commit indeed come from modification of
> trees, not of commits.  That is, the resulting tree does not depend on
> the history of the parent trees, but on the parent trees themselves.

I would go even further: The resulting tree does not depend on anything. 
A tree is a tree is a tree.

A commit is really just the statement: "I changed the tree from state A 
to state B". After all, the commit message does not describe the new 
state (neither the old state) but does describe the changes.

> And similarly, tags usually denote a particular state of the tree,
> "somewhat" independantly of its history: linux-2.6.11 is the same
> beast, whereas the repository holds full history since 0.1 or not.

Exactly, the tree "linux-2.6.11" is the tree "linux-2.6.11". How it came 
about is totally irrelevant if you are only interested in this 
particular version (does anyone download all linux-*.tar.bz2 just to get 
  linux-2.6.11.tar.bz2?).

> Indeed that emphasizes that the history lines are on living on a
> higher level of abstraction that commits.  Now what if we used
> trees->tree commits, instead of the current commits->tree ones ?  The
> main problem would be to be able to reconstruct those history lines,
> so that we can still extract the log - what's a better model if we
> loose functionnality ? ;)

You can traverse tree -> commit -> tree -> commit -> tree ... to get the 
history. No functionality lost.

> However, I must admit that at this point, I have not found a
> reasonable solution to this problem.
> 
> Any genius with a solution out there ? :)

In your model you have a mapping from commits to sets of trees (by way 
of commit objects). Now you create the "inverse" mapping from trees to 
sets of commits. Both mappings together enable you to walk the history.

Why is git's model different?

1. You have to watch out for circles in history (Git's model ensures 
that history is always a DAG).

2. Your model is harder to implement in the typical case (But deleting 
from repositiories, partial repositories, augmenting or cutting history 
etc. are hard to implement as it is now, if not outright impossible).

3. It is the way repositories have been organized ever since CVS (Git 
throws out some concepts of the CVS model, but not all).


Regards
	Stephan

  parent reply	other threads:[~2005-11-18 14:02 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-17 23:07 [RFC] Applying a graft to a tree and "rippling" the changes through Yann Dirson
2005-11-17 23:28 ` Johannes Schindelin
2005-11-19 14:04   ` Yann Dirson
2005-11-19 14:13     ` Yann Dirson
2005-11-19 15:27       ` Johannes Schindelin
2005-11-19 17:09         ` Yann Dirson
2005-11-19 17:23           ` Matthias Urlichs
2005-11-20  1:24             ` Johannes Schindelin
2005-11-20  7:32               ` Matthias Urlichs
2005-11-20 11:44                 ` Johannes Schindelin
2005-11-20 22:35                   ` Yann Dirson
2005-11-23  3:29                 ` Paul Mackerras
2005-11-23  7:27                   ` Matthias Urlichs
2005-11-23 17:14                     ` Linus Torvalds
2005-11-20 22:32               ` Yann Dirson
2005-11-20 23:46                 ` Johannes Schindelin
2005-11-21  2:24                   ` Matthias Urlichs
2005-11-21  5:18                     ` Ryan Anderson
2005-11-21 22:30                     ` Yann Dirson
2005-11-18 13:57 ` sf [this message]
2005-11-18 17:25   ` Linus Torvalds
2005-11-19  0:49     ` Junio C Hamano
2005-11-19  1:07       ` Linus Torvalds
2005-11-19  1:21         ` Junio C Hamano
2005-11-19  1:29           ` Linus Torvalds
2005-11-19 13:27           ` Yann Dirson
2005-11-19  1:38   ` Yann Dirson
2005-11-18 15:54 ` Josef Weidendorfer
2005-11-19 13:16   ` Yann Dirson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=437DDDB1.60103@b-i-t.de \
    --to=sf@b-i-t.de \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).