diff options
author | Junio C Hamano <gitster@pobox.com> | 2021-08-30 16:06:03 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-08-30 16:06:03 -0700 |
commit | e1eb13347610bd5b062377f2e8d7f807c6e89d07 (patch) | |
tree | a037bc462bd3bfed23955e3e3dcf9a3880cacfa2 /userdiff.c | |
parent | 669277c551604fddcb4dc9dac888cd956cccacd3 (diff) | |
parent | b6029b3279ef5997796de99ce9319a5f1499df21 (diff) | |
download | git-e1eb13347610bd5b062377f2e8d7f807c6e89d07.tar.gz |
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
Diffstat (limited to 'userdiff.c')
-rw-r--r-- | userdiff.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/userdiff.c b/userdiff.c index d9b2ba752f..08a71c5b1e 100644 --- a/userdiff.c +++ b/userdiff.c @@ -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" |