Re: SVN log --xml version omits line count

sebb <[email protected]>
Newsgroups gmane.comp.version-control.subversion.user
Message-ID <CAOGo0VZk=OsfRf6tR-0CKFm_=YZG_Ob8OPTTQ37oFnTR6Vr8Gg@mail.gmail.com>
On Tue, 5 Mar 2024 at 19:01, Daniel Sahlberg
<[email protected]> wrote:
>
> Den tis 5 mars 2024 kl 18:09 skrev sebb <[email protected]>:
>>
>> 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 +0000 (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
>> <?xml version="1.0" encoding="UTF-8"?>
>> <log>
>> <logentry
>>    revision="1914220">
>> <author>hartmannathan</author>
>> <date>2023-11-30T04:47:33.883414Z</date>
>> <msg>Update copyright year to 2023.
>>
>> * NOTICE,
>> * subversion/libsvn_subr/version.c (svn_version_extended):
>>     Bump copyright year to 2023.
>> </msg>
>> </logentry>
>> </log>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.