{"thread":{"id":"26401","subject":"[PATCH] Add case insensitive support in matching pathspec","startedAt":"2011-02-03T16:38:26Z","lastAt":"2011-02-05T07:44:54Z","messageCount":7,"participants":["Nguyễn Thái Ngọc Duy","Johannes Sixt","Junio C Hamano","Nguyen Thai Ngoc Duy"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"160336","messageId":"1296751106-15316-1-git-send-email-pclouds@gmail.com","threadId":"26401","inReplyTo":null,"subject":"[PATCH] Add case insensitive support in matching pathspec","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2011-02-03T16:38:26Z","receivedAt":"2011-02-03T16:38:26Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Commit 21444f1 (Add case insensitivity support when using git ls-files\n- 2010-10-03) teaches match_pathspec() to ignore case when\ncore.ignorecase=true.\n\nmatch_pathspec_depth() is developed independently and does not have\nthis feature. Teach it.\n\nSigned-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n On top of nd/struct-pathspec, but requires jj/icase-directory. I can\n rebase the series on top of master if it causes too many conflicts.\n\n dir.c |    4 ++--\n 1 files changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/dir.c b/dir.c\nindex b1407a5..2597f81 100644\n--- a/dir.c\n+++ b/dir.c\n@@ -192,7 +192,7 @@ static int match_pathspec_item(const struct pathspec_item *item, int prefix,\n \tif (!*match)\n \t\treturn MATCHED_RECURSIVELY;\n \n-\tif (matchlen <= namelen && !strncmp(match, name, matchlen)) {\n+\tif (matchlen <= namelen && !strncmp_icase(match, name, matchlen)) {\n \t\tif (matchlen == namelen)\n \t\t\treturn MATCHED_EXACTLY;\n \n@@ -200,7 +200,7 @@ static int match_pathspec_item(const struct pathspec_item *item, int prefix,\n \t\t\treturn MATCHED_RECURSIVELY;\n \t}\n \n-\tif (item->has_wildcard && !fnmatch(match, name, 0))\n+\tif (item->has_wildcard && !fnmatch_icase(match, name, 0))\n \t\treturn MATCHED_FNMATCH;\n \n \treturn 0;\n-- \n1.7.2.2\n"},{"id":"160347","messageId":"201102032117.32745.j6t@kdbg.org","threadId":"26401","inReplyTo":"1296751106-15316-1-git-send-email-pclouds@gmail.com","subject":"Re: [PATCH] Add case insensitive support in matching pathspec","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2011-02-03T20:17:32Z","receivedAt":"2011-02-03T20:17:32Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"On Donnerstag, 3. Februar 2011, Nguyễn Thái Ngọc Duy wrote:\n> Commit 21444f1 (Add case insensitivity support when using git ls-files\n> - 2010-10-03) teaches match_pathspec() to ignore case when\n> core.ignorecase=true.\n>\n> match_pathspec_depth() is developed independently and does not have\n> this feature. Teach it.\n\nIs match_pathspec_depth() used to match names of files on the filesystem, or \nnames of files in the index or in the repository?\n\ncore.ignorecase should be honored only when files on the filesystem are \nmatched, IMO.\n\n-- Hannes\n"},{"id":"160358","messageId":"7vwrlgzryj.fsf@alter.siamese.dyndns.org","threadId":"26401","inReplyTo":"1296751106-15316-1-git-send-email-pclouds@gmail.com","subject":"Re: [PATCH] Add case insensitive support in matching pathspec","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-02-03T22:14:12Z","receivedAt":"2011-02-03T22:14:12Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Nguyễn Thái Ngọc Duy  <pclouds@gmail.com> writes:\n\n>  On top of nd/struct-pathspec, but requires jj/icase-directory. I can\n>  rebase the series on top of master if it causes too many conflicts.\n\nI am in the middle of rewinding 'next' and have already rebased the topic;\nI will queue the result in 'pu' so could you check the result when it is\npushed out later?\n"},{"id":"160394","messageId":"AANLkTi=8-NibvV0NMCpA_KN6+x3GNa0mDr87jtWki_-S@mail.gmail.com","threadId":"26401","inReplyTo":"201102032117.32745.j6t@kdbg.org","subject":"Re: [PATCH] Add case insensitive support in matching pathspec","fromName":"Nguyen Thai Ngoc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2011-02-04T13:00:17Z","receivedAt":"2011-02-04T13:00:17Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"2011/2/4 Johannes Sixt <j6t@kdbg.org>:\n> On Donnerstag, 3. Februar 2011, Nguyễn Thái Ngọc Duy wrote:\n>> Commit 21444f1 (Add case insensitivity support when using git ls-files\n>> - 2010-10-03) teaches match_pathspec() to ignore case when\n>> core.ignorecase=true.\n>>\n>> match_pathspec_depth() is developed independently and does not have\n>> this feature. Teach it.\n>\n> Is match_pathspec_depth() used to match names of files on the filesystem, or\n> names of files in the index or in the repository?\n>\n> core.ignorecase should be honored only when files on the filesystem are\n> matched, IMO.\n\nNames in index, just as same as match_pathspec().\n-- \nDuy\n"},{"id":"160415","messageId":"7vei7nxuw5.fsf@alter.siamese.dyndns.org","threadId":"26401","inReplyTo":"AANLkTi=8-NibvV0NMCpA_KN6+x3GNa0mDr87jtWki_-S@mail.gmail.com","subject":"Re: [PATCH] Add case insensitive support in matching pathspec","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-02-04T23:06:02Z","receivedAt":"2011-02-04T23:06:02Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Nguyen Thai Ngoc Duy <pclouds@gmail.com> writes:\n\n>> core.ignorecase should be honored only when files on the filesystem are\n>> matched, IMO.\n>\n> Names in index, just as same as match_pathspec().\n\nIf the matched entities are names in the index, they should already be\ncanonical and we shouldn't be matching with icase, no?\n"},{"id":"160424","messageId":"AANLkTi=5j1kjAjY6ek6YXTs24DO9J7X0QQjTB4qrZ_g3@mail.gmail.com","threadId":"26401","inReplyTo":"7vei7nxuw5.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] Add case insensitive support in matching pathspec","fromName":"Nguyen Thai Ngoc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2011-02-05T04:14:58Z","receivedAt":"2011-02-05T04:14:58Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Sat, Feb 5, 2011 at 6:06 AM, Junio C Hamano <gitster@pobox.com> wrote:\n> Nguyen Thai Ngoc Duy <pclouds@gmail.com> writes:\n>\n>>> core.ignorecase should be honored only when files on the filesystem are\n>>> matched, IMO.\n>>\n>> Names in index, just as same as match_pathspec().\n>\n> If the matched entities are names in the index, they should already be\n> canonical and we shouldn't be matching with icase, no?\n\nThe patterns are case-insensitive. The example given in 21444f is \"git\nls-files mydir\" should also match MyDir/* in index. Although by\nmodifying match_one(), it affects more than just git-ls-files. I'm not\nthe original author, so Joshua, was that patch to fix git-ls-files\nonly?\n-- \nDuy\n"},{"id":"160428","messageId":"AANLkTi=F3KYEJK6UuvUvqmwEx7kiyd_WP20rUvir2K=b@mail.gmail.com","threadId":"26401","inReplyTo":"7vwrlgzryj.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] Add case insensitive support in matching pathspec","fromName":"Nguyen Thai Ngoc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2011-02-05T07:44:54Z","receivedAt":"2011-02-05T07:44:54Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"2011/2/4 Junio C Hamano <gitster@pobox.com>:\n> Nguyễn Thái Ngọc Duy  <pclouds@gmail.com> writes:\n>\n>>  On top of nd/struct-pathspec, but requires jj/icase-directory. I can\n>>  rebase the series on top of master if it causes too many conflicts.\n>\n> I am in the middle of rewinding 'next' and have already rebased the topic;\n> I will queue the result in 'pu' so could you check the result when it is\n> pushed out later?\n\nChecked. Looks good to me.\n-- \nDuy\n"}]}