git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Woodhouse <dwmw2@infradead.org>
To: Linus Torvalds <torvalds@osdl.org>
Cc: Junio C Hamano <junkio@cox.net>, git@vger.kernel.org
Subject: Re: Kernel headers git tree
Date: Fri, 14 Jul 2006 11:23:46 +0100	[thread overview]
Message-ID: <1152872626.3191.56.camel@pmac.infradead.org> (raw)
In-Reply-To: <Pine.LNX.4.64.0607132157370.5623@g5.osdl.org>

On Thu, 2006-07-13 at 22:16 -0700, Linus Torvalds wrote:
> So to give an example, let's say we have
> 
>         HEAD  ->     A
>                     / \
>                    B   C
>                   / \   \
>                  D   E   F
>                   \ /   / \
>                    G   H  I
>                   .......
> 
> the difference between --topo-order and the default ordering for
> 
>         git rev-list HEAD
> 
> is most visible for commit 'G'.
> 
> For --topo-order, we guarantee that before we show 'G', we _will_ have 
> shown both 'D' and 'E'. In other words, --topo-ordering guarantees that it 
> shows _all_ children before it shows the parent.

Ah, OK. Then it should probably be fine. I'll talk myself through it...

We're building a parallel graph of commits, containing a _subset_ of the
commits in the master tree -- only those which touch certain files. 

For each 'interesting' commit X, we create a corresponding commit X' in
the slave tree -- we create the corresponding tree object, and we also
recursively create its parent commits -- replacing each parent in the
original commit X with the slave-tree equivalent of the closest
_interesting_ ancestor commit. It's that "closest interesting ancestor"
which we're finding with the 'rev-list --max-count-1 -- myfile'
invocation. 

The extract-khdrs-stage2.sh script is a simple example of this, and
differs from the other script mostly in the way that it creates the
_tree_ objects.

So working from your example above, and assuming that only commits I and
E actually change the files we care about. This means that merges A, B
and F are _also_ going to show up in the output of 'rev-list -- myfile'.

So the slave tree will look like this:

        A'
       / \
      B'  F'
      |   |
      E'  I'

The interesting case, if I'm trying to convince myself that my 'slave'
tree is always going to have the correct topology, is when a merge
commit is _missing_ from the rev-list output -- for example, if commits
D and E in your original tree both make the _same_ change, then I
believe that the merge commit B will no longer show up, because 'myfile'
is identical in B and in both of its parents.

In that case, we accept that the representation isn't going to be
perfect -- the left-hand parent of A' is going to appear to be _either_
D' or E', but not B'. In fact, since D' and E' are _identical_ as far as
we're concerned, it doesn't really matter which is chosen. The other one
of the two becomes an unused branch with no children -- we end up with a
graph looking like this. 

      A'
     / \
D'  E'  F'
  \/    |
        I'

... and the parent of D' and E' is the closest ancestor of G which
actually touches the files we care about, of course.

All we care about, in this case, is that the first commit listed by
rev-list is _either_ D or E, and not something further down the tree.
And that's obviously true from your description of the 'weak ordering',
so yes -- it does look like I can drop the '--topo-order'. Thanks.

(It would actually be quite nice if I _could_ find a cheap way to
include commit B' in that final example, but it's such a rare case and
it would be so expensive to do it that I don't think it's worth
pursuing.)

-- 
dwmw2

  reply	other threads:[~2006-07-14 10:24 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-13 23:59 Kernel headers git tree David Woodhouse
2006-07-14  0:39 ` Junio C Hamano
2006-07-14  0:56   ` David Woodhouse
2006-07-14  1:08     ` Linus Torvalds
2006-07-14  2:37     ` Junio C Hamano
2006-07-14  1:05   ` Linus Torvalds
2006-07-14  1:27     ` David Woodhouse
2006-07-14  5:16       ` Linus Torvalds
2006-07-14 10:23         ` David Woodhouse [this message]
2006-07-14 15:57           ` Linus Torvalds
2006-07-14 17:51             ` Daniel Barkalow
2006-07-14 17:58               ` David Woodhouse
2006-07-14 18:21                 ` Daniel Barkalow
2006-07-14  5:52       ` Linus Torvalds
2006-07-14  9:38         ` David Woodhouse
2006-07-14 15:39           ` Linus Torvalds
2006-07-17 22:34             ` [PATCH] Trivial path optimization test Alex Riesen
2006-07-24  6:41               ` Junio C Hamano
2006-07-24 23:23                 ` Alex Riesen
2006-07-24 23:23             ` Alex Riesen
2006-07-14 18:01           ` Kernel headers git tree Junio C Hamano
2006-07-14 18:21             ` David Woodhouse
2006-07-14  7:20 ` Ian Campbell
2006-07-14  7:52   ` Junio C Hamano
2006-07-14 18:05 ` Ingo Oeser
2006-07-14 18:16   ` David Woodhouse
2006-07-18 21:15     ` Ingo Oeser

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=1152872626.3191.56.camel@pmac.infradead.org \
    --to=dwmw2@infradead.org \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.net \
    --cc=torvalds@osdl.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).