Re: [PATCH v2] hooks--pre-commit: detect non-ASCII when renaming
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Dec 3, 2023, 13:15 UTC
- Message-ID
- <xmqqplzn4eci.fsf@gitster.g>
- In-Reply-To
- <pull.1291.v2.git.git.1701360836307.gitgitgadget@gmail.com>
"Julian Prein via GitGitGadget" <gitgitgadget@gmail.com> writes:
Show 8 quoted lines
> From: Julian Prein <druckdev@protonmail.com> > > When diff.renames is turned on, the diff-filter will not return renamed > files (or copied ones with diff.renames=copy) and potential non-ASCII > characters would not be caught by this hook. > > Use the plumbing command diff-index instead of the porcelain one to not > be affected by diff.rename.
Makes sense.
An obvious alternative would be to pass "--no-renames" and keep using the Porcelain "git diff", but this is how the plumbing "diff-index" and friends are meant to be used. Looking good.
Will queue. Thanks.