Re: [PATCH] ci: disallow directional formatting
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Nov 3, 2021, 17:20 UTC
- Message-ID
- <xmqq35od88bh.fsf@gitster.g>
- In-Reply-To
- <YYFdu/+j8ba+hjCF@nand.local>
Taylor Blau <me@ttaylorr.com> writes:
Show 14 quoted lines
> On Tue, Nov 02, 2021 at 04:01:57PM +0100, Ævar Arnfjörð Bjarmason wrote: >> There's a parallel discussion about doing something to detect this in >> "git am", which for the git project seems like a better place to put >> this. > > I don't think that one impacts the other necessarily. Having `git am` > guard against this would probably be sufficient to protect Junio > accidentally apply something containing directional formatting to his > tree unknowingly. > > But the idea that we rely on the import mechanism to protect against > this doesn't sit well with me. Ultimately, we should be relying on a > static check like below to ensure that directional formatting hasn't > entered the tree by any mechanism (not just 'git am').
Yes. Quite honestly, such a check shouldn't be in "am" proper at all.
Rather, for am users who care, they should protect themselves with something like the pre-applypatch hook, which can perform the same check as their pre-commit hook to protect their other commits.