Skip to content

Commit

Permalink
Change merge driver for CHANGELOG.md to resolve conflict problem
Browse files Browse the repository at this point in the history
Currently Problem
------

CHANGELOG.md is very often conflict when PR.
It's very troublesome.
e.g. rubocop#3588 (comment)

Solution
-----

I've added a `.gitattributes` file.
The file changes a merge driver to union for CHANGELOG.md.

The union driver has what it takes to merge CHANGELOG.md.
With the setting, CHANGELOG doesn't conflict!
Always both of the addition is chosen.

However, this solution has a problem.
GitHub doesn't support the feature.
So, We can't merge a PR at GitHub Web if CHANGELOG.md conflicts.

Don't worry, `hub` command supports the feature.
Maintainer can merge a conflicted PR by hub command.
For example.

```sh
$ git branch
* master
some-feature-branch-1

$ hub merge https://github.com/bbatsov/rubocop/pull/xxxx # specify a PR url
$ git push
```

I think this method is not complete, but it is better than now.
What do you think?

More Information
-----

- http://krlmlr.github.io/using-gitattributes-to-avoid-merge-conflicts/
  • Loading branch information
pocke authored and Neodelf committed Oct 15, 2016
1 parent 548a6bc commit fc71776
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CHANGELOG.md merge=union

0 comments on commit fc71776

Please sign in to comment.