From: John Keeping <john@keeping.me.uk>
To: "David A. Greene" <greened@obbligato.org>
Cc: git@vger.kernel.org, sandals@crustytoothpaste.net, peff@peff.net,
gitster@pobox.com
Subject: Re: Odd rebase behavior
Date: Sat, 19 Dec 2015 16:09:06 +0000 [thread overview]
Message-ID: <20151219160906.GB14056@serenity.lan> (raw)
In-Reply-To: <20151218180549.GA14056@serenity.lan>
On Fri, Dec 18, 2015 at 06:05:49PM +0000, John Keeping wrote:
> On Fri, Dec 18, 2015 at 11:43:16AM -0600, David A. Greene wrote:
> > John Keeping <john@keeping.me.uk> writes:
> >
> > > It seems that the problem is introduces by --preserve-merges (and
> > > -Xsubtree causes something interesting to happen as well). I see the
> > > following behaviour:
> >
> > Thanks for narrowing this down! Is it possible this is actually a
> > cherry-pick problem since --preserve-merges forces rebase to use
> > cherry-pick?
>
> I'm pretty sure this a result of the code in git-rebase--interactive.sh
> just below the comment "Watch for commits that have been dropped by
> cherry-pick", which filters out certain commits. However, I'm not at
> all familiar with the --preserve-merges code in git-rebase so I could be
> completely wrong.
I've traced through git-rebase--interactive.sh and I can see what's
happening here now. The problematic code is around the handling of the
"rewritten" directory.
In --preserve-merges mode, we write the SHA1 of the "onto" commit into
rewritten and then add any commits descended from it along the
first-parent path that we have identified as candidates for being
rebased. This allows us to identify commits that have been merged in
and remove them from the rebase instruction list.
Because the right-hand commit in this case is disjoint from "onto", we
end up dropping everything at this point. The --root option fixes this
because instead of preserving just "onto", it adds all of the commits
given by:
git merge-base --all $orig_head $upstream
Since the disjoint history causes the root commit to be rewritten, I
think requiring --root for this case to work is reasonable. However,
I'm not sure we should add it automatically. It may be better to detect
that there is no common history and die if --root has not been given.
prev parent reply other threads:[~2015-12-19 16:09 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-16 3:17 Odd rebase behavior David A. Greene
2015-12-16 22:17 ` John Keeping
2015-12-18 17:43 ` David A. Greene
2015-12-18 18:05 ` John Keeping
2015-12-18 21:05 ` Johannes Sixt
2015-12-19 16:09 ` John Keeping [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=20151219160906.GB14056@serenity.lan \
--to=john@keeping.me.uk \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=greened@obbligato.org \
--cc=peff@peff.net \
--cc=sandals@crustytoothpaste.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).