threads / patch / 63756

patchdoc: correct doc for glob pathspec

Subject: [PATCH 0/1] doc: correct doc for glob pathspec

## tl;dr

5 messages between Jul 8, 2025 and Jul 21, 2025. Diffs are folded; open one to read it.

replies: 4people: 3as markdown or json

Russell Hanneken· Jul 8, 2025, 02:45 UTC · lore

gitglossary(7) documents Git pathspecs, including "glob" pathspecs, prefixed by the magic word "glob". It states, incorrectly, that the glob pattern "**/foo" is equivalent to "foo".

I suspect this incorrect statement is the result of copying and pasting from gitignore(5).

This patch removes the incorrect statement.
Russell Hanneken (1):
  doc: correct doc for glob pathspec
 Documentation/glossary-content.adoc | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
base-commit: 16bd9f20a403117f2e0d9bcda6c6e621d3763e77
-- 
2.34.1
Russell Hanneken· Jul 8, 2025, 02:45 UTC · re: Russell Hanneken · lore

[PATCH 1/1] doc: correct doc for glob pathspec

gitglossary documents Git pathspecs. One type of pathspec is the "glob" pathspec, prefixed with the magic word "glob".

Regarding glob pathspecs, gitglossary says, '"**/foo" matches file or directory "foo" anywhere, the same as pattern "foo".' That last phrase ('the same as pattern "foo") is incorrect. "**/foo" and "foo" are not equivalent. "**/foo" matches foo anywhere, but "foo" does not.

This change removes the incorrect phrase from the glob pathspec doc.
Signed-off-by: Russell Hanneken <rhanneken@pobox.com>
---
 Documentation/glossary-content.adoc | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
Show changes to Documentation/glossary-content.adoc +2 −3
diff --git a/Documentation/glossary-content.adoc b/Documentation/glossary-content.adoc
index 575c18f776..e423e4765b 100644
--- a/Documentation/glossary-content.adoc
+++ b/Documentation/glossary-content.adoc
@@ -418,9 +418,8 @@ full pathname may have special meaning:
 
  - A leading "`**`" followed by a slash means match in all
    directories. For example, "`**/foo`" matches file or directory
-   "`foo`" anywhere, the same as pattern "`foo`". "`**/foo/bar`"
-   matches file or directory "`bar`" anywhere that is directly
-   under directory "`foo`".
+   "`foo`" anywhere. "`**/foo/bar`" matches file or directory "`bar`"
+   anywhere that is directly under directory "`foo`".
 
  - A trailing "`/**`" matches everything inside. For example,
    "`abc/**`" matches all files inside directory "abc", relative
-- 
2.34.1
Junio C Hamano· Jul 8, 2025, 05:04 UTC · re: Russell Hanneken · lore

Re: [PATCH 1/1] doc: correct doc for glob pathspec

Russell Hanneken <rhanneken@pobox.com> writes:
Show 7 quoted lines
>   - A leading "`**`" followed by a slash means match in all
>     directories. For example, "`**/foo`" matches file or directory
> -   "`foo`" anywhere, the same as pattern "`foo`". "`**/foo/bar`"
> -   matches file or directory "`bar`" anywhere that is directly
> -   under directory "`foo`".
> +   "`foo`" anywhere. "`**/foo/bar`" matches file or directory "`bar`"
> +   anywhere that is directly under directory "`foo`".

So, the change is that the explanation that the pattern `foo` would match the same as what `**/foo` matches, i.e. a file or directory whose name is `foo`, either at the top-level or in any subdirectory.

Sounds correct.
Will queue.  Thanks.
Russell Hanneken· Jul 10, 2025, 23:39 UTC · re: Junio C Hamano · lore

Re: [PATCH 1/1] doc: correct doc for glob pathspec

On Tue Jul 8, 2025 at 1:05 AM EDT, Junio C Hamano wrote:
>
> Will queue.  Thanks.

Was there something wrong with my patch? I haven't seen my change appear in the repository.

Regards,

Russell Hanneken rhanneken@pobox.com

Kristoffer Haugsbakk· Jul 21, 2025, 13:08 UTC · re: Russell Hanneken · lore

Re: [PATCH 1/1] doc: correct doc for glob pathspec

On Fri, Jul 11, 2025, at 01:39, Russell Hanneken wrote:
Show 6 quoted lines
> On Tue Jul 8, 2025 at 1:05 AM EDT, Junio C Hamano wrote:
>>
>> Will queue.  Thanks.
>
> Was there something wrong with my patch? I haven't seen my change appear
> in the repository.

See [here], `rh/doc-glob-pathspec-fix`. It’s currently on the `next` branch and will be merged to `master` next.

[here]: https://lore.kernel.org/git/xmqqo6ti49fk.fsf@gitster.g/

← back to recent threads