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

Re: [BUG REPORT] File names that contain UTF8 characters are unnecessarily escaped in 'git status .' messages

From
Torsten Bögershausen <tboegi@web.de>
Date
May 29, 2021, 09:27 UTC
Message-ID
<20210529092752.kifzqt3haddzgsob@tb-raspi4>
In-Reply-To
<6fef4b1e-1ec7-b697-c311-59caf6408b29@rawbw.com>
On Thu, May 27, 2021 at 09:45:53PM -0700, Yuri wrote:
Show 7 quoted lines
> On 5/27/21 9:39 PM, Bagas Sanjaya wrote:
> > So the current default is only supports ASCII, and escape other
> > characters, right?
>
>
> It appears this way.
>
Yes, that is how it is.
After reading the wiki here:
https://wiki.gentoo.org/wiki/UTF-8
(There are many other web pages as well)

I am not sure that there is a reliable way for Git to detect, if the terminal is capable of handling UTF-8. This should work reliable under Linux, Windows, Mac and all the supported Unix-ish platforms.

Beside that, the outputs of git commands can be feed into other programs via a pipe usning "|" on the command line or redirectet to a file.

And what is a terminal ? We need to consider that we run programs like `less` or `more´ which need to be UTF-8 compatble.

Most of them are probably UTF-8 compliant (and LANG is set to xx.UTF-8) these days. And most repositories have been feed with filenames encoded in UTF-8 as well.

Having said that, the default could be switched some day in the future. Before that is "save", there may be a transition phase, where users are warned that the default may change. Scripts calling git need to use `git -c core.quotepath=yes`, or no, whatever input they expect.

Sorry for the longish answer. Changing one thing for some users may effect hundrets, thousands or millions of other users later, cause surprises, need debugging and fixing effort.

Does someone wants to come up with a patch that anounces a possible change ?
Previous: YuriNext: Jeff King
Message 9 of 14 in “[BUG REPORT] File names that contain UTF8 characters are unnecessarily escaped in 'git status .' messages”
  1. YuriMay 26, 2021
  2. Junio C HamanoMay 26, 2021
  3. YuriMay 26, 2021
  4. Torsten BögershausenMay 27, 2021
  5. Jeff KingMay 27, 2021
  6. YuriMay 27, 2021
  7. Bagas SanjayaMay 28, 2021
  8. YuriMay 28, 2021
  9. Torsten BögershausenMay 29, 2021
  10. Jeff KingMay 30, 2021
  11. YuriMay 30, 2021
  12. Thomas GuyotMay 31, 2021
  13. Bagas SanjayaMay 31, 2021
  14. Junio C HamanoMay 30, 2021

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.