From: Junio C Hamano Date: Sun, 11 Jan 2009 23:20:51 GMT Subject: Re: [PATCH v3 3/4] word diff: make regex configurable via attributes Message-ID: <7veiz9o2ek.fsf@gitster.siamese.dyndns.org> In-Reply-To: <72242bd75fa8d55c2afc723f8539ef56f2569d3e.1231669012.git.trast@student.ethz.ch> Thomas Rast writes: > Make the --color-words splitting regular expression configurable via > the diff driver's 'wordregex' attribute. The user can then set the > driver on a file in .gitattributes. If a regex is given on the > command line, it overrides the driver's setting. > ... > diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt > index 6152d5b..d22c06b 100644 > --- a/Documentation/diff-options.txt > +++ b/Documentation/diff-options.txt > @@ -96,7 +96,9 @@ endif::git-format-patch[] > By default, a new word only starts at whitespace, so that a > 'word' is defined as a maximal sequence of non-whitespace > characters. The optional argument can be used to > - configure this. > + configure this. It can also be set via a diff driver, see > + linkgit:gitattributes[1]; if a is given explicitly, it > + overrides any diff driver setting. > + > The must be an (extended) regular expression. When set, every > non-overlapping match of the is considered a word. (Regular One bikeshedding I think is better to get over with is that this probably should be called xwordregex for consistency with xfuncname where 'x' variant means POSIX ERE and the one without means POSIX BRE, even if we are not going to support diff.wordregex that uses BRE. I am assuming [3/4] can be trivially adjusted if we were to adopt the clean-up approach Dscho is taking?