Re: Merging split files

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jeff-

Thanks for taking the time to think about this.  More inline...

----- Original Message -----
> From: "Jeff King" <peff@xxxxxxxx>
> To: "Stephen Bash" <bash@xxxxxxxxxxx>
> Cc: git@xxxxxxxxxxxxxxx
> 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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]