Re: SVN log --xml version omits line count

2024-03-05 Thread sebb
On Tue, 5 Mar 2024 at 19:01, Daniel Sahlberg
 wrote:
>
> Den tis 5 mars 2024 kl 18:09 skrev sebb :
>>
>> I would expect svn log --xml to include all the same info as the
>> non-xml version, but that is not the case. The number of lines changed
>> is not visible in the xml version.
>
>
> The figure is the number of lines in the log message, not the number of 
> changed lines in the commit.

Duh!

That makes sense now.

>>
>>
>> Is that intentional?
>>
>> If so, why?
>
>
> One could imagine that a parser of the text output would like to know the 
> number of lines to read before expecting the next log message. (Looking for 
> "" 
> could break down if someone has that exact string in a log message).

Indeed, that had occurred to me as a potential parsing issue.

> With XML, there is no need to know how long the log message is; a 
> well-behaved parser should be able to find out.
>
> Kind regards,
> Daniel

Thanks for the quick response.

>>
>> Sebb
>> Sample outputs below
>> -
>>
>> $ svn log https://svn.apache.org/repos/asf/subversion/trunk/NOTICE -r1914220
>> 
>> r1914220 | hartmannathan | 2023-11-30 04:47:33 + (Thu, 30 Nov
>> 2023) | 6 lines
>>
>> Update copyright year to 2023.
>>
>> * NOTICE,
>> * subversion/libsvn_subr/version.c (svn_version_extended):
>> Bump copyright year to 2023.
>>
>> 
>>
>> $ svn log https://svn.apache.org/repos/asf/subversion/trunk/NOTICE
>> -r1914220 --xml
>> 
>> 
>> >revision="1914220">
>> hartmannathan
>> 2023-11-30T04:47:33.883414Z
>> Update copyright year to 2023.
>>
>> * NOTICE,
>> * subversion/libsvn_subr/version.c (svn_version_extended):
>> Bump copyright year to 2023.
>> 
>> 
>> 


Re: SVN log --xml version omits line count

2024-03-05 Thread Daniel Sahlberg
Den tis 5 mars 2024 kl 18:09 skrev sebb :

> I would expect svn log --xml to include all the same info as the
> non-xml version, but that is not the case. The number of lines changed
> is not visible in the xml version.


The figure is the number of lines in the log message, not the number of
changed lines in the commit.


>
> Is that intentional?

If so, why?
>

One could imagine that a parser of the text output would like to know the
number of lines to read before expecting the next log message. (Looking for
""
could break down if someone has that exact string in a log message).

With XML, there is no need to know how long the log message is; a
well-behaved parser should be able to find out.

Kind regards,
Daniel


> Sebb
> Sample outputs below
> -
>
> $ svn log https://svn.apache.org/repos/asf/subversion/trunk/NOTICE
> -r1914220
> 
> r1914220 | hartmannathan | 2023-11-30 04:47:33 + (Thu, 30 Nov
> 2023) | 6 lines
>
> Update copyright year to 2023.
>
> * NOTICE,
> * subversion/libsvn_subr/version.c (svn_version_extended):
> Bump copyright year to 2023.
>
> 
>
> $ svn log https://svn.apache.org/repos/asf/subversion/trunk/NOTICE
> -r1914220
>  --xml
> 
> 
> revision="1914220">
> hartmannathan
> 2023-11-30T04:47:33.883414Z
> Update copyright year to 2023.
>
> * NOTICE,
> * subversion/libsvn_subr/version.c (svn_version_extended):
> Bump copyright year to 2023.
> 
> 
> 
>