Skip to content
This repository was archived by the owner on Nov 18, 2021. It is now read-only.
This repository was archived by the owner on Nov 18, 2021. It is now read-only.

Add git-merge-changelog support (custom merge driver in .gitattributes) #560

@Envek

Description

@Envek

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 GitHub 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 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 (it is 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 GitHub and will be very happy if it can handle such situations.

Please, consider adding git-merge-changelog support in GitHub 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 PR is not mergeable it means that it is something really serious.

With best regards, Andrey Novikov.


Sent to [email protected] at 2016-01-06

Received reply from Francis Batac (GitHub Staff) [email protected] 2016-01-07

Hey Andrey -

Also in RoR contribution guide written that for every change there should be an entry in ChangeLog file.

Because of that every pull requests becomes 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.

At GitHub, we host a ton of awesome projects that each have their own contributing guidelines. Perhaps raising this within the rails/rails issue tracker would be the best way to go here.

So, please, add this to GitHub 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 pull requests mergeable again! And everyone will know, that if PR is not mergeable it means that it is something really serious.

Andrey, thanks so much for your improvement proposal. We're always working to improve GitHub where we can.

I've added your idea about including an option to include a .gitattributes file to the root of any directory with a single line directive to our internal Feature Request List.

Let us know if you need help with anything else!

All the best,
Francis

Replied to Francis Batac (GitHub Staff) [email protected] 2016-01-07

Hello Francis.

Just want to clarify that CHANGELOGs are very popular in Open Source projects, so many developers suffer from changelog merging. Rails is just an example. Actually changelogs are good thing that allows to see (and search for) all recent changes as they are received, I don't think that anyone will abandon it.

Actually commit log in GitHub is not convenient for searching who and when made something. There is no search or filtering. But this is another problem.

For example try to find who and when added support for specifying database comments in https://github.com/rsim/oracle-enhanced . I used blame for CHANGELOG, found entry, and it was added later on. So I have tried to find a commit from beginning of 2009 with word «comment» in the message. So I just started switching pages in commit log and searching on page with Ctrl+F, but got tired quickly (pagination without ability to switch to arbitrary page sucks) and start to edit page number in URL. And found it on page 30! And this is not so big project anyway. Do you know better approach with GitHub UI? And yes, there is git log --grep exists, I know.

Thank you for reply and placing my proposal in feature request list.

With best wishes, Andrey.


Also posted same issue to GitLab issue tracker: https://gitlab.com/gitlab-org/gitlab-ce/issues/5902

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions