[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Need help: Generate a diff log by author

From: David Weintraub <qazwart_at_gmail.com>
Date: Fri, 17 Jul 2009 12:28:46 -0400

Someone asked a quick question about how to do a particular job, and I
answered that question with a shell script that gave him the answer to
his particular query. It took me about five minutes to come up with a
shell script and test it.

The shell script does a diff based upon a particular user for a
particular range of revisions. I didn't write a full blown program,
but the core of the program is there, and it shouldn't be too hard to
expand it into a full blown shell script.

The ability to write and parse out a small shell script to parse
program output is one of the reasons I like Unix. If I was doing a
particular task over and over again (and I guess this person is doing
this over and over again), I would, instead of parsing the Subversion
cli output, use the Subversion API.

But, even then, there are times I won't. Imagine I write a Python
program or Perl program that reports out something in Subversion.
Normally, you could use the API, but while almost all Unix systems
come with the Perl and Python, not all have the Subversion API
installed. Imagine if Mr. Jackson's users want to run the same program
Mr. Jackson was running in order to get this information. Mr. Jackson
could easily assume that developers have access to Perl, Python, and
even BASH, but not that they also have the Subversion API installed
too.

It is one of the reasons I am happy to see the --xml parameter on
Subversion CLI commands. It gives me the stability of output I'd get
with the API, but without having to worry about whether or not the API
actually is installed and working.

On Fri, Jul 17, 2009 at 8:03 AM, Stephane Bortzmeyer<bortzmeyer_at_nic.fr> wrote:
> On Thu, Jul 16, 2009 at 03:50:31PM -0400,
>  David Weintraub <qazwart_at_gmail.com> wrote
>  a message of 156 lines which said:
>
>> *svn log -r$startrev:$stoprev -q "$repository" | sed -n "/^r[^|]*|
>> $user/s/r\([0-9]*\).*/\1/p" | while read revision*
>
> Isn't it surprising to parse the log with sed (in CVS style) rather
> than to use Subversion's very good API?
>

-- 
David Weintraub
qazwart_at_gmail.com
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2372117
To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_subversion.tigris.org].
Received on 2009-07-17 18:29:50 CEST

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.