[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: differencing only header files

From: Shlomi Fish <shlomif_at_shlomifish.org>
Date: Fri, 22 Jul 2011 23:39:40 +0300

On Fri, 22 Jul 2011 15:01:09 -0500
Steve Cohen <scohen_at_javactivity.org> wrote:

> Is there an easy way to restrict svn diff operation to files of a
> certain extension (say .h)? A quick glance at the manual suggested
> nothing to me.
>

A hacky way would be to use something like:

$ ack -g '\.h$' | xargs -d '\n' svn diff

Here it does this:

<<<<<<<<<
shlomif[fcs]:$trunk/fc-solve/source$ ack -g '\.h$' | xargs -d '\n' svn diff
Index: scans.h
===================================================================
--- scans.h (revision 3977)
+++ scans.h (working copy)
@@ -72,3 +72,4 @@
 #endif
 
 #endif /* FC_SOLVE__SCANS_H */
+hello
svn: 'prefix.h' is not under version control
shlomif[fcs]:$trunk/fc-solve/source$
>>>>>>>>

For information about ack, see:

http://betterthangrep.com/

As you can see, it warns because it finds non-versioned files. This can be
dealt with using:

$ ack -g '\.h$' | (while read T; do (svn info "$T" > /dev/null 2>&1) && echo
"$T" ; done) | xargs -d '\n' svn diff

Alternatively, you can use the Subversion APIs (or one of their higher
language bindings) to write a custom diff command.

Regards,

        Shlomi Fish

-- 
-----------------------------------------------------------------
Shlomi Fish       http://www.shlomifish.org/
Chuck Norris/etc. Facts - http://www.shlomifish.org/humour/bits/facts/
Chuck Norris is the greatest man in history. He killed all the great men who
could ever pose a competition.
Please reply to list if it's a mailing list post - http://shlom.in/reply .
Received on 2011-07-22 22:51:01 CEST

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.