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

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.
Previous: Julian Prein via GitGitGadget
Message 5 of 5 in “hooks--pre-commit: detect non-ASCII when renaming”
  1. hooks--pre-commit: detect non-ASCII when renamingJulian Prein via GitGitGadget, Jul 14, 2022
  2. Junio C HamanoJul 14, 2022
  3. Junio C HamanoJul 14, 2022
  4. hooks--pre-commit: detect non-ASCII when renamingJulian Prein via GitGitGadget, Nov 30, 2023
  5. Junio C HamanoDec 3, 2023

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.