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

[PATCH] doc: ls-tree paths do not support wildcards

From
SGSteven Willis via GitGitGadget <gitgitgadget@gmail.com>
Date
May 28, 2020, 21:23 UTC
Message-ID
<pull.796.git.git.1590700996483.gitgitgadget@gmail.com>
From: Steven Willis <onlynone@gmail.com>
Signed-off-by: Steven Willis <onlynone@gmail.com>
---
    doc: ls-tree paths do not support wildcards
    
    The documentation for ls-tree says that paths can be wildcards, but this
    appears to be incorrect, only raw paths seem to work.
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-796%2Fonlynone%2Fls-tree-paths-do-not-support-wildcards-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-796/onlynone/ls-tree-paths-do-not-support-wildcards-v1
Pull-Request: https://github.com/git/git/pull/796
 Documentation/git-ls-tree.txt | 6 +++---
 t/t3102-ls-tree-wildcards.sh  | 6 ++++++
 2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/Documentation/git-ls-tree.txt b/Documentation/git-ls-tree.txt
index a7515714da1..8a8ce20cf51 100644
--- a/Documentation/git-ls-tree.txt
+++ b/Documentation/git-ls-tree.txt
@@ -19,7 +19,7 @@ Lists the contents of a given tree object, like what "/bin/ls -a" does
 in the current working directory.  Note that:
 
  - the behaviour is slightly different from that of "/bin/ls" in that the
-   '<path>' denotes just a list of patterns to match, e.g. so specifying
+   '<path>' denotes just a list of files to match, e.g. so specifying
    directory name (without `-r`) will behave differently, and order of the
    arguments does not matter.
 
@@ -74,8 +74,8 @@ OPTIONS
 	Implies --full-name.
 
 [<path>...]::
-	When paths are given, show them (note that this isn't really raw
-	pathnames, but rather a list of patterns to match).  Otherwise
+	When paths are given, show them (note that this is really raw
+	pathnames, not a list of patterns to match).  Otherwise
 	implicitly uses the root level of the tree as the sole path argument.
 
 
diff --git a/t/t3102-ls-tree-wildcards.sh b/t/t3102-ls-tree-wildcards.sh
index 1e16c6b8ea6..6c0f2af1d04 100755
--- a/t/t3102-ls-tree-wildcards.sh
+++ b/t/t3102-ls-tree-wildcards.sh
@@ -33,4 +33,10 @@ test_expect_failure 'ls-tree does not yet support negated pathspec' '
 	test_cmp expect actual
 '
 
+test_expect_failure 'ls-tree does not yet support wildcard pathspec' '
+	git ls-files "a*" >expect &&
+	git ls-tree --name-only -r HEAD "a*" >actual &&
+	test_cmp expect actual
+'
+
 test_done

base-commit: 2d5e9f31ac46017895ce6a183467037d29ceb9d3
-- 
gitgitgadget
Next: Jeff King
Message 1 of 7 in “doc: ls-tree paths do not support wildcards”
  1. doc: ls-tree paths do not support wildcardsSteven Willis via GitGitGadget, May 28, 2020
  2. Jeff KingMay 28, 2020
  3. Junio C HamanoMay 28, 2020
  4. Jeff KingMay 28, 2020
  5. Junio C HamanoMay 28, 2020
  6. Junio C HamanoMay 28, 2020
  7. Jeff KingMay 28, 2020

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.