Created
May 20, 2012 07:22
-
-
Save orenhe/2757173 to your computer and use it in GitHub Desktop.
SVN Log P: a partial 'git log -p' for SVN
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # svnlogp is a script that implements 'git log -p' for svn (partially & inefficiently): it shows all the diff's of a given filename. | |
| # | |
| # Due the SVN centralized architecture, it's really slow, and 'svn blame' is commonly a fair alternative. | |
| # | |
| # Usage: svnlogp <filename> | |
| # | |
| # Author: Oren Held | |
| filename=$1 | |
| if [ "$filename" == "" ]; then | |
| echo "Usage: $0 <filename>" | |
| exit | |
| fi | |
| for revision in $(svn log ${filename} | grep ^r | awk '{print $1}'); do | |
| revision_i=$(echo ${revision} | cut -dr -f2) | |
| echo Revision: ${revision} | |
| prev_revision_i=`expr ${revision_i} - 1` | |
| svn diff -r${prev_revision_i}:${revision_i} ${filename} | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment