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

[PATCH/WIP 10/10] Enable ls-files and ls-tree for testing PATHSPEC_ICASE

From
Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Date
Jan 13, 2013, 12:49 UTC
Message-ID
<1358081379-17752-11-git-send-email-pclouds@gmail.com>
In-Reply-To
<1358081379-17752-1-git-send-email-pclouds@gmail.com>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
 builtin/add.c      | 6 ++++--
 builtin/ls-files.c | 3 ++-
 builtin/ls-tree.c  | 3 ++-
 3 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/builtin/add.c b/builtin/add.c
index a3ffa9d..b9a5432 100644
--- a/builtin/add.c
+++ b/builtin/add.c
@@ -421,12 +421,14 @@ int cmd_add(int argc, const char **argv, const char *prefix)
 		GUARD_PATHSPEC(&pathspec,
 			       PATHSPEC_FROMTOP |
 			       PATHSPEC_LITERAL |
-			       PATHSPEC_GLOB);
+			       PATHSPEC_GLOB |
+			       PATHSPEC_ICASE);
 
 		for (i = 0; i < pathspec.nr; i++) {
 			const char *path = pathspec.items[i].match;
 			if (!seen[i] &&
-			    ((pathspec.items[i].magic & PATHSPEC_GLOB) ||
+			    ((pathspec.items[i].magic &
+			      (PATHSPEC_GLOB | PATHSPEC_ICASE)) ||
 			     !file_exists(path))) {
 				if (ignore_missing) {
 					int dtype = DT_UNKNOWN;
diff --git a/builtin/ls-files.c b/builtin/ls-files.c
index feb4220..53b222d 100644
--- a/builtin/ls-files.c
+++ b/builtin/ls-files.c
@@ -538,7 +538,8 @@ int cmd_ls_files(int argc, const char **argv, const char *cmd_prefix)
 	parse_pathspec(&pathspec,
 		       PATHSPEC_FROMTOP |
 		       PATHSPEC_LITERAL |
-		       PATHSPEC_GLOB,
+		       PATHSPEC_GLOB |
+		       PATHSPEC_ICASE,
 		       PATHSPEC_STRIP_SUBMODULE_SLASH_CHEAP,
 		       prefix, argv);
 
diff --git a/builtin/ls-tree.c b/builtin/ls-tree.c
index 25d0590..cf943dd 100644
--- a/builtin/ls-tree.c
+++ b/builtin/ls-tree.c
@@ -175,7 +175,8 @@ int cmd_ls_tree(int argc, const char **argv, const char *prefix)
 	parse_pathspec(&pathspec,
 		       PATHSPEC_FROMTOP |
 		       PATHSPEC_LITERAL |
-		       PATHSPEC_GLOB,
+		       PATHSPEC_GLOB |
+		       PATHSPEC_ICASE,
 		       0, prefix, argv + 1);
 	for (i = 0; i < pathspec.nr; i++)
 		pathspec.items[i].nowildcard_len = pathspec.items[i].len;
-- 
1.8.0.rc2.23.g1fb49df
Previous: Nguyễn Thái Ngọc Duy
Message 11 of 11 in “Fancy pathspec stuff”
  1. 00/10 Fancy pathspec stuffNguyễn Thái Ngọc Duy, Jan 13, 2013
  2. 01/10 pathspec: allow to use alternate char for quoting long magic mnemonicNguyễn Thái Ngọc Duy, Jan 13, 2013
  3. 02/10 parse_pathspec: make sure the prefix part is wildcard-freeNguyễn Thái Ngọc Duy, Jan 13, 2013
  4. 03/10 pathspec: support :(literal) syntax for noglob pathspecNguyễn Thái Ngọc Duy, Jan 13, 2013
  5. 04/10 parse_pathspec: save prefix informationNguyễn Thái Ngọc Duy, Jan 13, 2013
  6. 05/10 pathspec: prepare for :(glob)path syntaxNguyễn Thái Ngọc Duy, Jan 13, 2013
  7. 06/10 Enable :(glob)path syntax for a lot of commandsNguyễn Thái Ngọc Duy, Jan 13, 2013
  8. 07/10 parse_pathspec: accept :(icase)path syntaxNguyễn Thái Ngọc Duy, Jan 13, 2013
  9. 08/10 common_prefix/read_directory: treat PATHSPEC_ICASE like wildcardsNguyễn Thái Ngọc Duy, Jan 13, 2013
  10. 09/10 pathspec: support icase in match_pathspec_depth and tree_entry_interestingNguyễn Thái Ngọc Duy, Jan 13, 2013
  11. 10/10 Enable ls-files and ls-tree for testing PATHSPEC_ICASENguyễn Thái Ngọc Duy, Jan 13, 2013

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.