config: extract diff-related coreconfigitem()s to a helper method
We already have 'annotate' and 'diff' that use the same set of options, and I
want to add more in a followup commit, so I'm attempting to reduce maintenance
burden and duplication by making it possible to register all of them at once.
Differential Revision: https://phab.mercurial-scm.org/D5832