Skip to content

Honor core.ignorecase for attribute patterns

Brandon Casey git 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 14 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4attr.c: avoid inappropriate access to strbuf "buf" memberattr.c+12 -130 replies
2/4cleanup: use internal memory allocation wrapper functions everywhereattr.c builtin/mv.c compat/mingw.c +5 more+9 -99 replies
3/4builtin/mv.c: plug miniscule memory leakbuiltin/mv.c+5 -10 replies
4/4attr.c: respect core.ignorecase when matching attribute patternsattr.c t/t0003-attributes.sh+63 -43 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/4] Honor core.ignorecase for attribute patterns
Quoted 10 lines · Brandon Casey
Quoted 9 lines · Jeff King
Quoted 6 lines · Brandon Casey

...and I see there is already an fnmatch_icase() in dir.c which adds FNM_CASEFOLD when the global var ignore_case is set. So, maybe it's as easy as:
[...]

(quoted diff) +1 -1
-               return (fnmatch(pattern, basename, 0) == 0);
+               return (fnmatch_icase(pattern, basename, 0) == 0);
Quoted 6 lines
Quoted 2 lines

OK, wow. That's exactly the level of easy I was hoping for. Do you want to roll that up into a patch with some tests?

I haven't even tested that it runs. :) No, I was hoping someone who was more interested would finish it, and maybe even test on an affected system.

Ok, I lied. Here's a series that needs testing by people on a case-insensitive filesystem and some comments.

The first three patches are just housekeeping and can be accepted independently of the fourth patch which is marked WIP.

The last patch implements the case-insensitive matching of attribute patterns, but I discovered that bad things can happen if git_config() is called more than once. Details are in the patch email.

-Brandon

[PATCH 1/4] attr.c: avoid inappropriate access to strbuf "buf" [PATCH 2/4] cleanup: use internal memory allocation wrapper [PATCH 3/4] builtin/mv.c: plug miniscule memory leak [PATCH 4/4] attr.c: respect core.ignorecase when matching attribute