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

Non-blob .gitmodules and .gitattributes

From
Alexey Pelykh <alexey.pelykh@gmail.com>
Date
Jun 14, 2024, 12:03 UTC
Message-ID
<4F3AD9A8-DA3E-43E2-BF9A-9D7458EED7EA@gmail.com>
Greetings to all!
I've stumbled upon a check that ensures that .gitmodules and .gitattributes must be blobs, yet while I get why they should not be e.g. a symlink, what's the downside of permitting (and ignoring for the actual purpose) e.g. .gitattributes folder?
To better understand my use-case:

$ ls -lA dev/shared total 8 drwxr-xr-x 3 alexey-pelykh staff 96 Jun 14 11:53 .editorconfig drwxr-xr-x 3 alexey-pelykh staff 96 Jun 14 13:32 .gitattributes drwxr-xr-x 14 alexey-pelykh staff 448 Jun 14 11:53 .gitignore -rwxr-xr-x 1 alexey-pelykh staff 613 Jun 14 13:33 share

and

$ ls -lA dev/shared/.* dev/shared/.editorconfig: total 8 -rw-r--r-- 1 alexey-pelykh staff 377 Jun 14 11:53 shared.editorconfig

dev/shared/.gitattributes: total 8 -rw-r--r-- 1 alexey-pelykh staff 143 Jun 14 13:32 shared.gitattributes

dev/shared/.gitignore: total 8 -rw-r--r-- 1 alexey-pelykh staff 4450 Jun 14 11:53 shared.gitignore

Surely, the immediate workaround is use a "_gitattributes" or ".gitattributes_" name for the folder, yet if a directory with .gitignore can exist - why can't .gitmodule or .gitattributes?

Be well, Alexey

Next: Junio C Hamano
Message 1 of 17 in “Non-blob .gitmodules and .gitattributes”
  1. Alexey PelykhJun 14, 2024
  2. Junio C HamanoJun 14, 2024
  3. Alexey PelykhJun 14, 2024
  4. Jeff KingJun 18, 2024
  5. Alexey PelykhJun 18, 2024
  6. Junio C HamanoJun 18, 2024
  7. Jeff KingJun 18, 2024
  8. 0/4 .git{ignore,attributes} directories?Junio C Hamano, Jun 18, 2024
  9. 1/4 .gitignore: introduce GITIGNORE_FILE CPP macroJunio C Hamano, Jun 18, 2024
  10. 2/4 attr: notice and report read failure of .gitattributes filesJunio C Hamano, Jun 18, 2024
  11. Eric SunshineJun 19, 2024
  12. Junio C HamanoJun 19, 2024
  13. Eric SunshineJun 19, 2024
  14. Jeff KingJun 19, 2024
  15. Junio C HamanoJun 20, 2024
  16. 4/4 submodule: ignore .gitmodules that is not a regular fileJunio C Hamano, Jun 18, 2024
  17. 3/4 exclude: notice and report read failure of .gitignore filesJunio C Hamano, Jun 18, 2024

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.