tags:

views:

40

answers:

3

I have just started to use svn. When comparing to files using 'svn diff' command, the output seems to be very odd. How to intepret diff output? I tried 'svn diff help' but it did not tell anything useful about the output (or I did not understand it).

+1  A: 

Wikipedia has examples:

http://en.wikipedia.org/wiki/Diff

Mchl
is svn diff same command and output as in Unix OS diff?
juur
Yes, I think it is either the same format or similar.
RickL
@juur: yes, it's a standardized format - http://en.wikipedia.org/wiki/Diff#Unified_format
Michael Borgwardt
A: 

Are you using the command-line? You should probably install GUI tools such as Tortoise SVN, that will be much easier to understand.

The "svn diff" command-line output is not meant to be read by a human, rather you would feed it into a program which understands that output (typically this program will show you two text editor windows with the old and new files, and would highlight the differences).

Basically, the SVN DIFF output shows you the character and line positions and the text which has changed between the files.

RickL
Yes, I'm using command line. I would like to fist understand how command line svn works, and then probably move to tortoiseSVN
juur
Ok, thanks!....
juur
@juur: well, the command line works by spitting out a diff, which is designed to be compact and easily parseable by programs, not to be easily readable by humans.
Michael Borgwardt
A: 

@juur,

The svn diff command produces this output by comparing your working files against the cached “pristine” copies within the .svn area. Files scheduled for addition are displayed as all added text, and files scheduled for deletion are displayed as all deleted text.

Output is displayed in unified diff format. That is, removed lines are prefaced with -, and added lines are prefaced with +. svn diff also prints filename and offset information useful to the patch program, so you can generate “patches” by redirecting the diff output to a file

You can check more information on how svn diff works in SVN Book.

jujav4ik