git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jakub Narebski <jnareb@gmail.com>
To: git@vger.kernel.org
Subject: Re: n-heads and patch dependency chains
Date: Tue, 04 Apr 2006 02:51:03 +0200	[thread overview]
Message-ID: <e0sfti$1nb$1@sea.gmane.org> (raw)
In-Reply-To: 4430D352.4010707@vilain.net

Sam Vilain wrote:

> The IRC log:
> 
> 17:45 < mugwump> the other suggestions look quite good.  I don't know
>                  how I got roped into spending a whole day on this :)
> 17:46 < mugwump> oh yeah, I remember now.  somebody asked for a
>                  comparison between darcs and git
> 17:46  * ShadeHawk whistles innocently

Let me describe in my own words results of IRC discussion and posts on Git
Mailing List, both in this thread and in "Multi-headed branches (hydra? :))
for basic patch calculus" one
  http://permalink.gmane.org/gmane.comp.version-control.git/18258
and Sam Vilain work (prototype). It might help with understanding Sam's
work; and I hope Sam would correct me if I'm wrong.

It started I think as a way to describe (represent, save) in core GIT the
partial ordering of patches (commits) by dependence Darcs uses in it's
patch algebra theory {i.e. patch1 <- patch2 if patch2 depends on patch1
(patches does not commute)} at *commit time*.

> Say you've got a sequence of changes like this:
> 
> 1. add foo.c
> 2. add bar.c
> 3. modify foo.c
> 4. modify bar.c
> 
> The darcs-like operation of this would be to have two sequences of
> ordered patches that combine to a final result.  ie:
> 
>   1 <- 3
>   2 <- 4
> 
> Unless you jump through hoops, git will represent it as:
> 
>   1 <- 2 <- 3 <- 4.
[the direction of arrows has changed in this quote]

First part of the idea is to represent the partial ordering of patches by
their interdependence (the sequences, chains of ordered patches) using
"parent" relation. (There was also idea of adding another field(s)
"depends-on" to represent only commit dependency in addition to "parent(s)"
relations defining history.)

Second part of the idea is to avoid creating, then recreating the final
something (commit) which combines commit chains to a final result
>
>   1 -> 3  \
>            >- head
>   2 -> 4  /
> 
> Where "head" is a merge commit that just combines the trees of 3 and 4.
> 
So an idea of "hydra", or "n-head" was born, which is just virtual trivial
merge commit which gives us final result, HEAD of chains. (It is trivial
because trees 3 and 4 are independent, merge without conflicts.) And also
related idea of "hydra commit", which automatically adds commit to correct
chain (places commit in correct place of partial ordering by dependence)
and advances n-head (virtual trival merge commit which is HEAD).

The side effects (perhaps more important than making use of Darcs patch
algebra theory, and Darcs merge algorithm) is that we have automatical
topic branches, or to be more exact automatical dependency (sub)branches
(commit/patch dependency chains).

Does it make sense?


To be continued...

In next installment we will see how "hydra commits" or "n-heads" might work:
simplifications in defining commit dependency, "coarse" ordering i.e. no
branching dependency chains, updating n-head during commit and during
merge. Sam Vilain wrote some scripts for "proving of concept"; I would
present my idea on that matter, untested.

-- 
Jakub Narębski
ShadeHawk on #git
Poland

  parent reply	other threads:[~2006-04-04  0:51 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-03  7:48 n-heads and patch dependency chains Sam Vilain
2006-04-03 14:29 ` Linus Torvalds
2006-04-03 15:38   ` Sam Vilain
2006-04-03 19:37 ` Junio C Hamano
2006-04-03 23:55   ` Sam Vilain
2006-04-04  9:28     ` Andreas Ericsson
2006-04-04  9:51       ` Junio C Hamano
2006-04-04 10:44         ` Andreas Ericsson
2006-04-04 11:03       ` Jakub Narebski
2006-04-04 11:47         ` Andreas Ericsson
2006-04-20 18:08           ` Jon Loeliger
2006-04-20 18:55             ` Junio C Hamano
2006-04-21  8:50               ` Andreas Ericsson
2006-04-04 19:00     ` Junio C Hamano
2006-04-04 20:18       ` Jakub Narebski
2006-04-05  6:34       ` Sam Vilain
2006-04-05  7:11         ` Jakub Narebski
2006-04-05  7:31           ` Sam Vilain
2006-04-05  7:59             ` Jakub Narebski
2006-04-04  0:51 ` Jakub Narebski [this message]
2006-04-04 11:05 ` Catalin Marinas
  -- strict thread matches above, loose matches on Subject: below --
2006-04-03 22:13 linux

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to='e0sfti$1nb$1@sea.gmane.org' \
    --to=jnareb@gmail.com \
    --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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).