You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by abirami_n <ab...@hcl.com> on 2019/01/02 09:06:01 UTC

svn diff line numbers

Hi,

I am using svn diff command to get the diff between two files from
subversion.

I get the chunk header for the changed chunk.

But I am not finding any option to print line numbers.

Is it possible to get individual line numbers for all the changed lines?



--
Sent from: http://subversion.1072662.n5.nabble.com/Subversion-Users-f84423.html

Re: svn diff line numbers

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
abirami_n wrote on Wed, 02 Jan 2019 02:06 -0700:
> Hi,
> 
> I am using svn diff command to get the diff between two files from
> subversion.
> 
> I get the chunk header for the changed chunk.
> 
> But I am not finding any option to print line numbers.
> 
> Is it possible to get individual line numbers for all the changed lines?

The hunk (sic) header already includes that information: in "-a,b +c,d",
A and C are line numbers.  The output is in the standard unidiff format,
so if you want to add line numbers to every line, just pipe 'svn diff''s
output to any unidiff-aware program that shows or adds line numbers.
(I'm not aware of any off the top of my head, but it would be trivial to
write one.)

Cheers,

Daniel