Subject: Re: Git, merging, and News/Relnotes files

From: "Edward Z. Yang" <[email-masked]>
Date: Sat, 05 Jul 2008 15:07:08 -0400

Linus Torvalds wrote:
> So the first thing you should do is probably to just *try* adding that
> 
> 	NEWS merge=union
> 
> line to your .gitattributes file, and see if it works for you.

Sounds like a good first-step. It's very unlikely that we're going to
bother writing our own merge strategy for the NEWS file, so if union
ends up being more trouble than its worth, we'll probably end sticking
with manual merges.

Pieter also suggested (for some reason, I don't see the post on this
list) the git-merge-changelog driver from Gnu Savannah. Unfortunately,
the log format is a little different from ours (entries are sorted into
BC-incompatible, features, bugfixes and internal changes), so the driver
may not work (it's still worth a try, I imagine).

I'm slightly surprised no one suggested that I can the file, given that
both Git and the Linux kernel don't have one.

> For example, the default 'union' merge will literally _duplicate_ 
> identical that were added in both branches. So if you cherry-pick a commit 
> so that it exists both in the branch you are merging _and_ the branch you 
> are merging into, then any additions to the NEWS file will basically show 
> up twice, and yet auto-merge "cleanly".

I suppose that's why we have git reset --hard HEAD~. :-) I will
certainly keep this gotcha in mind.