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

Re: [PATCH 1/6] Add string comparison functions that respect the ignore_case variable.

From
Joshua Jensen <jjensen@workspacewhiz.com>
Date
Aug 30, 2010, 14:42 UTC
Message-ID
<4C7BC344.9020500@workspacewhiz.com>
In-Reply-To
<AANLkTimtmudtWccRS==LrO_JrPmAJ7HzA6CU0ALbDZcV@mail.gmail.com>
  ----- Original Message -----
From: Ævar Arnfjörð Bjarmason
Date: 8/29/2010 1:39 PM
Show 23 quoted lines
> On Wed, Aug 18, 2010 at 18:32, Johannes Sixt<j6t@kdbg.org>  wrote:
>> On Mittwoch, 18. August 2010, Ævar Arnfjörð Bjarmason wrote:
>>> According to some further research at least FreeBSD and NetBSD have
>>> copied this GNU extension. You may find their versions easier to
>>> integrate.
>> We already have a GNU fnmatch in compat/fnmatch.
> Do you have any plan to deal with this? I currently have this
> monkeypatch to build on Solaris:
>
>      diff --git a/Makefile b/Makefile
>      index 62d526a..079fae5 100644
>      --- a/Makefile
>      +++ b/Makefile
>      @@ -863,2 +863,4 @@ endif
>       ifeq ($(uname_S),SunOS)
>      +       COMPAT_OBJS = compat/fnmatch/fnmatch.o
>      +       COMPAT_CFLAGS = -Icompat -Icompat/fnmatch
>              NEEDS_SOCKET = YesPlease
>
> One way to deal with it would be a new NONGNU_FNMATCH=UnfortunatelyYes
> flag, or the fnmatch_icase() suggestion above which we could bundle
> and always use. But having next build on systems without GNU
> extensions would be preferrable.

I am going to deal with this, but I haven't been around. I hope for some time this week.

Short of duplicating fnmatch's code and renaming the function, I am not sure how to make this play nice on all systems. You added COMPAT_OBJS above, but I think there is no linker guarantee it will pick up compat/fnmatch/fnmatch.o over the C runtime version? Perhaps the makefile is architected to do so.

The safest alternative is to allocate character buffers, lowercase the filename and match arguments into those buffers, and pass them off to fnmatch without any special flags. I don't like the idea of a double memory allocation/free combo per each call to this function, but it would work. Is anyone opposed to this approach?

Josh
Previous: Ævar Arnfjörð BjarmasonNext: Ævar Arnfjörð Bjarmason
Message 10 of 26 in “Extensions of core.ignorecase=true support”
  1. 0/6 Extensions of core.ignorecase=true supportJohannes Sixt, Aug 16, 2010
  2. 1/6 Add string comparison functions that respect the ignore_case variable.Johannes Sixt, Aug 16, 2010
  3. Ævar Arnfjörð BjarmasonAug 18, 2010
  4. Ævar Arnfjörð BjarmasonAug 18, 2010
  5. Joshua JensenAug 18, 2010
  6. Ævar Arnfjörð BjarmasonAug 18, 2010
  7. Johannes SixtAug 18, 2010
  8. Ævar Arnfjörð BjarmasonAug 18, 2010
  9. Ævar Arnfjörð BjarmasonAug 29, 2010
  10. Joshua JensenAug 30, 2010
  11. Ævar Arnfjörð BjarmasonAug 30, 2010
  12. Jonathan NiederAug 30, 2010
  13. Jonathan NiederAug 30, 2010
  14. Johannes SixtAug 30, 2010
  15. Ævar Arnfjörð BjarmasonAug 30, 2010
  16. Johannes SixtAug 30, 2010
  17. 2/6 Case insensitivity support for .gitignore via core.ignorecaseJohannes Sixt, Aug 16, 2010
  18. 3/6 Add case insensitivity support for directories when using git statusJohannes Sixt, Aug 16, 2010
  19. 4/6 Add case insensitivity support when using git ls-filesJohannes Sixt, Aug 16, 2010
  20. 5/6 Support case folding for git add when core.ignorecase=trueJohannes Sixt, Aug 16, 2010
  21. 6/6 Support case folding in git fast-import when core.ignorecase=trueJohannes Sixt, Aug 16, 2010
  22. Robert BuckAug 17, 2010
  23. Johannes SixtAug 17, 2010
  24. Robert BuckAug 18, 2010
  25. Johannes SixtAug 18, 2010
  26. Junio C HamanoAug 22, 2010

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.