From: Stephen Bash <bash@genarts.com>
To: Jeff King <peff@peff.net>
Cc: git@vger.kernel.org
Subject: Re: Merging split files
Date: Tue, 29 Mar 2011 12:33:17 -0400 (EDT) [thread overview]
Message-ID: <3752347.282743.1301416397164.JavaMail.root@mail.hq.genarts.com> (raw)
In-Reply-To: <20110329151623.GD10771@sigill.intra.peff.net>
Jeff-
Thanks for taking the time to think about this. More inline...
----- Original Message -----
> From: "Jeff King" <peff@peff.net>
> To: "Stephen Bash" <bash@genarts.com>
> Cc: git@vger.kernel.org
> Sent: Tuesday, March 29, 2011 11:16:23 AM
> Subject: Re: Merging split files
>
> On Fri, Mar 18, 2011 at 09:22:36AM -0400, Stephen Bash wrote:
>
> > In our previous release foo.cxx contained both the base class and a
> > few subclasses. Since then the number of subclasses has grown, and
> > we've split foo.cxx (base and sub-classes) into foo-base.cxx (base
> > class) and foo-defs.cxx (sub-classes). Since the release, we've had
> > a
> > few bug fixes in foo.cxx on the maintenance branch, and need to
> > merge
> > those back to development. When I did the merge Git identified
> > foo.cxx as moved to foo-defs.cxx, which worked for most changes, but
> > a
> > few needed to be in foo-base.cxx. In this case it was a pretty
> > trivial manual resolution, but is there a method for handling merges
> > of split files?
>
> I don't think there is currently a good way to do this automatically.
>
> The problem is that the closest merge-recursive gets to understanding
> content movement is that it considers whole file renames. ...
>
> So I think the most flexible thing is to forget file renames at all.
I agree that would be the best solution long term. ("Git doesn't track files, Git tracks content". Think I heard that somewhere before...)
That being said, the back seat drivers in the office here (i.e. me and everyone else that knows almost nothing about the internals of merge recursive!) thought maybe a middle ground is teach merge recursive to do copy detection along with rename detection. Then the algorithm would have a (relatively small?) list of candidate files to check for hunks. You still have to deal with the similarity score in some corner cases, but hopefully since all we want is candidate files the process is relatively insensitive to the similarity threshold.
Am I way off the deep end now? I'm not lying when I say I know *nothing* about the merge implementations.
> I definitely think it's an interesting area to work in, but I would
> have to give it a lot of thought.
It's a "corner case" that I seem to have run into a lot in my work experience, so if the Git community can actually make a good solution work it will be a major win in my book.
Thanks again!
Stephen
next prev parent reply other threads:[~2011-03-29 16:33 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <31155742.183989.1300374518689.JavaMail.root@mail.hq.genarts.com>
2011-03-18 13:22 ` Merging split files Stephen Bash
2011-03-29 15:16 ` Jeff King
2011-03-29 16:33 ` Stephen Bash [this message]
2011-03-29 18:15 ` Jeff King
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=3752347.282743.1301416397164.JavaMail.root@mail.hq.genarts.com \
--to=bash@genarts.com \
--cc=git@vger.kernel.org \
--cc=peff@peff.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).