git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johan Herland <johan@herland.net>
To: git@vger.kernel.org
Cc: Gili Pearl <gili.pearl@yahoo.com>, Johannes Sixt <j.sixt@viscovery.net>
Subject: Re: how to work in hirarchical git model?
Date: Thu, 18 Dec 2008 02:00:57 +0100	[thread overview]
Message-ID: <200812180200.57847.johan@herland.net> (raw)
In-Reply-To: <897592.56642.qm@web112219.mail.gq1.yahoo.com>

On Wednesday 17 December 2008, Gili Pearl wrote:
> > From: Johan Herland <johan@herland.net>
> > On Wednesday 17 December 2008, Gili Pearl wrote:
> > > But what if K-L-M conflict with C-D? The one who should take care
> > > about it is  the mid-level1 maintainer (or possibly one of the
> > > low-level1 maintainers).
> >
> > If there is a merge conflict, mid-level1 maintainer will typically
> > merge D and M into a new merge commit N:
> >
> > top-level : A----B----C----D
> >              \              \
> >               \              \
> > mid-level1:    K----L----M----N
>
> There's one thing that still bothers me and I'd like to understand.
> What if someone looks both on top-level repo and mid-level1 repo, and he
> want to diff some local commit X against commit D. I didn't try it, but I
> wonder how git knows against which D to compare? On the top-level D means
> A-B-C-D while on the mid-level1 C means A-K-L-M-B-C-D (that is what
> git-log on mid-level shows). I'm probably missing something here...
> commit id cannot represent two different histories, right?

D will always be the same commit in both top-level repo and mid-level1 repo. 
Remember that D precedes the merge commit N, so D is not changed by the 
merge at all (then we could no longer call it D).

The diagram above is slightly misleading, in that it does not say whether 
the merge commit N has been pulled into the top-level repo or not. Here are 
more descriptive illustrations:

A) Before the merge:

  A----B----C----D    <-- top-level
   \
    \
     K----L----M    <-- mid-level1

B) After mid-level1 has done the merge

  A----B----C----D    <-- top-level
   \              \
    \              \
     K----L----M----N    <-- mid-level1

C) After top-level has pulled the merge from mid-level1 (assuming top-level 
has done nothing in the meantime, and can fast-forward to N)

  A----B----C----D
   \              \
    \              \
     K----L----M----N    <-- mid-level1 & top-level

> > ...and then ask top-level maintainer to merge N (which should have no
> > conflicts by now). The merge can also be done by low-level1 developer.
>
> How can it be done by low-level1? you mean by bypassing mid-level and
> merging top-level directly?

No. low-level1 will do the merge commit in his repo (typically by creating a 
new branch at M (thus keeping X & Y out of the way), and then merging D 
into this new branch to produce N), and will then ask mid-level1 to pull 
the merge into her repo. From there, the situation is similar to the above 
diagrams.

In principle, it's possible for low-level1 to ask top-level directly to pull 
his merge commit, but this is probably frowned upon, because it breaks the 
project conventions (although git itself has no problem with this).


...Johan

-- 
Johan Herland, <johan@herland.net>
www.herland.net

  reply	other threads:[~2008-12-18  1:02 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-16 22:26 how to work in hirarchical git model? Gili Pearl
2008-12-17  7:32 ` Johannes Sixt
2008-12-17  8:23   ` Gili Pearl
2008-12-17  8:33     ` Johan Herland
2008-12-17  8:44       ` Gili Pearl
2008-12-17 22:59       ` Gili Pearl
2008-12-18  1:00         ` Johan Herland [this message]
2008-12-17  8:48     ` Johannes Sixt

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=200812180200.57847.johan@herland.net \
    --to=johan@herland.net \
    --cc=gili.pearl@yahoo.com \
    --cc=git@vger.kernel.org \
    --cc=j.sixt@viscovery.net \
    /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).