git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Stephen R. van den Berg" <srb@cuci.nl>
To: Jeff King <peff@peff.net>
Cc: git@vger.kernel.org
Subject: Re: [RFC] cherry-pick using multiple parents to implement -x
Date: Sun, 7 Sep 2008 21:56:26 +0200	[thread overview]
Message-ID: <20080907195626.GA8765@cuci.nl> (raw)
In-Reply-To: <20080907172807.GA25233@coredump.intra.peff.net>

Jeff King wrote:
>On Sun, Sep 07, 2008 at 12:34:15PM +0200, Stephen R. van den Berg wrote:

>> The questions now are:
>> - Would there be good reason not to record the backport/forwardport
>>   relationship in the additional parents of a commit?

>Parents mean something different than just a link. If A is a parent of
>B, then that implies that at point B, we considered all of the history
>leading up to B (including A), and arrived at a certain tree state.

That implication is not a technical one, but merely a convention in the
mind of the git-user.  Relevant, of course, but maybe we can accomodate
both uses.

>But cherry-picking means we looked at just A and used it to find a
>certain tree-state. It says nothing about anything that came _before_ A.

Correct.

>Now let's say we want to cherry-pick E. If we mark the cherry-picked
>commit as a parent, we get:

>A--B--C--E' <-- master
> \      /
>  D----E--F <-- side branch

>Now let's say we want to merge the branches. What's our merge base?
>Without your proposal, it is A, but now it is actually E. So doing a
>three-way merge between E' and F with base E, it will look like our
>master branch _removed_ the change from D which is still present in F.
>And in a 3-way merge if one side removes something but the other side
>leaves it untouched, then the result removes it.

>So the merge result is bogus, as it is missing D.

True.  However...

What if the merge-base determination code is modified to behave as
if --first-parent is specified while searching for the merge-base?
In that case it *will* find A as the merge-base, even in the presence of
"sideportlinks".

Does that resolve all technical issues?
-- 
Sincerely,
           Stephen R. van den Berg.

"The future is here, it's just not widely distributed yet." -- William Gibson

  reply	other threads:[~2008-09-07 19:58 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-07 10:34 [RFC] cherry-pick using multiple parents to implement -x Stephen R. van den Berg
2008-09-07 17:28 ` Jeff King
2008-09-07 19:56   ` Stephen R. van den Berg [this message]
2008-09-07 20:04     ` Jeff King
2008-09-07 20:22       ` Stephen R. van den Berg
2008-09-08  1:49         ` Jeff King
2008-09-08  6:57           ` Stephen R. van den Berg
2008-09-07 17:28 ` Junio C Hamano
2008-09-07 20:10   ` Stephen R. van den Berg
2008-09-07 21:16     ` Thomas Rast
2008-09-07 22:22       ` Junio C Hamano
2008-09-07 22:00     ` Junio C Hamano
2008-09-08  7:37   ` Paolo Bonzini
2008-09-08  7:55     ` Junio C Hamano
2008-09-07 23:53 ` Junio C Hamano
2008-09-08 11:51   ` Stephen R. van den Berg
2008-09-08 13:04     ` Paolo Bonzini
2008-09-08 13:42       ` Stephen R. van den Berg
2008-09-08 14:37         ` Jakub Narebski
2008-09-08 14:57           ` Paolo Bonzini
2008-09-08 14:38     ` Shawn O. Pearce
2008-09-08 14:58       ` Stephen R. van den Berg
2008-09-08 15:00         ` Shawn O. Pearce
2008-09-09  8:51           ` Stephen R. van den Berg
2008-09-08 15:04       ` Paolo Bonzini

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=20080907195626.GA8765@cuci.nl \
    --to=srb@cuci.nl \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.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).