Improvement proposal: Add git-merge-changelog support
Hello everyone amd thank you for GitLab!
I'm somewhat frequently send pull requests to open source projects. And I've noticed one inconvenience while sending PRs to big and actively developed repos in GitHub like Ruby on Rails' one, maintainers of which merges several pull requests every day (and GitLab is big and actively developed too). Also in RoR contribution guide written that for every change there should be an entry in ChangeLog file.
Because of that every pull requests become unmergeable in hours because of merge conflict in single text file! And to make it merged in you need to rebase and push several times just to allow collaborator to “catch” a moment when he can click “Merge” button. That's hurts and kills all the passion for contribution.
But if think for the moment, there is really no merge conflict at all as CHANGELOG files are prepend-only! I have searched a bit and found 1 year old GitLab's blog post about CHANGELOG placeholders: https://about.gitlab.com/2015/02/10/gitlab-reduced-merge-conflicts-by-90-percent-with-changelog-placeholders/
It's interesting, but sounds like a hack. I searched a bit more and found ready solution: a git-merge-changelog utility and blog post about configuring it: https://gnu.wildebeest.org/blog/mjw/2012/03/16/automagically-merging-changelog-files-with-mercurial-or-git/
I installed it (its already available in Debian/Ubuntu repos) and played a bit with one of my old pull requests (approx. 1 year old) in Rails. Results are very good. I was able to merge it without conflicts and my entry to Ruby on Rails' ActiveSupport CHANGELOG was correctly prepended to the beginning of file.
I'm actively using GitLab and will be very happy if it can handle such situations.
Please, consider adding git-merge-changelog support in GitLab in such a way, that everyone can add a .gitattributes
file to root of any repository with a line like this:
CHANGELOG.md merge=merge-changelog
and make most of their merge requests mergeable again! And everyone will know, that if MR is not mergeable it means that it is something really serious.
With best regards, Andrey Novikov.