git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Custom hunk-header with ignore case setting

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 15, 2014, 19:35 UTC
Message-ID
<xmqqd29tw2g3.fsf@gitster.dls.corp.google.com>
In-Reply-To
<543E6E23.5030708@virtuell-zuhause.de>
Thomas Braun <thomas.braun@virtuell-zuhause.de> writes:
Show 21 quoted lines
> 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"))

I am not sure if we care deeply about supporting case insensitive payload in the first place, but the above change, unlike other possibilities, adds only small burden to the end users' cognitive load, and it looks like a sensible way to go forward.

Thanks.
Previous: Thomas Braun
Message 2 of 2 in “Custom hunk-header with ignore case setting”
  1. Thomas BraunOct 15, 2014
  2. Junio C HamanoOct 15, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.