Johannes Schindelin <Johannes.Schindelin@xxxxxx> writes: > Hi, > > [somehow I got the impression your mail did not make it to the list] > > On Wed, 13 Jun 2007, David Kastrup wrote: > >> Johannes Schindelin <Johannes.Schindelin@xxxxxx> writes: >> >> > On Wed, 13 Jun 2007, David Kastrup wrote: >> > >> >> what is the point in quoting file names and their characters in >> >> git-diff's output? And what is the recommended way of undoing the >> >> damage? >> > >> > The recommended way is not using spaces to begin with. >> >> Who is talking about spaces? > > That is the common reason for quoting. I mean, really, how many files do > you have which contain newlines or backslashes or tabs? Huh? I am talking about non-ASCII characters. > >> > I mean, does "David" contain spaces? >> >> "Günter" contains non-ASCII characters. > > And "Guenther" (sorry, have problems with my mailer, so I simulate > it in plain ASCII" does not need quotes, _even_ if containing > non-ASCII characters. > > So what exactly was your point again? You _are_ aware that git writes out \303\274 (8 characters: 2 backslashes and 6 digits) instead of ü in a file name? And I am talking about a pure utf-8 locale. LANG=en_US.UTF-8 LC_CTYPE="en_US.UTF-8" LC_NUMERIC="en_US.UTF-8" LC_TIME="en_US.UTF-8" LC_COLLATE="en_US.UTF-8" LC_MONETARY="en_US.UTF-8" LC_MESSAGES="en_US.UTF-8" LC_PAPER="en_US.UTF-8" LC_NAME="en_US.UTF-8" LC_ADDRESS="en_US.UTF-8" LC_TELEPHONE="en_US.UTF-8" LC_MEASUREMENT="en_US.UTF-8" LC_IDENTIFICATION="en_US.UTF-8" LC_ALL= My point was that these octal escape sequences are utterly pointless. >> > People seem not to see the problem, and fail to blame Microsoft for >> > all the damage they have done, introducing that stupid, stupid concept >> > of filenames containing spaces, and _enforcing_ it. >> >> The concept of UNIX file names is _any_ byte sequence not >> containing "/" or an ASCII NUL. Microsoft actually prohibits quite >> a few more characters. Filenames with spaces first came into >> serious use under MacOS, the first graphical user interface where >> no shell and metacharacters interfered with the choice of file >> names. >> >> Blaming Microsoft here is completely ridiculous. > > It is completely unridiculous. Before Microsoft -- in its infinite > wisdom -- decided to create folders like "Program Files", and > "Documents and Settings", and made it the _default_ (of all things) > to save its ridiculous Word documents as "New Document", _nobody_ on > this planet even _thought_ about including stupid whitespace in a > filename. > > You can tell that this is true by looking at now-ancient Unix > scripts. You are making a spectacle of yourself. Do you even read what you are replying to? When spaces became commonplace in _MacOS_, _MacOS_ was by no means Unix-based. Microsoft only followed the trend (with a delay of several years, by the way) when imitating the MacOS GUI. >> >> I have something like >> >> >> >> git-diff -M -C --name-status -r master^ master | { >> >> while read -r flag name >> >> do >> >> case "$name" in *\\[0-3][0-7][0-7]*) >> >> name=$(echo -e $(echo "$name"|sed 's/\\\([0-3][0-7][0-7]\)/\\0\1/g;s/\\\([^0]\)/\\\\\1/g')) >> >> esac >> >> [...] >> >> >> >> in order to get through the worst with utf-8 file names, and it is a >> >> complete nuisance (double quotemarks are treated later). >> > >> > Please understand that the quotes are not there for you, but for >> > processing by other programs. >> > >> > However, I _suspect_ that you want to do something like >> > >> > name="$(echo $name)" >> > >> > because "echo" is exactly one of the programs this quoting was invented >> > for. >> >> Only that it does not work with echo. echo requires \0NNN for >> octal escapes, not \NNN, and then only when "echo -e" is used. > > Um. How does that apply here? Git only does quoting so that programs > like echo get it right, when passed the name? No funny \0NNN or \NNN > or whatever? git puts out funny \NNN quotes. That's what I am complaining about. >> You are really haphazard in distributing your blame. >> >> Can you actually name a program that would work with the default >> output of git here? > > echo. It doesn't, since it does not interpret the \NNN escape sequences that git chooses to output. -- David Kastrup - To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html