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

Re: [PATCH] Added support for core.ignorecase when excluding gitignore entries

From
Joshua Jensen <jjensen@workspacewhiz.com>
Date
Jul 21, 2009, 15:55 UTC
Message-ID
<4A65E4E5.3030709@workspacewhiz.com>
In-Reply-To
<20090720153737.GF5347@coredump.intra.peff.net>
----- Original Message -----
From: Jeff King
Date: 7/20/2009 9:37 AM
Show 17 quoted lines
>>> If your patch is the right route, it might be nice to collapse the
>>> comparison into its own function. You end up cutting and pasting a lot
>>> of the related conditionals and returns (like above, where 2 lines
>>> become 9), so it might make sense to do something like:
>>>
>>>  int filename_cmp(const char *a, const char *b, int ignore_case)
>>>  {
>>>    return ignore_case ? strcasecmp(a, b) : strcmp(a, b);
>>>  }
>>>
>>> and then just s/strcmp/filename_cmp/ at the appropriate callsites.
>>>       
> IMHO, you are better off even with three wrapper functions, just because
> they are all very straightforward. Whereas with your patch, I felt like
> the innards of complex functions got harder to read because of big
> duplicate conditionals. But that's just my two cents.
>   
I agree.  I will update the patch soon.
Josh
Previous: Jeff King
Message 5 of 5 in “Added support for core.ignorecase when excluding gitignore entries”
  1. Added support for core.ignorecase when excluding gitignore entriesJoshua Jensen, Jul 16, 2009
  2. Jeff KingJul 16, 2009
  3. Joshua JensenJul 16, 2009
  4. Jeff KingJul 20, 2009
  5. Joshua JensenJul 21, 2009

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.