git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Thomas Rast <trast@student.ethz.ch>
Cc: "Stephen R. van den Berg" <srb@cuci.nl>, git@vger.kernel.org
Subject: Re: [RFC] cherry-pick using multiple parents to implement -x
Date: Sun, 07 Sep 2008 15:22:08 -0700	[thread overview]
Message-ID: <7v1vzvlhpr.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <200809072316.58516.trast@student.ethz.ch> (Thomas Rast's message of "Sun, 7 Sep 2008 23:16:54 +0200")

Thomas Rast <trast@student.ethz.ch> writes:

> Stephen R. van den Berg wrote:
>> Junio C Hamano wrote:
>> >             o---...o---B---A
>> >            /                \ (wrong)
>> >        ---o---o---...o---X---A'
> [...]
>> >To put it another way, having the parent link from A' to A is a statement
>> >that A' is a superset of A.  Because A contains B, you are claiming A'
>> >also contains B, which is not the case in your cherry-picked history.
>> 
>> Which existing git command actually misbehaves because it makes the
>> above assumption?
>
> Most importantly: merge.

Yes, and this is not about "misbhave" and "assumption".  It is much more
fundamental.

Stephen earlier seems to have mistaken what I taught in an earlier message:

  Remember, when you are making a commit on top of one or more parents, you
  are making this statement:

   * I have considered all histories leading to these parent commits, and
     based on that I decided that the tree I am recording as a child of
     these parents suits the purpose of my branch better than any of them.

  This applies to one-parent case as well.

as a mere convention or something, but it is not.  It is what the merge
semantics and merge-base computation (implemented in mathematical terms
over commit DAG) do, expressed in layman's terms.

The decision to merge your history with A' means that (1) you trust what
you have done so far, (2) you trust the judgement of what the other person
who built the history that leads to A' as well, and (3) you deem that the
purpose of these two histories are compatible with each other.  The last
item is why you are merging with him.

                             v you were here
                     o---o---o---M
                    /           /
            o---...O---B---A   /
           /                \ /
       ---o---o---...o---X---A'

Because of the "I have considered all things behind this commit, and I
declare this tree suits my purpose better than any of them" statement when
a merge A' was made, and the fact that you trust the judgement of the
person who made that statement, and the fact that you think the purpose of
his history is compatible with yours, we look at O as the merge base when
merging with A' to create M, and resulting history that lead to M claims
that it has A _and B_, in addition to X and other developments done on the
bottom branch of his, on top of what you used to have.

However, the transition from A to A' involves reverting B among other
things, and the history M includes that revert.  That's the consequence of
you trusting judgement made when A' was made (i.e. "fix in B does not
matter, and reverting it is better for my history") and thinking that
judgement is compatible with the purpose of your history (i.e. "yes, I
agree that dropping the fix made in B does not matter to my history
either, and that is why I am merging with A'").

  reply	other threads:[~2008-09-07 22:24 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
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 [this message]
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=7v1vzvlhpr.fsf@gitster.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=srb@cuci.nl \
    --cc=trast@student.ethz.ch \
    /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).