Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it OK to use a long non-ascii name for the user.name Git configuration?

My full name is a bit long and contains a non-ascii character ã. I was wondering if I should use it in git config --global user.name or just keep it short (and what implications this decision would bring along).

In other words, are there any problems with using my full name (in terms of its length), along with the non-ascii character in it?

git config --global user.name "Hugo Leonardo Leão Mota"
like image 353
Hugo Mota Avatar asked Jul 19 '14 21:07

Hugo Mota


3 Answers

As mentioned in this thread, utf8 characters will work fine with a recent enough Git (since git 1.7.10).

After that, it is up to the tol you are using to be able to display that string correctly.
For instance, Qt Creator had to include a patch to display the author in UTF-8 encoding.

like image 173
VonC Avatar answered Sep 28 '22 08:09

VonC


Git, and tools that use Git, should support full-length names with Unicode characters. Although you may run into bugs with some tools, that's no reason to compromise how you sign your work.

A good way to see what's generally acceptable is to look at an existing project. In Git itself, for example:

git log --pretty=format:%an | sort -u | less

Specifically, checking for developers with a name longer than yours:

git log --pretty=format:%an | sort -u | egrep '.{25}'

shows seventeen longer names.

like image 24
Joe Avatar answered Sep 28 '22 07:09

Joe


I think it depends on your system. Sometimes this can be an issue, but it won't break anything - just display a funky symbol instead of the ã.

like image 38
hannahen Avatar answered Sep 28 '22 07:09

hannahen