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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Junio C Hamano <gitster@xxxxxxxxx> writes:

> "Julian Prein via GitGitGadget" <gitgitgadget@xxxxxxxxx> writes:
>
>> From: Julian Prein <druckdev@xxxxxxxxxxxxxx>
>>
>> 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.



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux