git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git log and utf-u in filenames

From
Jakub Narebski <jnareb@gmail.com>
Date
Sep 25, 2008, 23:11 UTC
Message-ID
<m3k5cz3jp4.fsf@localhost.localdomain>
In-Reply-To
<20080925215002.GA30810@kodama.kitenet.net>
Joey Hess <joey@kitenet.net> writes:
Show 10 quoted lines
> Git, particularly git-log seems to not display utf-8 characters in filenames,
> instead showing an escaped representation. On the other hand, commit messages,
> as git-log(1) notes, are assumed to be utf-8, and the same utf-8 character
> used in a commit message is not escaped, and displays ok.
> 
> Can anyone point me at the documentation for this utf-8 filename
> escaping, assuming it's not a bug? And did earlier versions of git
> (circa 2006) perhaps not do that escaping? I have code in ikiwiki
> that apparently used to work, but is certianly not working with
> current git, due to this escaping.

Err... it always worked like this, mainly I think to have 7bit safe patches for sending via email. Now in the time of 8bit transfer and using single utf-8 encoding instead of multitude of different filesystem encodings, you can set core.quotepath to false, although this would eliminate only octal escaping for >127 ASCII characters; TAB, CR etc. would still be quoted (and they have to be).

gitconfig(7):
  core.quotepath::
        The commands that output paths (e.g. 'ls-files',
        'diff'), when not given the `-z` option, will quote
        "unusual" characters in the pathname by enclosing the
        pathname in a double-quote pair and with backslashes the
        same way strings in C source code are quoted.  If this
        variable is set to false, the bytes higher than 0x80 are
        not quoted but output as verbatim.  Note that double
        quote, backslash and control characters are always
        quoted without `-z` regardless of the setting of this
        variable.
-- 
Jakub Narebski
Poland
ShadeHawk on #git
Previous: Jakub Narebski
Message 8 of 8 in “git log and utf-u in filenames”
  1. Joey HessSep 25, 2008
  2. Joey HessSep 25, 2008
  3. Jakub NarebskiSep 25, 2008
  4. Alex RiesenSep 26, 2008
  5. Jakub NarebskiSep 26, 2008
  6. Alex RiesenSep 26, 2008
  7. Jakub NarebskiSep 27, 2008
  8. Jakub NarebskiSep 25, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.