You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by "C.A.T.Magic" <c....@gmx.at> on 2004/04/05 16:06:25 UTC

[PATCH] Re: bad output format design issue: svn log -v format is not parseable :-(


yes, at least the longer usernames with whitespaces
were a hazzle before i patched the svn cli.
and if you ever have a name like
"patch2.3 (from customer)" in your
repository its at least annoying to find the exact
regexp for the log parser.


i'd like to suggest the following small patches,

but i'm not sure if anybody else (who doesnt care
for spaces) relies on the current /amiguous/ output
format. an optional solution could be to use a
colon instead of the tab, if you don't like tabs
to format your output. i found the TAB least intrusive.


my (suggested) CHANGES:


fixed two output format ambiguities:

patch1: svn status -v now truncates long usernames to the specified 12 
characters to prevent ambiguity like in
   >svn status -v
   >                11       11 cat            a file.txt
   >                12       12 administrator johnMy spaced File.c

patch2: svn log now separates the path and the copyfrom path with a TAB, 
since a tab cannot occour in a filename to prevent ambiguity like in
   >svn log -v
   > A \tag\patch1.2 (from customer) (from \trunk\patch1.2:623)
this now changes to
   > A \tag\patch1.2 (from customer)<TAB>(from \trunk\patch1.2:623)


======
c.a.t.


=============================



Re: [PATCH] Re: bad output format design issue: svn log -v format is not parseable :-(

Posted by "C.A.T.Magic" <c....@gmx.at>.
Travis P wrote:

> 
> On Apr 5, 2004, at 11:06 AM, C.A.T.Magic wrote:
> 
>> patch1: svn status -v now truncates long usernames to the specified 12 
>> characters to prevent ambiguity like in
>>   >svn status -v
>>   >                11       11 cat            a file.txt
>>   >                12       12 administrator johnMy spaced File.c
>>
>> -    printf ("%c%c%c%c%c  %c   %6s   %6s %-12s %s\n",
>> +    printf ("%c%c%c%c%c  %c   %6s   %6s %-12.12s %s\n",
> 
> 
> How'd you get 12 above? Wouldn't there be a space between john and My?  
> (There is a space in the format string prior to the final %s.)
> Truncation of user names will naturally create new ambiguities between, 
> e.g.
>   "administrator john" and "administrator sally" who will both appear as 
> "administrato"

because currently i don't care about the name (...) and
most applications work like this (cut off too long names).
cutting off is better because this way you can expect a certain item
to start at a specific column. ofcourse, the TAB solution would work in 
this case too, if you prefer that one.
hmmm ... will the %6 ever overflow? at least the %c are stable.

> Given your other patch, I would think you'd want to just use tab between 
> user name and file name.
> (Not that either of these is necessarily good for Subversion trunk.  Not 
> sure why you aren't exploring the XML output option.)

-) svn status does not have --xml output
-) there is probably a new issue with #13\r\n in the xml output.
-) xml is annoying to parse, good xml parsers are not free, and not easy 
to embed in existing code (callbacks, etc). it also adds a new external 
dependency to my code.

======
c.a.t.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH] Re: bad output format design issue: svn log -v format is not parseable :-(

Posted by "C.A.T.Magic" <c....@gmx.at>.
Travis P wrote:

> 
> On Apr 5, 2004, at 11:06 AM, C.A.T.Magic wrote:
> 
>> patch1: svn status -v now truncates long usernames to the specified 12 
>> characters to prevent ambiguity like in
>>   >svn status -v
>>   >                11       11 cat            a file.txt
>>   >                12       12 administrator johnMy spaced File.c
>>
>> -    printf ("%c%c%c%c%c  %c   %6s   %6s %-12s %s\n",
>> +    printf ("%c%c%c%c%c  %c   %6s   %6s %-12.12s %s\n",
> 
> 
> How'd you get 12 above? Wouldn't there be a space between john and My?  
> (There is a space in the format string prior to the final %s.)
> Truncation of user names will naturally create new ambiguities between, 
> e.g.
>   "administrator john" and "administrator sally" who will both appear as 
> "administrato"

because currently i don't care about the name (...) and
most applications work like this (cut off too long names).
cutting off is better because this way you can expect a certain item
to start at a specific column. ofcourse, the TAB solution would work in 
this case too, if you prefer that one.
hmmm ... will the %6 ever overflow? at least the %c are stable.

> Given your other patch, I would think you'd want to just use tab between 
> user name and file name.
> (Not that either of these is necessarily good for Subversion trunk.  Not 
> sure why you aren't exploring the XML output option.)

-) svn status does not have --xml output
-) there is probably a new issue with #13\r\n in the xml output.
-) xml is annoying to parse, good xml parsers are not free, and not easy 
to embed in existing code (callbacks, etc). it also adds a new external 
dependency to my code.

======
c.a.t.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: [PATCH] Re: bad output format design issue: svn log -v format is not parseable :-(

Posted by Travis P <sv...@castle.fastmail.fm>.
On Apr 5, 2004, at 11:06 AM, C.A.T.Magic wrote:

> patch1: svn status -v now truncates long usernames to the specified 12 
> characters to prevent ambiguity like in
>   >svn status -v
>   >                11       11 cat            a file.txt
>   >                12       12 administrator johnMy spaced File.c
>
> -    printf ("%c%c%c%c%c  %c   %6s   %6s %-12s %s\n",
> +    printf ("%c%c%c%c%c  %c   %6s   %6s %-12.12s %s\n",

How'd you get 12 above? Wouldn't there be a space between john and My?  
(There is a space in the format string prior to the final %s.)
Truncation of user names will naturally create new ambiguities between, 
e.g.
   "administrator john" and "administrator sally" who will both appear 
as "administrato"
Given your other patch, I would think you'd want to just use tab 
between user name and file name.
(Not that either of these is necessarily good for Subversion trunk.  
Not sure why you aren't exploring the XML output option.)

-Travis


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: [PATCH] Re: bad output format design issue: svn log -v format is not parseable :-(

Posted by Travis P <sv...@castle.fastmail.fm>.
On Apr 5, 2004, at 11:06 AM, C.A.T.Magic wrote:

> patch1: svn status -v now truncates long usernames to the specified 12 
> characters to prevent ambiguity like in
>   >svn status -v
>   >                11       11 cat            a file.txt
>   >                12       12 administrator johnMy spaced File.c
>
> -    printf ("%c%c%c%c%c  %c   %6s   %6s %-12s %s\n",
> +    printf ("%c%c%c%c%c  %c   %6s   %6s %-12.12s %s\n",

How'd you get 12 above? Wouldn't there be a space between john and My?  
(There is a space in the format string prior to the final %s.)
Truncation of user names will naturally create new ambiguities between, 
e.g.
   "administrator john" and "administrator sally" who will both appear 
as "administrato"
Given your other patch, I would think you'd want to just use tab 
between user name and file name.
(Not that either of these is necessarily good for Subversion trunk.  
Not sure why you aren't exploring the XML output option.)

-Travis


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org