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

gitattributesLarge: .gitattributes too large to parse

From
DSDanny Smit <danny.smit.0@gmail.com>
Date
Feb 28, 2023, 16:09 UTC
Message-ID
<CACoz=-x6kVGMq1oCq8-5k2Hb82DCqi94_EmX6w4_9uGXnwBLaQ@mail.gmail.com>
Hello everyone,

I'm running into a problem with git fsck and the .gitattributes file. With more recent git versions, it reports the following error on my bare git repository:

$ git --version git version 2.39.2

$ git -C bare_repo fsck Checking object directories: 100% (256/256), done. error in blob 70dc06c1e2e79d8cfa4fb67007edcbb8c941d7e0: gitattributesLarge: .gitattributes too large to parse error in blob 7f2a61db90e023cc2a3b180203b7298cd971250d: gitattributesLarge: .gitattributes too large to parse Checking objects: 100% (33216/33216), done. Verifying commits in commit graph: 100% (2024/2024), done.

The files seems to be around 1.5MB in size:

$ git -C bare_repo cat-file -s 70dc06c1e2e79d8cfa4fb67007edcbb8c941d7e0 1579407 $ git -C bare_repo cat-file -s 7f2a61db90e023cc2a3b180203b7298cd971250d 1579652

With a cloned repository, the error is not shown:

$ git -C cloned_repo fsck Checking object directories: 100% (256/256), done. Checking objects: 100% (33158/33158), done.

I couldn't find a lot of documentation about the size limitations of the .gitattributes file, but I did find the change that seems to have introduced it: https://github.com/git/git/commit/27ab4784d5c9e24345b9f5b443609cbe527c51f9 The change describes that the file needs to be smaller than 100MB, which it is.

Tested on archlinux (rolling release), but also with docker to quickly verify different versions with a completely clean git configuration: https://hub.docker.com/r/bitnami/git

The error seems to occur with git version 2.39.2 2.38.3, but not in 2.38.2.

Why is git showing this message if the file isn't too big? Is there a way to get rid of the message, without updating/deleting the file and having to rewrite the history in git?

Regards, Danny

Next: Taylor Blau
Message 1 of 4 in “gitattributesLarge: .gitattributes too large to parse”
  1. Danny SmitFeb 28, 2023
  2. Taylor BlauFeb 28, 2023
  3. Jeff KingFeb 28, 2023
  4. Danny SmitMar 1, 2023

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.