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

Re: [PATCH 3/3] Convert all fnmatch() calls to wildmatch()

From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
Date
Dec 20, 2012, 12:36 UTC
Message-ID
<CACsJy8B3jdE5h272d0-R-OUcS-Fput+7ADBT4UZEMf58b9=2eA@mail.gmail.com>
In-Reply-To
<7v8v8tanyn.fsf@alter.siamese.dyndns.org>
On Thu, Dec 20, 2012 at 1:36 AM, Junio C Hamano <gitster@pobox.com> wrote:
Show 13 quoted lines
>> @@ -627,7 +628,7 @@ enum interesting tree_entry_interesting(const struct name_entry *entry,
>>                               return entry_interesting;
>>
>>                       if (item->use_wildcard) {
>> -                             if (!fnmatch(match + baselen, entry->path, 0))
>> +                             if (!wildmatch(match + baselen, entry->path, 0))
>>                                       return entry_interesting;
>
> This and the change to dir.c obviously have interactions with
> 8c6abbc (pathspec: apply "*.c" optimization from exclude,
> 2012-11-24).
>
> I've already alluded to it in my response to 2/3, I guess.

Conflict of plans. I did not expect myself to work on replacing fnmatch soon and git_fnmatch is an intermediate step to collect more optimizations and gradually replace fnmatch. Eventually git_fnmatch() would become a wrapper of wildmatch, all the optimizations are pushed down there. If we replace fnmatch->wildmatch first then there's little reason for the existence of git_fnmatch(). Maybe I should merge this with the fnmatch elimination into a single series.

-- 
Duy
Previous: Junio C HamanoNext: Nguyen Thai Ngoc Duy
Message 10 of 11 in “Bye bye fnmatch()”
  1. 0/3 Bye bye fnmatch()Nguyễn Thái Ngọc Duy, Dec 19, 2012
  2. 1/3 wildmatch: make dowild() take arbitrary flagsNguyễn Thái Ngọc Duy, Dec 19, 2012
  3. Junio C HamanoDec 19, 2012
  4. 2/3 wildmatch: support "no FNM_PATHNAME" modeNguyễn Thái Ngọc Duy, Dec 19, 2012
  5. Junio C HamanoDec 19, 2012
  6. Nguyen Thai Ngoc DuyDec 20, 2012
  7. Nguyen Thai Ngoc DuyDec 20, 2012
  8. 3/3 Convert all fnmatch() calls to wildmatch()Nguyễn Thái Ngọc Duy, Dec 19, 2012
  9. Junio C HamanoDec 19, 2012
  10. Nguyen Thai Ngoc DuyDec 20, 2012
  11. Nguyen Thai Ngoc DuyDec 19, 2012

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.