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

Wrong gitattributes documentation?

From
RPRene Pasing <rene@pasing.net>
Date
Jun 2, 2017, 17:12 UTC
Message-ID
<e7734a23-12b2-8f62-ab5c-c856d59e3010@pasing.net>
Hi all,
I have noticed a strange behaviour when using git-lfs.

If I understood correctly, git-lfs adds patterns to .gitattributes, for which git then calls lfs for any matches with this pattern.

The problem is, the documentation[1] says: "The rules how the pattern matches paths are the same as in .gitignore files; see gitignore[5].", so when I have a pattern like '/images/', it should match on all files+folders under /images, even the directory itself, right? Or when I'd use '/images/*', it should match on all files+folders under /images, right?

This does not seem to be the case. Nothing is done by lfs when using '/images/', and when using '/images/*', it only takes into account files which are directly in /images (so it doesnt take into account subdirectories).

The only solution to this (until now) is to use '/images/**/*', which seems to do exactly what I want (lfs gets executed for all files+folders under /images).

Is this expected behaviour? If yes, then the documentation of gitattributes seems incorrect to me. If not, can this be considered as a bug?

I found several complaints about this to git-lfs (or other projects relying on gitattributes), e.g. [2], but I didn't find anything about this regarding gitattributes itself.

Thanks for answers Regards Rene

PS: $ git --version
git version 2.1.4

[1] = https://git-scm.com/docs/gitattributes [2] = https://github.com/git-lfs/git-lfs/issues/2068

Next: Junio C Hamano
Message 1 of 4 in “Wrong gitattributes documentation?”
  1. Rene PasingJun 2, 2017
  2. Junio C HamanoJun 3, 2017
  3. Rene PasingJun 3, 2017
  4. Rene PasingJun 3, 2017

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.