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

[PATCH 0/4] .git{ignore,attributes} directories?

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 18, 2024, 23:44 UTC
Message-ID
<20240618234436.4107855-1-gitster@pobox.com>
In-Reply-To
<20240618233303.GA188880@coredump.intra.peff.net>

We seem to blindly open .gitignore that is a directory and rely on subsequent read() to be more-or-less silent to implement a "non-file .gitignore is silently ignored" behaviour.

Let's be a bit more strict in detecting and reporting I/O errors, and also stop reading from directories.

I think the first three are reasonable changes, but the last one is of dubious value.

Junio C Hamano (4):
  .gitignore: introduce GITIGNORE_FILE CPP macro
  attr: notice and report read failure
  exclude: notice and report read failure of .gitignore files
  submodule: ignore .gitmodules that is not a regular file
 attr.c                | 10 +++++++++-
 builtin/read-tree.c   |  3 ++-
 dir.c                 | 16 ++++++++++++++--
 dir.h                 |  1 +
 environment.h         |  1 +
 submodule-config.c    |  2 +-
 t/t0003-attributes.sh |  9 +++++++++
 t/t0008-ignores.sh    | 18 ++++++++++++++++++
 8 files changed, 55 insertions(+), 5 deletions(-)
-- 
2.45.2-711-gd2c001ca14
Previous: Jeff KingNext: Junio C Hamano
Message 8 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.