From: Junio C Hamano <gitster@pobox.com>
To: "Julian Prein via GitGitGadget" <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org, Julian Prein <druckdev@protonmail.com>
Subject: Re: [PATCH] hooks--pre-commit: detect non-ASCII when renaming
Date: Thu, 14 Jul 2022 16:08:20 -0700 [thread overview]
Message-ID: <xmqqa69b2syj.fsf@gitster.g> (raw)
In-Reply-To: <xmqqedyn2t6e.fsf@gitster.g> (Junio C. Hamano's message of "Thu, 14 Jul 2022 16:03:37 -0700")
Junio C Hamano <gitster@pobox.com> writes:
> "Julian Prein via GitGitGadget" <gitgitgadget@gmail.com> writes:
>
>> From: Julian Prein <druckdev@protonmail.com>
>>
>> Currently the diff-filter that is used to check for non-ASCII characters
>> in filenames only checks new additions.
>>
>> Extend the diff-filter in the pre-commit sample to include `CR` as well.
>> This way non-ASCII character in filenames are detected on a rename/copy
>> as well.
>
> It would probably be a better implementation to disable the rename
> detection, instead of adding Copies and Renames.
That is ...
>> - test $(git diff --cached --name-only --diff-filter=A -z $against |
... instead of using the "git diff" Porcelain, we can probably use
the "git diff-index" plumbing command here, which will not be
affected by end-user configuration or by the fact that recent "git
diff" turns on the rename detection by default.
next prev parent reply other threads:[~2022-07-14 23:08 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-14 22:17 [PATCH] hooks--pre-commit: detect non-ASCII when renaming Julian Prein via GitGitGadget
2022-07-14 23:03 ` Junio C Hamano
2022-07-14 23:08 ` Junio C Hamano [this message]
2023-11-30 16:13 ` [PATCH v2] " Julian Prein via GitGitGadget
2023-12-03 13:15 ` 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=xmqqa69b2syj.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=druckdev@protonmail.com \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
/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).