Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Print last 10/20/... svn log messages with diffs

I am using SVN for a project. with svn log -l 10, I can get the last 10 commits to this folder, with the revision id, log message, etc.. Is there any SVN command that lets me print out on the command line all the diffs for each of those changesets? I'd like to do some grepping/etc. with the last X diffs?

like image 204
Amandasaurus Avatar asked Jul 29 '11 15:07

Amandasaurus


People also ask

How do you find the difference between two svn revisions?

Display the differences between two paths. The ways you can use svn diff are: Use just svn diff'to display local modifications in a working copy. Display the changes made to TARGET s as they are seen in REV between two revisions.

Where are svn logs stored?

By default going to be in /var/log/httpd .


2 Answers

In SVN v1.7, there are the

 --diff                   : produce diff output
 --diff-cmd ARG           : use ARG as diff command

options that you can use with svn log

For older version (which is probably your case), you will have to do some scripting to supply revision to svn diff and get the output

like image 165
manojlds Avatar answered Sep 21 '22 08:09

manojlds


For older svn, you can use function:

 svn-log-diff()
 {
        for c in `svn log "$@"  | grep '^r' | cut -f1 -d ' ' | sed s/r/-c/`; do
             svn diff --force $c || break
        done
 }
like image 24
2 revs, 2 users 95% Avatar answered Sep 21 '22 08:09

2 revs, 2 users 95%