You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Brad O'Hearne <br...@neurofire.com> on 2005/03/02 21:30:01 UTC

Format of svn command output

Is there a way to get the output of svn commands returned as xml, or in 
some other structured format, and if so, is there some doc that defines 
the structure returned? 

If the answer is no, where might be a place in the source code to look 
to find where such a change might be made?

Brad

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

Re: Format of svn command output

Posted by Ben Collins-Sussman <su...@collab.net>.
On Mar 2, 2005, at 4:06 PM, Steve Greenland wrote:

> On Wed, Mar 02, 2005 at 04:30:01PM -0500, Brad O'Hearne wrote:
>> Is there a way to get the output of svn commands returned as xml, or 
>> in
>> some other structured format, and if so, is there some doc that 
>> defines
>> the structure returned?
>
> I think the output of all the commands is in a "structured format".
> That is, some effort has gone into making the output parseable, and the
> structure is not modified lightly.
>

'svn log --xml' has existed for a long time.  In the upcoming svn 1.2, 
I believe 'svn ls' now has an --xml option as well.

Beyond that:  what Steve said is correct.


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

Re: Format of svn command output

Posted by Steve Greenland <st...@lsli.com>.
On Wed, Mar 02, 2005 at 11:14:59PM +0100, Arild Fines wrote:
> Steve Greenland wrote:
> > I think the output of all the commands is in a "structured format".
> > That is, some effort has gone into making the output parseable, and
> > the structure is not modified lightly.
> 
> Some of the core developers seem to disagree with you:
> http://subversion.tigris.org/issues/show_bug.cgi?id=2069

Well, I'm not sure that pointing out flaw in one particular instance
is "disagreeing" with my general point, but sure, the assumption that
usernames would not contain spaces is a bug w.r.t. parsing the output
of "svn status". OTOH, if your environment doesn't use such names, then
you're okay. In general, the output of svn commands is pretty well
thought out for further processing, particularly for the occasional
adhoc unix pipeline.

And if someone want to define a general XML schema for svn output, and
implement it, I certainly wouldn't object. 

Steve

-- 
"Outlook not so good." That magic 8-ball knows everything! I'll ask
about Exchange Server next.
                           -- (Stolen from the net)

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

Re: Format of svn command output

Posted by "Peter N. Lundblad" <pe...@famlundblad.se>.
On Fri, 4 Mar 2005, Steve Greenland wrote:

> On Fri, Mar 04, 2005 at 02:10:36PM +0100, Peter N. Lundblad wrote:
> > On Wed, 2 Mar 2005, Steve Greenland wrote:
> > > Or, write a filter that converts the current output to XML :-)
> > >
> > Or you could go the other way round, writing a filter that reads the XML
> > and outputs what you actually need.
>
> Except, of course, for the small issue that there isn't any XML output
> for the majority of the commands.
>
Fair enough. svn ls --xml was implemented recently and there is an issue
for svn st --xml. It just happens that no one has gotten around to it yet.

Regards,
//Peter

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

Re: Format of svn command output

Posted by Steve Greenland <st...@lsli.com>.
On Fri, Mar 04, 2005 at 02:10:36PM +0100, Peter N. Lundblad wrote:
> On Wed, 2 Mar 2005, Steve Greenland wrote:
> > Or, write a filter that converts the current output to XML :-)
> >
> Or you could go the other way round, writing a filter that reads the XML
> and outputs what you actually need. 

Except, of course, for the small issue that there isn't any XML output
for the majority of the commands.

Steve

-- 
"Outlook not so good." That magic 8-ball knows everything! I'll ask
about Exchange Server next.
                           -- (Stolen from the net)

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

Re: Format of svn command output

Posted by "Peter N. Lundblad" <pe...@famlundblad.se>.
On Wed, 2 Mar 2005, Steve Greenland wrote:

> On Wed, Mar 02, 2005 at 04:30:01PM -0500, Brad O'Hearne wrote:
> > Is there a way to get the output of svn commands returned as xml, or in
> > some other structured format, and if so, is there some doc that defines
> > the structure returned?
>
> I think the output of all the commands is in a "structured format".
> That is, some effort has gone into making the output parseable, and the
> structure is not modified lightly.
>
But it will happen. For example, the locking branch has changed the output
of svn update to add an extra column indicating that a lock was broken.

The problem with the current output is that it isn't easy to extend
without breaking scripts. Still, we sometimes need to extend it for enw
functionality.

> IMO, this is the right thing to do. The current output is both readable
> and easily handled by standard Unixy tools, like awk, grep, etc., which
> XML is not. If you're going to process XML, then you're writing a real
> program, and you might as well use the API rather than the command line
> tools. Or, write a filter that converts the current output to XML :-)
>
Or you could go the other way round, writing a filter that reads the XML
and outputs what you actually need. That could be done with XSLT, for
example, so it doesn't need to be a "real program".

Regards,
//Peter

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

RE: Format of svn command output

Posted by Arild Fines <ar...@broadpark.no>.
Steve Greenland wrote:
> On Wed, Mar 02, 2005 at 04:30:01PM -0500, Brad O'Hearne wrote:
>> Is there a way to get the output of svn commands returned as xml, or
>> in some other structured format, and if so, is there some doc that
>> defines the structure returned?
>
> I think the output of all the commands is in a "structured format".
> That is, some effort has gone into making the output parseable, and
> the structure is not modified lightly.

Some of the core developers seem to disagree with you:
http://subversion.tigris.org/issues/show_bug.cgi?id=2069

--
Arild

AnkhSVN, Subverting Visual Studio .NET: http://ankhsvn.tigris.org
Blog: http://ankhsvn.com/blog
IRC: irc://irc.freenode.net/ankhsvn

"Gentlemen, you can't fight in here! This is the war room!"


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

Re: Format of svn command output

Posted by Steve Greenland <st...@lsli.com>.
On Wed, Mar 02, 2005 at 04:30:01PM -0500, Brad O'Hearne wrote:
> Is there a way to get the output of svn commands returned as xml, or in 
> some other structured format, and if so, is there some doc that defines 
> the structure returned? 

I think the output of all the commands is in a "structured format".
That is, some effort has gone into making the output parseable, and the
structure is not modified lightly.

IMO, this is the right thing to do. The current output is both readable
and easily handled by standard Unixy tools, like awk, grep, etc., which
XML is not. If you're going to process XML, then you're writing a real
program, and you might as well use the API rather than the command line
tools. Or, write a filter that converts the current output to XML :-)

Steve

-- 
"Outlook not so good." That magic 8-ball knows everything! I'll ask
about Exchange Server next.
                           -- (Stolen from the net)

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