In pre-commit git hook, non-ascii filenames are checked unless `git config hooks.allownonascii` is "true". However, the comparison $allownonascii ne "true" is done without trailing newline, the hook always exists no matter what the value of hooks.allownonascii is. I don't intend to commit files with non-ascii filenames into the main repo, but we needed it in our local fork. Here's a suggested patch. --- a/.git-hooks/pre-commit +++ b/.git-hooks/pre-commit @@ -280,6 +280,7 @@ if ( system( "git rev-parse --verify HEAD >/dev/null 2>&1" ) == 0 ) # If you want to allow non-ascii filenames set this variable to true. my $allownonascii=`git config hooks.allownonascii`; +chomp $allownonascii; # Cross platform projects tend to avoid non-ascii filenames; prevent # them from being added to the repository. We exploit the fact that the
Thank you Shiro for the patch! So you've already retrieved sources, analyzed the pb and found the fix, what about submitting your patch on gerrit? Indeed, the 3 only remaining steps are: - provide license statement - create a gerrit account - submit your patch See https://wiki.documentfoundation.org/Development/GetInvolved If you can't or don't want to, at minimum provide license statement so we can submit the patch for you. Waiting for your feedback.
Done, done and done!
Thank you for your quick feedback! Considering https://gerrit.libreoffice.org/c/core/+/97213, let's assign this tracker to you then.
Shiro Kawai committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/d73776daa4a0e9397a9b86b5a250b210062fd760 tdf#134286: fix pre-commit hook to make hooks.allownonascii work It will be available in 7.1.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Closing