You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Paul Graham <pg...@oasys-ds.com> on 2011/03/18 14:39:10 UTC

cvs log equivalent

SVN experts:

The cvs log command includes information about the size of each change:

revision 1.14
date: 2010-03-13 18:26:55 -0500;  author: pgraham;  state: Exp;  lines: +331 -288;
Rewrote function.
----------------------------
revision 1.13
date: 2010-03-04 22:17:56 -0500;  author: pgraham;  state: Exp;  lines: +4 -3;
Minor cleanup.

It's useful to see when a major change was made to a file. 

The svn log command lists only log messages, with no information about the
magnitude of each change.  In fact, I was confused for a while by the svn log 
output format.  It is somewhat similar to the cvs log file output, but the 
"lines" field is only the number of lines in the log message.  It has nothing
to do with the actual change made to the file:

------------------------------------------------------------------------
r7327 | pgraham | 2008-03-07 19:33:42 -0500 (Fri, 07 Mar 2008) | 2 lines

Check for null pointer.

------------------------------------------------------------------------
r7143 | pgraham | 2008-02-07 20:55:01 -0500 (Thu, 07 Feb 2008) | 2 lines

Completely rewrite module.


Is there any way to get an output similar to cvs log?

Paul

Re: cvs log equivalent

Posted by Mark Phippard <ma...@gmail.com>.
On Fri, Mar 25, 2011 at 3:35 PM, Paul Graham <pg...@oasys-ds.com> wrote:
> The "Lines" field of svn log is puzzling.  It says how many lines of comment, etc., follow the header line.
>  It is therefore about as informative as "this page intentionally left blank".  Yet in its location in the log
> message it resembles the cvs "lines-changed" field enough to be misleading.

FWIW, I believe it exists for scripts that might be parsing the
output.  It lets them know how many lines are in the comment.  I agree
on the confusion, especially for CVS users.

-- 
Thanks

Mark Phippard
http://markphip.blogspot.com/

Re: cvs log equivalent

Posted by Paul Graham <pg...@oasys-ds.com>.
The "Lines" field of svn log is puzzling.  It says how many lines of comment, etc., follow the header line.  It is therefore about as informative as "this page intentionally left blank".  Yet in its location in the log message it resembles the cvs "lines-changed" field enough to be misleading.

Paul
----- Original Message -----
From: "Johan Corveleyn" <jc...@gmail.com>
To: "Daniel Shahaf" <d....@daniel.shahaf.name>
Cc: "Paul Graham" <pg...@oasys-ds.com>, users@subversion.apache.org
Sent: Friday, March 25, 2011 3:24:22 PM
Subject: Re: cvs log equivalent

On Fri, Mar 25, 2011 at 7:34 PM, Daniel Shahaf <d....@daniel.shahaf.name> wrote:
> Johan Corveleyn wrote on Sat, Mar 19, 2011 at 14:50:30 +0100:
>> On Sat, Mar 19, 2011 at 2:21 AM, Hyrum K. Wright
>> <hy...@mail.utexas.edu> wrote:
>> > On Fri, Mar 18, 2011 at 6:13 PM, Paul Graham <pg...@oasys-ds.com> wrote:
>> >> I could find all the change versions of a file, then do an svn diff for each change, then parse the output and determine the number of changes, but that seems excessive :-)
>> >>
>> >> rcs has this lines+/- information directly in the database.  Is svn organized differently under the hood?
>> >
>> > Significantly.
>> >
>> > One thing I usually do is run svn diff on the revision of interest and
>> > then pipe that through diffstat:
>> >
>> > $ svn diff -c1089374 | diffstat
>> >
>> > That will usually yield sufficiently interesting result for my application.
>>
>> Paul,
>>
>> It may interest you to know that the upcoming 1.7 release of svn will
>> have a '--diff' option for 'svn log', which will show the diffs inline
>> with the log output. You may be able to script something around that,
>> post-processing the output of 'svn log --diff' by sending each diff to
>> 'diffstat', and replacing the diff output with the diffstat output or
>> something (this will be much more efficient than executing 'svn diff
>> -c XXX | diffstat' for every revision that's being output by log).
>
> I think you mean:
>
>  svn log --diff --diff-cmd=/path/to/wrapper-script-around-diffstat

Ohhh, I hadn't thought of that. That certainly seems like a nice way
to do this ...

Cheers,
-- 
Johan

Re: cvs log equivalent

Posted by Johan Corveleyn <jc...@gmail.com>.
On Fri, Mar 25, 2011 at 7:34 PM, Daniel Shahaf <d....@daniel.shahaf.name> wrote:
> Johan Corveleyn wrote on Sat, Mar 19, 2011 at 14:50:30 +0100:
>> On Sat, Mar 19, 2011 at 2:21 AM, Hyrum K. Wright
>> <hy...@mail.utexas.edu> wrote:
>> > On Fri, Mar 18, 2011 at 6:13 PM, Paul Graham <pg...@oasys-ds.com> wrote:
>> >> I could find all the change versions of a file, then do an svn diff for each change, then parse the output and determine the number of changes, but that seems excessive :-)
>> >>
>> >> rcs has this lines+/- information directly in the database.  Is svn organized differently under the hood?
>> >
>> > Significantly.
>> >
>> > One thing I usually do is run svn diff on the revision of interest and
>> > then pipe that through diffstat:
>> >
>> > $ svn diff -c1089374 | diffstat
>> >
>> > That will usually yield sufficiently interesting result for my application.
>>
>> Paul,
>>
>> It may interest you to know that the upcoming 1.7 release of svn will
>> have a '--diff' option for 'svn log', which will show the diffs inline
>> with the log output. You may be able to script something around that,
>> post-processing the output of 'svn log --diff' by sending each diff to
>> 'diffstat', and replacing the diff output with the diffstat output or
>> something (this will be much more efficient than executing 'svn diff
>> -c XXX | diffstat' for every revision that's being output by log).
>
> I think you mean:
>
>  svn log --diff --diff-cmd=/path/to/wrapper-script-around-diffstat

Ohhh, I hadn't thought of that. That certainly seems like a nice way
to do this ...

Cheers,
-- 
Johan

Re: cvs log equivalent

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
Johan Corveleyn wrote on Sat, Mar 19, 2011 at 14:50:30 +0100:
> On Sat, Mar 19, 2011 at 2:21 AM, Hyrum K. Wright
> <hy...@mail.utexas.edu> wrote:
> > On Fri, Mar 18, 2011 at 6:13 PM, Paul Graham <pg...@oasys-ds.com> wrote:
> >> I could find all the change versions of a file, then do an svn diff for each change, then parse the output and determine the number of changes, but that seems excessive :-)
> >>
> >> rcs has this lines+/- information directly in the database.  Is svn organized differently under the hood?
> >
> > Significantly.
> >
> > One thing I usually do is run svn diff on the revision of interest and
> > then pipe that through diffstat:
> >
> > $ svn diff -c1089374 | diffstat
> >
> > That will usually yield sufficiently interesting result for my application.
> 
> Paul,
> 
> It may interest you to know that the upcoming 1.7 release of svn will
> have a '--diff' option for 'svn log', which will show the diffs inline
> with the log output. You may be able to script something around that,
> post-processing the output of 'svn log --diff' by sending each diff to
> 'diffstat', and replacing the diff output with the diffstat output or
> something (this will be much more efficient than executing 'svn diff
> -c XXX | diffstat' for every revision that's being output by log).

I think you mean:

  svn log --diff --diff-cmd=/path/to/wrapper-script-around-diffstat

Re: cvs log equivalent

Posted by Johan Corveleyn <jc...@gmail.com>.
On Sat, Mar 19, 2011 at 2:21 AM, Hyrum K. Wright
<hy...@mail.utexas.edu> wrote:
> On Fri, Mar 18, 2011 at 6:13 PM, Paul Graham <pg...@oasys-ds.com> wrote:
>> I could find all the change versions of a file, then do an svn diff for each change, then parse the output and determine the number of changes, but that seems excessive :-)
>>
>> rcs has this lines+/- information directly in the database.  Is svn organized differently under the hood?
>
> Significantly.
>
> One thing I usually do is run svn diff on the revision of interest and
> then pipe that through diffstat:
>
> $ svn diff -c1089374 | diffstat
>
> That will usually yield sufficiently interesting result for my application.

Paul,

It may interest you to know that the upcoming 1.7 release of svn will
have a '--diff' option for 'svn log', which will show the diffs inline
with the log output. You may be able to script something around that,
post-processing the output of 'svn log --diff' by sending each diff to
'diffstat', and replacing the diff output with the diffstat output or
something (this will be much more efficient than executing 'svn diff
-c XXX | diffstat' for every revision that's being output by log).

Of course, if 'svn log' could calculate/output the diffstat output (or
something similar) itself, that would be even more efficient (no need
to send entire diffs over the wire, and execute external programs to
post-process it), and much cleaner. So I can certainly see the value
of a '--diffstat' option for 'svn log', doing exactly this.

I'm not sure how much work such a feature would be, but if someone
would like to take a look at this, I'd say: patches welcome! Though
I'd start a discussion on the dev-list first, before spending huge
amounts of time on it.

Cheers,
-- 
Johan

Re: cvs log equivalent

Posted by "Hyrum K. Wright" <hy...@mail.utexas.edu>.
On Fri, Mar 18, 2011 at 6:13 PM, Paul Graham <pg...@oasys-ds.com> wrote:
> I could find all the change versions of a file, then do an svn diff for each change, then parse the output and determine the number of changes, but that seems excessive :-)
>
> rcs has this lines+/- information directly in the database.  Is svn organized differently under the hood?

Significantly.

One thing I usually do is run svn diff on the revision of interest and
then pipe that through diffstat:

$ svn diff -c1089374 | diffstat

That will usually yield sufficiently interesting result for my application.

-Hyrum

Re: cvs log equivalent

Posted by Paul Graham <pg...@oasys-ds.com>.
I could find all the change versions of a file, then do an svn diff for each change, then parse the output and determine the number of changes, but that seems excessive :-)

rcs has this lines+/- information directly in the database.  Is svn organized differently under the hood?

Paul
----- Original Message -----
From: "Ryan Schmidt" <su...@ryandesign.com>
To: "Paul Graham" <pg...@oasys-ds.com>
Cc: users@subversion.apache.org
Sent: Friday, March 18, 2011 6:41:50 PM
Subject: Re: cvs log equivalent

On Mar 18, 2011, at 08:39, Paul Graham wrote:

> The cvs log command includes information about the size of each change:

> Is there any way to get an output similar to cvs log?

Not with the standard client, no. Perhaps such a thing could be written with a custom script.



Re: cvs log equivalent

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Mar 18, 2011, at 08:39, Paul Graham wrote:

> The cvs log command includes information about the size of each change:

> Is there any way to get an output similar to cvs log?

Not with the standard client, no. Perhaps such a thing could be written with a custom script.



Re: cvs log equivalent

Posted by Paul Graham <pg...@oasys-ds.com>.
Andy,

Thanks for the reply, but svn log --verbose does not do what I asked about.   
What I'm interested in is something like cvs log which shows the number 
of lines affected by the change, e.g., "lines: +10 -5".

Paul
----- Original Message -----
From: "Andy Levy" <an...@gmail.com>
To: "Paul Graham" <pg...@oasys-ds.com>
Cc: users@subversion.apache.org
Sent: Friday, March 18, 2011 2:20:23 PM
Subject: Re: cvs log equivalent

On Fri, Mar 18, 2011 at 09:39, Paul Graham <pg...@oasys-ds.com> wrote:
> SVN experts:
>
> The cvs log command includes information about the size of each change:
>
> revision 1.14
> date: 2010-03-13 18:26:55 -0500;  author: pgraham;  state: Exp;  lines: +331 -288;
> Rewrote function.
> ----------------------------
> revision 1.13
> date: 2010-03-04 22:17:56 -0500;  author: pgraham;  state: Exp;  lines: +4 -3;
> Minor cleanup.
>
> It's useful to see when a major change was made to a file.
>
> The svn log command lists only log messages, with no information about the
> magnitude of each change.  In fact, I was confused for a while by the svn log
> output format.  It is somewhat similar to the cvs log file output, but the
> "lines" field is only the number of lines in the log message.  It has nothing
> to do with the actual change made to the file:
>
> ------------------------------------------------------------------------
> r7327 | pgraham | 2008-03-07 19:33:42 -0500 (Fri, 07 Mar 2008) | 2 lines
>
> Check for null pointer.
>
> ------------------------------------------------------------------------
> r7143 | pgraham | 2008-02-07 20:55:01 -0500 (Thu, 07 Feb 2008) | 2 lines
>
> Completely rewrite module.
>
>
> Is there any way to get an output similar to cvs log?

Try svn log --verbose

Always look to svn help <command> first when you have a question about
how a command works. The help provided by Subversion is pretty good.

Re: cvs log equivalent

Posted by Andy Levy <an...@gmail.com>.
On Fri, Mar 18, 2011 at 09:39, Paul Graham <pg...@oasys-ds.com> wrote:
> SVN experts:
>
> The cvs log command includes information about the size of each change:
>
> revision 1.14
> date: 2010-03-13 18:26:55 -0500;  author: pgraham;  state: Exp;  lines: +331 -288;
> Rewrote function.
> ----------------------------
> revision 1.13
> date: 2010-03-04 22:17:56 -0500;  author: pgraham;  state: Exp;  lines: +4 -3;
> Minor cleanup.
>
> It's useful to see when a major change was made to a file.
>
> The svn log command lists only log messages, with no information about the
> magnitude of each change.  In fact, I was confused for a while by the svn log
> output format.  It is somewhat similar to the cvs log file output, but the
> "lines" field is only the number of lines in the log message.  It has nothing
> to do with the actual change made to the file:
>
> ------------------------------------------------------------------------
> r7327 | pgraham | 2008-03-07 19:33:42 -0500 (Fri, 07 Mar 2008) | 2 lines
>
> Check for null pointer.
>
> ------------------------------------------------------------------------
> r7143 | pgraham | 2008-02-07 20:55:01 -0500 (Thu, 07 Feb 2008) | 2 lines
>
> Completely rewrite module.
>
>
> Is there any way to get an output similar to cvs log?

Try svn log --verbose

Always look to svn help <command> first when you have a question about
how a command works. The help provided by Subversion is pretty good.