Re: [PATCH v2] make diff --color-words customizable
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jan 11, 2009, 01:34 UTC
- Message-ID
- <7vr63atykr.fsf@gitster.siamese.dyndns.org>
- In-Reply-To
- <alpine.DEB.1.00.0901101239550.30769@pacific.mpi-cbg.de>
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
Show 15 quoted lines
> Well, the thing I tried to hint at: it is not good to have a monster > patch, as nobody will review it. > > In your case, I imagine it would be much easier to get reviewers if you > had > > patch 1/4 refactor color-words to allow for 0-character word > boundaries > patch 2/4 allow regular expressions to define what makes a word > patch 3/4 add option to specify word boundary regexps via > attributes > patch 4/4 test word boundary regexps > > And I admit that I documented the code lousily, but that does not mean > that you should repeat that mistake.
Sounds like a reasonable request. Also I am seeing:
diff.c: In function 'scan_word_boundaries':
diff.c:512: warning: enumeration value 'DIFF_WORD_UNDEF' not handled in switchfrom this part of the code:
for (i = 0; i < len; i++) {
switch (buf->boundaries[i]) {
case DIFF_WORD_BODY:
*p++ = text[i];
break;
case DIFF_WORD_END:
*p++ = text[i];
*p++ = '\n'; /* insert an artificial newline */
break;
case DIFF_WORD_SPACE:
*p++ = '\n';
break;
case DIFF_WORD_SKIP:
/* nothing */
break;
}
}