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

[PATCH 1/5] pathspec: mark wildcard pathspecs from the beginning

From
Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Date
Sep 19, 2010, 23:29 UTC
Message-ID
<1284939000-16907-2-git-send-email-pclouds@gmail.com>
In-Reply-To
<1284939000-16907-1-git-send-email-pclouds@gmail.com>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
 match_pathspec() should be converted to use this as well. Not now
 though.
 cache.h |    2 ++
 dir.c   |    7 ++++++-
 2 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/cache.h b/cache.h
index 045c9fc..7a3e0a0 100644
--- a/cache.h
+++ b/cache.h
@@ -495,8 +495,10 @@ extern int ie_modified(const struct index_state *, struct cache_entry *, struct
 struct pathspec {
 	const char **raw;
 	int nr;
+	int has_wildcard:1;
 	struct pathspec_item {
 		int len;
+		int has_wildcard:1;
 	} *items;
 };
 
diff --git a/dir.c b/dir.c
index 80b2df2..a44c7b3 100644
--- a/dir.c
+++ b/dir.c
@@ -1088,7 +1088,12 @@ int init_pathspec(struct pathspec *pathspec, const char **paths)
 
 	pathspec->items = xmalloc(sizeof(struct pathspec_item)*pathspec->nr);
 	for (i = 0; i < pathspec->nr; i++) {
-		pathspec->items[i].len = strlen(paths[i]);
+		struct pathspec_item *item = pathspec->items+i;
+
+		item->len = strlen(paths[i]);
+		item->has_wildcard = !no_wildcard(paths[i]);
+		if (item->has_wildcard)
+			pathspec->has_wildcard = 1;
 	}
 	return 0;
 }
-- 
1.7.1.rc1.70.g788ca
Previous: Nguyễn Thái Ngọc DuyNext: Nguyễn Thái Ngọc Duy
Message 2 of 9 in “Globbing support in diff family”
  1. 0/5 Globbing support in diff familyNguyễn Thái Ngọc Duy, Sep 19, 2010
  2. 1/5 pathspec: mark wildcard pathspecs from the beginningNguyễn Thái Ngọc Duy, Sep 19, 2010
  3. 2/5 pathspec: add tree_recursive_diff parameterNguyễn Thái Ngọc Duy, Sep 19, 2010
  4. Junio C HamanoSep 27, 2010
  5. Nguyen Thai Ngoc DuySep 28, 2010
  6. Junio C HamanoSep 28, 2010
  7. 3/5 tree_entry_interesting: turn to match_pathspec if wildcard is presentNguyễn Thái Ngọc Duy, Sep 19, 2010
  8. 4/5 Convert ce_path_match() to use struct pathspecNguyễn Thái Ngọc Duy, Sep 19, 2010
  9. 5/5 ce_path_match: drop prefix matching in favor of match_pathspecNguyễn Thái Ngọc Duy, Sep 19, 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.