From: Junio C Hamano <gitster@pobox.com>
To: Alexey Pelykh <alexey.pelykh@gmail.com>
Cc: Jeff King <peff@peff.net>, git@vger.kernel.org
Subject: Re: Non-blob .gitmodules and .gitattributes
Date: Tue, 18 Jun 2024 13:14:57 -0700 [thread overview]
Message-ID: <xmqqa5jiypmm.fsf@gitster.g> (raw)
In-Reply-To: <14349714-F8D1-4F7B-BB13-4FA39C6819DE@gmail.com> (Alexey Pelykh's message of "Tue, 18 Jun 2024 21:07:24 +0200")
Alexey Pelykh <alexey.pelykh@gmail.com> writes:
>> But I'd also suspect that other non-POSIX platforms would see the error
>> at open(), and _would_ actually produce an error message. I seem to
>> recall running into this before with Windows, maybe?
>
> Is there an easy way to verify "what on Windows" part? I'd be happy to
> help, yet I'm not sure I got it right what to look for.
Create a .gitmodules and .gitattributes directory, "git add" it, and
perform various operations that want to read them, probably. Even a
simple "git diff" should try to consult the attribute system (e.g.
because it wants to know if a path needs use custom function header
regexp pattern). As Peff said, on Linux and probably on macOS, we
will silently ignore such .gitattributes and that is what we want.
On Windows we may see "cannot open" error reported and visible to
the users.
> Surely, reserved names are reserved for some reason. If there's a legit
> reason alike cost-to-support, having an objection would be dumb. Yet
> if supporting would turn out to be of an effort alike dropping the check
> then it would seem having that check brings no value.
>
> With that said, if those are reserved names, why .gitignore is not reserved?
> For consistency at least.
We do not bother with ".gitignore" since we see no security
implications in that file. But other two whose name begin with
".git" do have some security implications (actually .gitattributes
is designed not to have any, but .gitmodules certainly does), so
we choose to inspect their sizes, contents, and types.
But that raises a few more questions.
What to do about our future needs that may conflict the needs of
users who want to use names of their choice? If we declare that
any name that begin with ".git" is reserved, there will be fewer
issues, but do we want to and can we afford to?
Also what if we later find security implications in ".gitignore"
files and decide to inspect their sizes, contents, and types? The
current system not issuing a warning does not give users any
guarantee that the future systems won't (even though we try hard to
avoid introducing such backward incompatible changes, we are human,
too, and we sometimes screw up).
Thanks.
next prev parent reply other threads:[~2024-06-18 20:15 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-14 12:03 Non-blob .gitmodules and .gitattributes Alexey Pelykh
2024-06-14 15:35 ` Junio C Hamano
2024-06-14 15:43 ` Alexey Pelykh
2024-06-18 18:31 ` Jeff King
2024-06-18 19:07 ` Alexey Pelykh
2024-06-18 20:14 ` Junio C Hamano [this message]
2024-06-18 23:33 ` Jeff King
2024-06-18 23:44 ` [PATCH 0/4] .git{ignore,attributes} directories? Junio C Hamano
2024-06-18 23:44 ` [PATCH 1/4] .gitignore: introduce GITIGNORE_FILE CPP macro Junio C Hamano
2024-06-18 23:44 ` [PATCH 2/4] attr: notice and report read failure of .gitattributes files Junio C Hamano
2024-06-19 0:21 ` Eric Sunshine
2024-06-19 1:18 ` Junio C Hamano
2024-06-19 2:35 ` Eric Sunshine
2024-06-19 13:57 ` Jeff King
2024-06-20 16:20 ` Junio C Hamano
2024-06-18 23:44 ` [PATCH 3/4] exclude: notice and report read failure of .gitignore files Junio C Hamano
2024-06-18 23:44 ` [PATCH 4/4] submodule: ignore .gitmodules that is not a regular file Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqa5jiypmm.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=alexey.pelykh@gmail.com \
--cc=git@vger.kernel.org \
--cc=peff@peff.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).