From: Jeff King <peff@peff.net>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: "\"Marcel 'childNo͡.de' Trautwein\"" <c0d3+gitscm@childno.de>,
"Jonathan Nieder" <jrnieder@gmail.com>,
git@vger.kernel.org
Subject: Re: [BUG] [git 2.16.1] yeeek ... my files are gone .. by git pull <otherRepositoryUrl>
Date: Mon, 5 Mar 2018 16:46:26 +0100 [thread overview]
Message-ID: <20180305154626.GA26740@sigill.intra.peff.net> (raw)
In-Reply-To: <nycvar.QRO.7.76.6.1803051546200.20700@ZVAVAG-6OXH6DA.rhebcr.pbec.zvpebfbsg.pbz>
On Mon, Mar 05, 2018 at 03:49:13PM +0100, Johannes Schindelin wrote:
> > I think that is doing the right thing for half of the problem. But
> > there's something else funny where we do not include the "upstream"
> > commits from the split history (i.e., we rebase onto nothing,
> > whereas a normal "git rebase" with a split history will graft the two
> > together).
>
> Let me ask to make sure I am understanding you correctly. Are you
> referring to "split history" as the case where the commit graph has *two*
> root commits?
Yes, I mean two root commits. But especially when one is in the history
to be rebased, and the other is in the "upstream" history.
So as a concrete example, if I have this repo:
git init
>one && git add one && git commit -m one
git checkout --orphan other
git mv one two && git commit -m two
and I do this:
git rebase master
I end up with a two-commit history, with "two" on top of "one". That
makes sense to me. Similarly if I instead do:
git rebase -i master
the todo list has "pick two", and if I leave it as-is then I get the
same history. But if I do:
git rebase --preserve-merges master
I end up with a single-commit history, with only commit "one". That's
wrong, because it threw away the history on the "other" branch.
If I apply the patch I showed earlier, then I get a single-branch
history, but this time it contains only "two". That also seems wrong,
because we didn't build on top of "master". I'd expect this command to
give the same results as a non-merge-preserving rebase.
Does that make more sense?
-Peff
prev parent reply other threads:[~2018-03-05 15:46 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-22 22:41 [BUG] [git 2.16.1] yeeek ... my files are gone .. by git pull <otherRepositoryUrl> "Marcel 'childNo͡.de' Trautwein"
2018-02-22 23:20 ` Jonathan Nieder
2018-02-23 5:29 ` "Marcel 'childNo͡.de' Trautwein"
2018-02-23 6:45 ` Jeff King
2018-02-26 23:33 ` Johannes Schindelin
2018-02-28 13:28 ` Jeff King
2018-03-05 14:49 ` Johannes Schindelin
2018-03-05 15:46 ` Jeff King [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=20180305154626.GA26740@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=Johannes.Schindelin@gmx.de \
--cc=c0d3+gitscm@childno.de \
--cc=git@vger.kernel.org \
--cc=jrnieder@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).