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

[RFD] git glossary: define pathspec

From
Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Date
Nov 29, 2010, 10:13 UTC
Message-ID
<1291025622-15335-1-git-send-email-pclouds@gmail.com>

As far as I know we have three lightly incompatible pathspec implementations:

1. match_pathspec() in dir.c
2. tree_interesting() in tree-walk.c
3. pathspec_matches() in builtin/grep.c

What I describe here is match_pathspec(). What I want is a single pathspec semantics that all three must follow. Or even better, all three will become a single impl.

We need to point the differences between the three and see how to unify them.

sure if #3 can do the same.

directories. Therefore "Documentation" can't match the directory, while Documentation/ can. This is no problem to #2. It can be solved with a similar approach to [1], although maybe we can just convert the index to tree-based structure.

Any other differences?
Also rewording my poor paragraph is welcome.
[1] http://article.gmane.org/gmane.comp.version-control.git/162267
---
 Documentation/glossary-content.txt |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/Documentation/glossary-content.txt b/Documentation/glossary-content.txt
index 1f029f8..22da1b1 100644
--- a/Documentation/glossary-content.txt
+++ b/Documentation/glossary-content.txt
@@ -278,6 +278,17 @@ This commit is referred to as a "merge commit", or sometimes just a
 	of the logical predecessor(s) in the line of development, i.e. its
 	parents.
 
+[[def_pathspec]]pathspec::
+	Pathspec in its simplest form is a literal path to address a
+	file or a blob.
+	Pathspec can end with a slash. Such pathspec is considered a
+	directory prefix and will match everything under matched
+	directory.
+	Pathspec can contain wildcards such as '*', '?'... Such
+	pathspecs, after being matched literally against the entire
+	path, will be matched against the entire path using
+	fnmatch(3).
+
 [[def_pickaxe]]pickaxe::
 	The term <<def_pickaxe,pickaxe>> refers to an option to the diffcore
 	routines that help select changes that add or delete a given text
-- 
1.7.3.2.316.gda8b3
Next: Nguyen Thai Ngoc Duy
Message 1 of 4 in “[RFD] git glossary: define pathspec”
  1. Nguyễn Thái Ngọc DuyNov 29, 2010
  2. Nguyen Thai Ngoc DuyNov 29, 2010
  3. Nguyen Thai Ngoc DuyNov 29, 2010
  4. Jonathan NiederNov 29, 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.