git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jay Soffian <jaysoffian@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git <git@vger.kernel.org>
Subject: Re: merge -s ours question
Date: Mon, 8 Mar 2010 18:33:17 -0500	[thread overview]
Message-ID: <76718491003081533r441506e9n48afee2021e7bad4@mail.gmail.com> (raw)
In-Reply-To: <7vhboql8uu.fsf@alter.siamese.dyndns.org>

On Mon, Mar 8, 2010 at 5:57 PM, Junio C Hamano <gitster@pobox.com> wrote:
> Jay Soffian <jaysoffian@gmail.com> writes:
>
>> It took a lot of work, but I backported everything newer than A using rebase
>> and cherry-pick, and omitting the merges, giving me a dev' clean of merges
>> from upstream:
>>
>>      dev'   o--A'--B' ... Y'
>>            /
>>  upstream 1--2--3--4--5
>>            \     \     \
>>       dev   o--A--x--B--x ... Y
>
> I understand that at this point "dev'" is the moral equivalent of what you
> called "dev1" in the next picture.
>
>> upstream 1--2--3--4--5
>>           \           \
>>     dev2   \           o--o--o--o
>>             \
>>     dev1     o--o--o--o--o
>
> It is unclear what commits on dev2 branch are about in this picture.  Are
> they replay of what you have on dev1?  Or are they about a feature that is
> different from what dev1 does, perhaps using what dev1 have already done,
> or perhaps totally independent of dev1?
>
> If "dev1" and "dev'" are the moral equivalents, and dev2 wants to use what
> dev1 did _and_ what is in updated upstream (i.e. dev2 cannot build without
> either dev1 nor some of the feature/fix in "2"..."5"),

Sorry I was unclear in my diagrams, and you guessed correctly, dev2
needs both dev1 and newer commits from upstream. So a correct "ideal"
picture would've been:

upstream 1--2--3--4--5.
          \            \
    dev2   \            o--o--o--o
            \          /
    dev1     o--o--o--o--o


Now, development will continue on all three branches, with dev2
needing changes from both dev1 and upstream. In fact, dev1 may also
periodically need changes from upstream, but for the foreseeable
future, dev1 will be based on an older version of upstream than dev2.

> then I would
> probably build a history that looks like this:
>
>                      o--o--o dev2 (builds on top of dev1)
>                     /
>                 .--*   merge between dev1 and upstream
>                /  /
>      o--o--o--o  /   dev1
>     /           /
>    1--2--3--4--5     upstream
>
> and give a pull request to the upstream for "*" to incorporate the fully
> cooked work done on dev1.

Okay. One detail I left out is that dev1 and dev2 will never go
upstream. They are forever downstream. Hopefully at some point dev1
and dev2 can be based on the same upstream commit, but for now dev2
will periodically be merging from dev1 and will remain on a newer
upstream commit than dev1. (Periodically, both dev1 and dev2 may merge
from upstream, but it will be the case that dev1 merges from an older
upstream commit than dev2.)

> Also if "dev'" and "dev1" are the moral equivalents, then the merge "*"
> above _should_ match exactly what you had at "Y" in "dev" in the original
> mergy history.  So after creating "*", you may want to do a regular merge
> (IOW, I don't think "-s ours" is necessary if you rebuilt "dev1" right)
> between it and 'dev' to create "M" that should result in the same tree:
>
>                 .--*   merge between dev1 and upstream
>                /  / \
>      o--o--o--o  /   \        dev1
>     /           /     \
>    1--2--3--4--5       \      upstream
>     \     \     \       \
>      o--A--x--B--x-..-Y--M    dev
>                           \
>                            o--o--o dev2'
>
> and build "dev2'" on "dev" instead; but you probably cannot offer "dev" to
> be pulled to the upstream due to the criss-cross mess (that was the whole
> reason you did "dev1" in the first place), and doing so would make "dev2'"
> unpullable for the same reason.  So I don't see much point in doing that
> merge "M" nor keeping "dev" branch around, once you verified that "*" and
> "Y" matches to make sure your rebuilt dev1 has what dev has, and it is
> what dev should have looked like in the first place.
>
> If you want to keep merging from dev1 to dev2 because dev1 is still not
> ready, you might want to choose to rebase dev2 on top of dev1 instead.

Okay. I think I have more work ahead of me creating '*'. I was trying
to avoid having to do that. It is actually composed of multiple merges
with some fairly complex resolutions, but maybe rerere-train and
rerere can help me here.

j.

      reply	other threads:[~2010-03-09 12:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-08 22:26 merge -s ours question Jay Soffian
2010-03-08 22:57 ` Junio C Hamano
2010-03-08 23:33   ` Jay Soffian [this message]

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=76718491003081533r441506e9n48afee2021e7bad4@mail.gmail.com \
    --to=jaysoffian@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /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).