Page MenuHomePhabricator

Auto-resolve merge conflicts in RELEASE-NOTES
Closed, DuplicatePublic

Description

git allows specifying a script to automatically resolve merge conflicts. This is useful for files where things are always added in the same place, like RELEASE-NOTES. This is done by adding a line to .gitattributes (or .git/info/attributes) like this:

RELEASE-NOTES-* merge=union

This will automatically resolve conflicts in RELEASE-NOTES-* with the "union" driver, which keeps both sides' files if there's a conflict. This isn't exactly what we want, because if one side removes a line and the other adds in the same place, it will re-add the removed line. Also, conflicting changes to bits of the file that aren't line-based will result in duplicate lines. This will happen silently without warning, without any merge conflict being reported.

It would be nice if we wrote our own merge driver for RELEASE-NOTES.