Re: Stupid quoting...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 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?

> > 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.

> >> 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?

> 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.

Ciao,
Dscho

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux