Zwillingssterns Weltenwald
Published on Zwillingssterns Weltenwald (http://www.xn--drachentrnen-ocb.de)

Startseite > Conveniently merge a NEWS file without conflicts

Conveniently merge a NEWS file without conflicts

Writing a NEWS [1] file (a list of changes per version, targeted at end-users) significantly reduces the effort for doing a release: To write your release notes, just copy the latest entries from the NEWS file into a message. It is one of the gems in the GNU coding standards [2]: Simple yet extremely useful. (For a detailed realization, refer to the Perl Specification for CPAN Changes files [3].)

However when you’re developing features in parallel, for example by using a pull-request workflow and requiring contributors to update the NEWS file, you will often run into merge conflicts. Resolving these takes time, though the resolution is trivial: Just use the lines from both heads.

To resolve the problem, you can set your version tracking system to use union-merge for NEWS files.

Table of Contents

  • 1. Mercurial
  • 2. Git

Mercurial

echo "
[merge-patterns]
# avoid bogus conflicts in NEWS files
NEWS = internal:union
" >> .hg/hgrc

(necessary for each contributor to avoid surprising users)

Git

echo "/NEWS merge=union" >> .gitattributes
git add .gitattributes
git commit -m "union-merge NEWS" .gitattributes

(committed, so it sticks, but might mislead contributors into missing genuine conflicts, because a contibutor does not necessarily know about the setting)

Werke von Arne Babenhauserheide. Lizensiert, wo nichts anderes steht, unter der GPLv3 or later und weiteren freien Lizenzen.

Diese Seite nutzt Cookies. Und Bilder. Manchmal auch Text. Eins davon muss ich wohl erwähnen — sagen die meisten anderen, und ich habe grade keine Zeit, Rechtstexte dazu zu lesen…


Source URL: http://www.xn--drachentrnen-ocb.de/english/free-software/merge-news

Links:
[1] https://www.gnu.org/prep/standards/standards.html#NEWS-File
[2] https://www.gnu.org/prep/standards/standards.html
[3] https://metacpan.org/pod/distribution/CPAN-Changes/lib/CPAN/Changes/Spec.pod