Re: [PATCH] Extend sample pre-commit hook to check for non ascii file/usernames
- From
Jakub Narebski <jnareb@gmail.com>
- Date
- May 12, 2009, 21:55 UTC
- Message-ID
- <200905122356.00659.jnareb@gmail.com>
- In-Reply-To
- <20090512214250.GA22974@macbook.lan>
On Tue, 12 May 2009, Heiko Voigt wrote:
> At the moment non-ascii encodings of file/usernames are not very well > supported by git. This will most likely change in the future but to > allow repositories to be portable among different file/operating systems > this check is enabled by default.
Show 11 quoted lines
> + # non-ascii username issue a warning in git gui so tell the > + # user to change it > + if ! git config user.name | is_ascii; then > + echo "Please only use ascii characters in your username!" > + exit 1 > + fi > + > + if ! git config user.email | is_ascii; then > + echo "Please only use ascii characters in your email!" > + exit 1 > + fi
Actually 1.) there is no easy way to avoid non-ASCII names at least in user.name (I think they are not allowed in email), but 2.) there is no trouble with non-ASCII encoding of commits, as they have 'encoding' header if it is not uft-8 (see *encoding* config variables).
-- Jakub Narebski Poland