Custom hunk-header with ignore case setting

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I'm working with a proprietary programming language which ignores case.
I now started to write a custom version of
diff.*.xfuncname and it is kind of ugly to always spell out all cases like
[Ff][Uu][Nn][cC][Tt][Ii][oO][Nn].

I've seen that the builtin diff patterns in userdiff.c can be specified ignoring case using the IPATTERN macro.

One of the possible solutions would be to patch userdiff.c
(patch courtesy of Johannes Schindelin):

-- snip --
diff --git a/userdiff.c b/userdiff.c
index fad52d6..f089e50 100644
--- a/userdiff.c
+++ b/userdiff.c
@@ -228,6 +228,9 @@ int userdiff_config(const char *k, const char *v)
 		return parse_funcname(&drv->funcname, k, v, 0);
 	if (!strcmp(type, "xfuncname"))
 		return parse_funcname(&drv->funcname, k, v, REG_EXTENDED);
+	if (!strcmp(type, "ixfuncname"))
+		return parse_funcname(&drv->funcname, k, v,
+				REG_EXTENDED | REG_ICASE);
 	if (!strcmp(type, "binary"))
 		return parse_tristate(&drv->binary, k, v);
 	if (!strcmp(type, "command"))
-- snap -

With a patch like that I would, of course, supply documentation and tests.

Is that something worth a try from my side?

An alternative solution would be to add something like pxfuncname which
understands PCREs which we we already support in git grep.

And yet another alternative would be that I send a patch enhancing userdiff.c
with a reasonable pattern for the programming language. But its community,
and especially intersected with git users, is not that large.

Thanks,
Thomas
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]