Add case insensitive support in matching pathspec
PATCH 1/1 Add case insensitive support in matching pathspec
Commit 21444f1 (Add case insensitivity support when using git ls-files
- 2010-10-03) teaches match_pathspec() to ignore case when core.ignorecase=true.
match_pathspec_depth() is developed independently and does not have this feature. Teach it.
---
On top of nd/struct-pathspec, but requires jj/icase-directory. I can rebase the series on top of master if it causes too many conflicts.
dir.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
dir.c +2 -2
@@ -192,7 +192,7 @@ static int match_pathspec_item(const struct pathspec_item *item, int prefix,if (!*match)return MATCHED_RECURSIVELY ; -if (matchlen <= namelen && !strncmp (match, name, matchlen)) { +if (matchlen <= namelen && !strncmp_icase (match, name, matchlen)) {if (matchlen == namelen)return MATCHED_EXACTLY ;
@@ -200,7 +200,7 @@ static int match_pathspec_item(const struct pathspec_item *item, int prefix,return MATCHED_RECURSIVELY ; } -if (item->has_wildcard && !fnmatch (match, name,0 )) +if (item->has_wildcard && !fnmatch_icase (match, name,0 ))return MATCHED_FNMATCH ;return 0 ;
Signature · 1 line
1.7.2.2
Quoted 6 lines · Nguyễn Thái Ngọc Duy
Commit 21444f1 (Add case insensitivity support when using git ls-files
- 2010-10-03) teachesmatch_pathspec()to ignore case when core.ignorecase=true.
match_pathspec_depth()is developed independently and does not have this feature. Teach it.
Is match_pathspec_depth() used to match names of files on the filesystem, or names of files in the index or in the repository?
core.ignorecase should be honored only when files on the filesystem are matched, IMO.
-- Hannes
2011/2/4 Johannes Sixt <[email protected]>:
Quoted 5 lines · Nguyễn Thái Ngọc Duy
Quoted 4 lines
Commit 21444f1 (Add case insensitivity support when using git ls-files
- 2010-10-03) teachesmatch_pathspec()to ignore case when core.ignorecase=true.
Quoted 8 lines
Quoted 2 lines
match_pathspec_depth()is developed independently and does not have this feature. Teach it.Is
match_pathspec_depth()used to match names of files on the filesystem, or names of files in the index or in the repository?core.ignorecase should be honored only when files on the filesystem are matched, IMO.
Names in index, just as same as match_pathspec().
Signature · 1 line
Duy
Quoted 4 lines · Nguyen Thai Ngoc Duy
Quoted 2 lines
core.ignorecase should be honored only when files on the filesystem are matched, IMO.
Names in index, just as same as
match_pathspec().
If the matched entities are names in the index, they should already be canonical and we shouldn't be matching with icase, no?
Quoted 9 lines · Junio C Hamano
Quoted 4 lines · Nguyen Thai Ngoc Duy
Quoted 2 lines
core.ignorecase should be honored only when files on the filesystem are matched, IMO.
Names in index, just as same as
match_pathspec().If the matched entities are names in the index, they should already be canonical and we shouldn't be matching with icase, no?
The patterns are case-insensitive. The example given in 21444f is "git ls-files mydir" should also match MyDir/* in index. Although by modifying match_one(), it affects more than just git-ls-files. I'm not the original author, so Joshua, was that patch to fix git-ls-files only?
Signature · 1 line
Duy
Quoted 2 lines · Nguyễn Thái Ngọc Duy
On top of nd/struct-pathspec, but requires jj/icase-directory. I can rebase the series on top of master if it causes too many conflicts.
I am in the middle of rewinding 'next' and have already rebased the topic; I will queue the result in 'pu' so could you check the result when it is pushed out later?
2011/2/4 Junio C Hamano <[email protected]>:
Quoted 8 lines
Quoted 2 lines · Nguyễn Thái Ngọc Duy
On top of nd/struct-pathspec, but requires jj/icase-directory. I can rebase the series on top of master if it causes too many conflicts.
I am in the middle of rewinding 'next' and have already rebased the topic; I will queue the result in 'pu' so could you check the result when it is pushed out later?
Checked. Looks good to me.
Signature · 1 line
Duy