[Libreoffice-bugs] [Bug 134286] New: pre-commit check for allownonascii is incorrect

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Wed Jun 24 20:10:03 UTC 2020


https://bugs.documentfoundation.org/show_bug.cgi?id=134286

            Bug ID: 134286
           Summary: pre-commit check for allownonascii is incorrect
           Product: LibreOffice
           Version: 7.0.0.0.beta1+
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: trivial
          Priority: medium
         Component: LibreOffice
          Assignee: libreoffice-bugs at lists.freedesktop.org
          Reporter: shiro.kawai at gmail.com

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

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20200624/c6224904/attachment.htm>


More information about the Libreoffice-bugs mailing list