How to remove SVN Properties from SVN Diff With Examples

I use SVN for my projects version control system. Sometimes I need to see the difference between two tags or two branches but when I run “svn diff” command, it gives a whole bunch of SVN Properties changes in output. I was looking for a way to remove these but built in svn diff options doesn’t provide this feature.

So I wrote a shell script that does this job for me, the idea is to first use SVN Diff summarise option with grep and awk to find out the file names where text changes are present, then iterate over this list to generate SVN diff and append that to a file to generate the final diff.

When I execute the above script by passing two URLs, it generates svn_diff_clean.txt having full-text diffs. I used this script to generate diff in my project and the number of lines in output was reduced by almost 50%. However, it depends on project structure and metadata usage.

Tip: If you need to give a password every time while running SVN commands, try to delete the .subversion folder from home directory and then run it, it will ask password only for first time and then use the cached password.

The script doesn’t handle bad URLs or null inputs, but I am too lazy to do that. 🙂

By admin

Leave a Reply

%d bloggers like this: