user32882
user32882

Reputation: 5877

Prevent svn from outputtting unnecessary diff lines

For one particular source file, I generated a reference patch file using TortoiseMerge. The patch file shows only lines where an actual change occurs. For example:

@@ -87 +87 @@
-                Particles(I)%Mass
+                MassArray(I)
@@ -91 +91 @@
-                  Particles(I)%Mass
+                  MassArray(I)

However when I use the command line diff option this is what I get

svn diff --old FileName.FOR@6382 --new FileName.FOR@6383

@@ -84,11 +84,11 @@
               end if
               TotalParticleMass = &
                 TotalParticleMass + &
-                Particles(I)%Mass
+                MassArray(I)
               if (IsVirtualParticle(I)) then
                 TotalVirtualParticleMass =  &
                   TotalVirtualParticleMass + &
-                  Particles(I)%Mass
+                  MassArray(I)
               end if
             end do
             write(TVMunit, '(I12, G12.4, G12.4, I12, I12, I12)')  &

As you can see the file generated by the command line also includes lines which are not different. I really don't need this information for my current purposes.

How can I just get the modified lines using the command line? I need something identical to the patch file.

Thanks

Upvotes: 1

Views: 35

Answers (1)

uzsolt
uzsolt

Reputation: 6027

You should use external diff with -U0 option (number lines of unified context):

svn diff --diff-cmd /usr/bin/diff -x'-U0' ...

Upvotes: 1

Related Questions