git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: skillzero@gmail.com
Cc: Junio C Hamano <gitster@pobox.com>, git@vger.kernel.org
Subject: Re: How to merge from newer branch to older branches?
Date: Wed, 22 Apr 2009 17:17:10 -0400	[thread overview]
Message-ID: <20090422211710.GA16096@coredump.intra.peff.net> (raw)
In-Reply-To: <2729632a0904221401u43af69a5ncec0f3f274ad648f@mail.gmail.com>

On Wed, Apr 22, 2009 at 02:01:01PM -0700, skillzero@gmail.com wrote:

> I'm not sure I understand. When I did the original rebase of "feature"
> onto the merge-base of all the branches I wanted to merge to (v1.1 and
> v1.2 in this case), the end result was that "feature" is now based on

Err, sorry, I was confusing your "future" branch and your "feature"
branch. Wherever I said "feature", I meant "future", and "topic" I meant
"feature". Yikes.

So you would make bug-fixes on "feature", and then just re-merge it to
1.1, 1.2, and future.

> the merge-base. When I merged "feature" into 1.1, I had to fix some
> conflicts so in the log I see my conflict fix commit then a merge
> commit, but "feature" wasn't changed (only v1.1 was).

Right. So now the merge-base between feature and 1.1 is the new merge
commit. And when you re-merge them, you will only look at things that
happened on the feature branch since that merge-base.

> I was thinking that if I find a bug in my original "feature" branch, I
> would commit the fix to the "feature" branch then merge that into
> v1.1, v1.2, master, etc. But I was thinking that when I tried to merge
> "feature" into v1.1 (which previously needed a commit to fix
> conflicts), I'd need to re-fix those same conflicts.

Nope, because the merge commit already records the state of the tree
once those conflicts are fixed. Now it's possible that the _bugfix_ may
have its own conflicts. But you shouldn't see the same conflicts again.

> When I look at the log for v1.1 though, maybe I just misunderstood the
> way the conflicts are resolved in git? I was thinking the conflicting
> merge would end up as one big commit that's a combination of the
> "feature"'s commits and my conflict fixes.

Sort of.  It is a new commit with two parents: the previous tip of v1.1,
and the tip of "feature". But its tree contains the state with all of
v1.1, all of feature's commits, and your fixes.

-Peff

  reply	other threads:[~2009-04-22 21:18 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-21 19:24 How to merge from newer branch to older branches? skillzero
2009-04-21 19:36 ` Jeff King
2009-04-22  5:13   ` Junio C Hamano
2009-04-22 13:34     ` Jeff King
2009-04-22 17:44     ` skillzero
2009-04-22 20:15       ` Jeff King
2009-04-22 21:01         ` skillzero
2009-04-22 21:17           ` Jeff King [this message]
2009-04-22  4:46 ` John M. Dlugosz

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=20090422211710.GA16096@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=skillzero@gmail.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).