Thread (1 message) 1 message, 1 author, 2023-12-03

Re: [PATCH v2] hooks--pre-commit: detect non-ASCII when renaming

From: Junio C Hamano <hidden>
Date: 2023-12-03 13:15:12

"Julian Prein via GitGitGadget" [off-list ref] writes:
From: Julian Prein <redacted>

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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help