On Fri, 22 Jul 2011 15:01:09 -0500 Steve Cohen <sco...@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 .