Re: svn commit: r9106 - trunk/contrib/client-side

Florian Weimer <[email protected]> Thu, 18 Mar 2004 11:21:13 +0100
Newsgroups gmane.comp.version-control.subversion.svn,gmane.mail.eyebrowse.devel
Message-ID <[email protected]>
[email protected] wrote:

> Add a shell script that makes grepping a working copy painless.  No more
> worrying about the admin dirs or text-base.
> 
> * contrib/client-side/wcgrep
>   New file.

Nice.  Here's a suggestion for two changes.

* contrib/client-side/wcgrep
  Document GNU findutils and GNU grep dependency.
  Pass -H option to grep to always print the file name.  Otherwise, it
  could happen that xargs invokes the last grep process with only one
  file argument, and grep doesn't print the file name by default if just
  one file is searched.

Index: wcgrep
===================================================================
--- wcgrep	(revision 9107)
+++ wcgrep	(working copy)
@@ -11,6 +11,8 @@
 # If no path is given the current working directory is searched not stdin.
 # Other than that it will take any parameter or pattern your standard grep
 # does.
+#
+# This script requires GNU findutils and GNU grep.
 
 arg_count=$#
 for (( i=1; i <= $arg_count; i++ )); do
@@ -33,4 +35,4 @@
 done
 
 find $pathargs -regex '.*~$\|.*/\.svn\(/\|$\)' -prune -o -type f -print0 | \
-    xargs -r0 grep $grepargs $pattern 
+    xargs -r0 grep -H $grepargs $pattern 

-- 
Current mail filters: many dial-up/DSL/cable modem hosts, and the
following domains: atlas.cz, bigpond.com, freenet.de, hotmail.com,
libero.it, netscape.net, postino.it, tiscali.co.uk, tiscali.cz,
tiscali.it, voila.fr, wanadoo.fr, yahoo.com.