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

Issues with gitattributes pattern matching

From
Sebastian Schuberth <sschuberth@gmail.com>
Date
Dec 12, 2018, 08:23 UTC
Message-ID
<puqgen$t0m$1@blaine.gmane.org>
Hi,

after reading though [1] and [2] again, I believe a pattern in .gitattributes like

     */src/*/assets/**/*-expected-* text eol=lf
should match a committed file at
     reporter/src/funTest/assets/NPM-is-windows-1.0.2-expected-NOTICE

In other words, "**" should be able to match "nothing", but it doesn't seem to do in my case.

To cross-check, assuming that ls-files supports the same patterns, running
     git ls-files "*/src/*/assets/**/*-expected-*"
indeed does not list the committed file at
     reporter/src/funTest/assets/NPM-is-windows-1.0.2-expected-NOTICE

for me. Tested with Git 2.20 on Windows and Git 2.19.2 on Linux. Is it a documentation error or a bug in Git?

[1] https://git-scm.com/docs/gitattributes [2] https://git-scm.com/docs/gitignore#_pattern_format

-- 
Sebastian Schuberth
Message 1 of 1 in “Issues with gitattributes pattern matching”
  1. Sebastian SchuberthDec 12, 2018

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.