Reputation: 20633
I tried to get the total of files changed, total of lines added and removed in a specific SVN commit, without success.
I tried something like:
svn diff -r 12983:12984 > patch.diff
cat patch.diff | grep $'+'
cat patch.diff | grep $'-'
But it doesn't look right. Also, I can't figure out how many files I have changed.
How can I do that?
I actually get it working with the following:
svn diff -r REV1:REV2 > patch.diff
cat patch.diff | grep $'^+ ' | wc -l # additions
cat patch.diff | grep $'^- ' | wc -l # deletions
svn diff --summarize -r REV1:REV2 | wc -l # total files changed
Thanks everyone.
Upvotes: 1
Views: 469
Reputation: 106
You may use something like svn diff --summarize -r REV1:REV2 <PATH/URL> | wc -l
Hope this helps.
Regards
Upvotes: 1
Reputation: 52659
Looks about right to me, but I'd grep for '+ ' not just '+' as you will get lines like:
+++ xyz.txt <revision n>
at the beginning of every file in your unified diff.
You might like to read the format of patch files.
Upvotes: 1