git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: Damien Wyart <damien.wyart@gmail.com>
Cc: Junio C Hamano <gitster@pobox.com>, git@vger.kernel.org
Subject: Re: libreoffice merge issue ...
Date: Fri, 29 Apr 2011 08:55:05 -0400	[thread overview]
Message-ID: <20110429125505.GA4540@sigill.intra.peff.net> (raw)
In-Reply-To: <20110421140132.GA6696@brouette>

On Thu, Apr 21, 2011 at 04:01:32PM +0200, Damien Wyart wrote:

> * Junio C Hamano <gitster@pobox.com> [2011-02-16 13:30]:
> > Yeah, the reverted 83c9031 (unpack_trees(): skip trees that are the
> > same in all input, 2010-12-22) also seems to have seriously broken
> > intermediate merge merge-recursive makes. I actually recall scratching
> > my head when I made 00e6ee7 (Merge branch 'maint', 2011-02-11) that
> > was causing add/add conflict when it shouldn't. It turns out that
> > quite a lot of entries were missing in contrib/ area from the virtual
> > common ancestry tree synthesized by merge-recursive that called into
> > the botched unpack_trees()---it of course would result in add/add
> > conflict if a merge is done using such a tree as the common.
> 
> > No, I haven't had a chance nor energy to dig further than what
> > I reported above.
> 
> Out of curiosity, I would like to know if digging further into this
> issue is still on your TODO list. I feel understanding exactly what was
> wrong in 83c9031 would be interesting ; having just the revert is a bit
> frustrating.
> 
> The initial optimization in 83c9031 seemed right at first glance, so
> I would be interesting in having a more final answer to this.

I didn't dig further, but looking at 83c9031 with a fresh set of eyes, I
think that merge-recursive falls under the "exceptions" that Junio
listed in the commit message. That is, he indicates correctly that we
cannot use this optimization for "reset --hard" or for checking out for
the first time.

Similarly, merge-recursive is going to do many 3-way merges between
trees into an empty index (when merging virtual ancestors), and we need
to unpack those subtrees even if they are all the same.  But given the
conditions added by 83c9031 in unpack-trees.c:fast_forward_merge, I
don't see anything preventing the optimization in how merge-recursive
calls into unpack-trees.

We do a discard_cache() right before doing the 3-way merge for virtual
ancestors. So we will see that there are no entries in our current index
for that directory. That may be a clue that the optimization should not
be used.

-Peff

      reply	other threads:[~2011-04-29 12:55 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-14 16:07 libreoffice merge issue Michael Meeks
2011-02-14 16:52 ` Norbert Thiebaud
2011-02-14 17:26 ` Ferry Huberts
2011-02-14 17:33   ` Norbert Thiebaud
2011-02-15  9:45 ` Jeff King
2011-02-15 18:46   ` Junio C Hamano
2011-02-16  2:57     ` Jeff King
2011-02-16 21:30       ` Junio C Hamano
2011-04-21 14:01         ` Damien Wyart
2011-04-29 12:55           ` 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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110429125505.GA4540@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=damien.wyart@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).