automatic merging of "set of lines" text files with a specific git merge driver (union?)

seanh snhmnd at gmail.com
Sun Feb 20 19:59:16 CET 2011


On Sun, Feb 20, 2011 at 06:34:02PM +0100, Dieter Plaetinck wrote:
> Hi, do you have any text files that are nothing more then an
> "unordered set of lines"?  More specifically, files where: *
> location/ordering of lines is not (very) important or relevant * new
> lines can be added anywhere within the file, on arbitrary locations *
> deleting a line means "I want this line gone from the file, wherever
> it is"
> 
> I surely have them.  Simple todo lists, notes, shell history, GTD
> inbox files, browser history, etc

Really? I keep my todo tasks and notes in text files, but I don't consider the
order of those items to be random or unimportant. I want my todo tasks
and notes to appear in the file in the order that I created them. Also
for shell history, browser history, etc., surely these items are
chronologically ordered?

Git does do a terrible job of merging these files though. Here's an
earlier email I wrote about the problem as I see it:

http://lists.madduck.net/pipermail/vcs-home/2010-April/000253.html

As suggested in that thread, I think a "patience merge" based on the
patience diff algorithm might handle them well. Git comes with an
implementation of patience diff. I think you could do it with a custom
merge driver. Also, I think bzr does this kind of merge by default.


More information about the vcs-home mailing list