1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-08 01:36:08 +02:00

Merge branch 'jc/userdiff-pattern-hint'

Remind developers that the userdiff patterns should be kept simple
and permissive, assuming that the contents they apply are always
syntactically correct.

* jc/userdiff-pattern-hint:
  userdiff: comment on the builtin patterns
This commit is contained in:
Junio C Hamano 2021-08-30 16:06:03 -07:00
commit e1eb133476

View File

@ -13,6 +13,16 @@ static int drivers_alloc;
#define IPATTERN(name, pattern, word_regex) \
{ name, NULL, -1, { pattern, REG_EXTENDED | REG_ICASE }, \
word_regex "|[^[:space:]]|[\xc0-\xff][\x80-\xbf]+" }
/*
* Built-in drivers for various languages, sorted by their names
* (except that the "default" is left at the end).
*
* When writing or updating patterns, assume that the contents these
* patterns are applied to are syntactically correct. The patterns
* can be simple without implementing all syntactical corner cases, as
* long as they are sufficiently permissive.
*/
static struct userdiff_driver builtin_drivers[] = {
IPATTERN("ada",
"!^(.*[ \t])?(is[ \t]+new|renames|is[ \t]+separate)([ \t].*)?$\n"