From: Junio C Hamano <gitster@pobox.com>
To: Johannes Sixt <j6t@kdbg.org>
Cc: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>,
Git Mailing List <git@vger.kernel.org>,
Stephen Haberman <stephen@exigencecorp.com>,
Andrew Wong <andrew.kw.w@gmail.com>
Subject: Re: [PATCH/RFC] rebase -p: do not redo the merge, but cherry-pick first-parent changes
Date: Thu, 24 May 2012 14:34:49 -0700 [thread overview]
Message-ID: <7vaa0xw9dy.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <4FBE9AC7.3010506@kdbg.org> (Johannes Sixt's message of "Thu, 24 May 2012 22:32:07 +0200")
Johannes Sixt <j6t@kdbg.org> writes:
> Today I was able to use rebase -i -p in the field. I used it to rebuild
> an integration branch (akin to git's pu branch). Guess what? It did not
> work as expected:
>
> Two of the topic branches' early parts were already merged in the
> upstream. The instruction sheet had only 'pick' of merge commits for the
> topics. Except for these two; there, all commits (that were not yet in
> upstream) were offered to pick, including the merge commit.
>
> I started with this:
>
> A--M--o--o <- master
> / /
> --o--X--Y <- side branch (partially merged in master)
> \ \
> R--S--N--T <- integration (to be rebuilt on master)
>
> I wanted this:
>
> A--M--o--o
> / / \
> / / R'--S'--N'--T'
> --o--X--Y---------------´
It is unclear what exact revisions you gave to rebase, but I am assuming
that you asked "rebase --onto master X^ T" (you can use R^ instead of X^;
they refer to the same commit).
It is straightforward to see what should happen to R and S; they should be
a straight replay of single parent commit on top of 'master'.
But it is unclear what should happen to X and Y.
When you are rebasing the X^..T sub-DAG, can you say what makes S more
special than Y by looking at the original topology? Your "I wanted this"
picture depicts S' to be rewritten but Y stays the same. Why?
They are both in the X^..T DAG, and neither of them is merged to 'master'.
I can sort of see why X and R would be treated differently (X is part of
master, R is not), but I cannot justify why your "I wanted this" picture
replays S' without replaying Y'.
What am I missing?
> But I got this:
>
> A--M--o--o-------Y'
> / / \ \
> --o--X--Y R'--S'--N'--T'
Which is what I would expect, from the "Y and S play a similar role in the
sub-DAG X^..T in the original DAG, with respect to master" point of view.
next prev parent reply other threads:[~2012-05-24 21:34 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-21 20:19 [PATCH/RFC] rebase -p: do not redo the merge, but cherry-pick first-parent changes Johannes Sixt
2012-05-22 18:23 ` Junio C Hamano
2012-05-22 19:30 ` Johannes Sixt
2012-05-22 23:38 ` Jonathan Nieder
2012-05-23 15:37 ` Martin von Zweigbergk
2012-05-23 18:53 ` Junio C Hamano
2012-05-23 20:41 ` Martin von Zweigbergk
2012-05-24 17:31 ` Junio C Hamano
2012-05-24 17:47 ` Martin von Zweigbergk
2012-05-24 20:09 ` Junio C Hamano
2012-05-24 20:32 ` Johannes Sixt
2012-05-24 21:34 ` Junio C Hamano [this message]
2012-05-25 15:58 ` Johannes Sixt
2012-05-25 16:58 ` Junio C Hamano
2012-05-25 20:03 ` Johannes Sixt
2012-05-23 18:59 ` 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=7vaa0xw9dy.fsf@alter.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=andrew.kw.w@gmail.com \
--cc=git@vger.kernel.org \
--cc=j6t@kdbg.org \
--cc=martin.von.zweigbergk@gmail.com \
--cc=stephen@exigencecorp.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).