On Wed, 13 May 2009, Alex Riesen wrote: > 2009/5/13 Daniel Barkalow : > > On Wed, 13 May 2009, Alex Riesen wrote: > >> 2009/5/13 Junio C Hamano : > >> > >> > If it is just informational use only, then it might make more sense to > >> > drop this ugly "quoted \n" silently.  I dunno. > >> > >> That'd mean to loose the information completely. Which is just as bad > >> as putting the LF in the url in the first place. > > > > Looking back at the original message, it looks like the user included a > > newline in an argument to clone, and the fetch must have stripped it out > > (or ignored it in some other fashion), because data was retrieved from a > > repository that doesn't have a newline in its name. > > _That_ looks like a bug to me. We should have asked exactly the name > we were given, or notify the user about what we have used for the url > if we have ignored user's input and decided to use something else. > Patches follow. > > > ... Most likely, the > > newline should just be prohibited in the URL in the config file in the > > first place, and we shouldn't be able to get to the point of writing a > > FETCH_HEAD with that value. > > What I cannot understand is what's wrong with url containing an LF? > Especially if we can handle it, all the tools can handle it, and putting > LF in a filename is a long-standing UNIX tradition. The RFC for URLs (which we don't actually follow particularly much) doesn't permit whitespace. Protocols that use URLs directly generally use newlines as control characters. For example, an HTTP request for: http://host/path/with newline/in/it would parse as a request for "http://host/path/with" with an invalid header line. Normally, to refer to a resource whose name contains a newline, the URL contains "%0A" instead. Of course, our "url" config can contain some things that aren't URLs, but this particular case was of the form that's supposed to be a standard URL. -Daniel *This .sig left intentionally blank*