[sf-perl] [OT] svn diff

mehryar mehryar at mehryar.com
Tue Aug 8 13:29:34 PDT 2006

Thanks Andy,
I finally figured it out:

Here is how to use an external diff command with svn:

svn diff --diff-cmd /usr/bin/diff --extensions '-b' $file_to_diff

But since you wouldn't want to type this out every time you do a svn diff
you can put something in your ~/.subversion/config file.
And what that maybe, I couldn't figure out very well, so here is what I

in my .subversion/config file:
### Set diff-cmd to the absolute path of your 'diff' program
### ...
diff-cmd = /home/mehryar/bin/my_svn_diff

and my_svn_diff looks like:
/usr/bin/diff -b $6 $7
# where $6 and $7 are the file args that svn passes to its diff command
# and -b is just what I like to pass as an argument to my diff command


On Tue, 8 Aug 2006, Andy Lester wrote:

> On Aug 8, 2006, at 4:34 AM, mehryar wrote:
> >
> > Off-topic but I haven't been able to find a good answer, anyone
> > know how I
> > can get cvs style diff output with "svn diff"?
> You tell svn to use an external diff program, like /usr/bin/diff, and
> then pass whatever flags you like.
> Not sure what the command-line switches are to do this, but svn help
> diff should have it all.  I'm going back to bed after I let the dog
> back in.
> --
> Andy Lester => andy at petdance.com => www.petdance.com => AIM:petdance
> _______________________________________________
> SanFrancisco-pm mailing list
> SanFrancisco-pm at pm.org
> http://mail.pm.org/mailman/listinfo/sanfrancisco-pm

... with proper design, the features come cheaply. This
approach is arduous, but continues to succeed.
                                     ---Dennis Ritchie

More information about the SanFrancisco-pm mailing list