What you want is a custom merge strategy, and you have defined a merge driver.
A driver is called only on conflicts, while a strategy is used anytime two commits are merged.
See this answer for how to set up your solution:
https://stackoverflow.com/a/23140455/6084013