GNU bug report logs - #3479
rgrep sends directories needlessly to grep

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Severity: minor; Reported by: jidanni@HIDDEN; dated Sat, 6 Jun 2009 05:25:04 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at submit@HIDDEN:


Received: (at submit) by emacsbugs.donarmstrong.com; 6 Jun 2009 05:16:21 +0000
From jidanni@HIDDEN Fri Jun  5 22:16:21 2009
X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02
	(2008-06-10) on rzlab.ucr.edu
X-Spam-Level: 
X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available.
	hammytokens:Tokens not available.
X-Spam-Status: No, score=-1.5 required=4.0 tests=AWL,SARE_RECV_SPAM_DOMN0b
	autolearn=no version=3.2.5-bugs.debian.org_2005_01_02
Received: from lists.gnu.org (lists.gnu.org [199.232.76.165])
	by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n565GHWw003852
	for <submit@HIDDEN>; Fri, 5 Jun 2009 22:16:18 -0700
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1MCoGP-0003Rz-4m
	for bug-gnu-emacs@HIDDEN; Sat, 06 Jun 2009 01:16:17 -0400
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43)
	id 1MCoGJ-0003Rn-F3
	for bug-gnu-emacs@HIDDEN; Sat, 06 Jun 2009 01:16:15 -0400
Received: from [199.232.76.173] (port=47503 helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43)
	id 1MCoGJ-0003Rk-93
	for bug-gnu-emacs@HIDDEN; Sat, 06 Jun 2009 01:16:11 -0400
Received: from balanced.mail.policyd.dreamhost.com ([208.97.132.119]:56113 helo=homiemail-a4.g.dreamhost.com)
	by monty-python.gnu.org with esmtp (Exim 4.60)
	(envelope-from <jidanni@HIDDEN>)
	id 1MCoGJ-0002QT-0q
	for bug-gnu-emacs@HIDDEN; Sat, 06 Jun 2009 01:16:11 -0400
Received: from jidanni.org (122-127-38-104.dynamic.hinet.net [122.127.38.104])
	(using TLSv1 with cipher AES256-SHA (256/256 bits))
	(No client certificate requested)
	by homiemail-a4.g.dreamhost.com (Postfix) with ESMTP id F386640554
	for <bug-gnu-emacs@HIDDEN>; Fri,  5 Jun 2009 22:16:07 -0700 (PDT)
To: bug-gnu-emacs@HIDDEN
Subject: rgrep sends directories needlessly to grep
From: jidanni@HIDDEN
Date: Sat, 06 Jun 2009 05:39:40 +0800
Message-ID: <87k53qcqcj.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 1)

Gentlemen, I used the same string as e.g.,
(rgrep "bla" "*" "~/mediawiki/")
produced, and instead appended fgrep, and found
$ find . \( -path \*/CVS -o -path \*/.svn -o -path \*/\{arch\} -o -path \*/.hg -o -path \*/_darcs -o -path \*/.git -o -path \*/.bzr \) -prune -o  -type f \( -name \* \)|fgrep -c .svn
62
That's right, 62 .svn's, when you thought you had eliminated them. They
are all directories.

OK, now putting the print inside ( ),
$ cd ~/mediawiki/;find  . -path \*/.svn  -prune -o \( -type f \( -name \* \) -print \)|fgrep .svn
./math/.svnignore
./tests/.svnignore
Which were put there by the staff, so we have indeed eliminated what we
need to!

Therefore consider putting your ...-print0 inside a ( )!

Also only one space is needed between "-o  -type f".

(Of course grep doesn't give an error when given a directory.)




Acknowledgement sent to jidanni@HIDDEN:
New bug report received and forwarded. Copy sent to Emacs Bugs <bug-gnu-emacs@HIDDEN>. Full text available.
Report forwarded to bug-submit-list@HIDDEN, Emacs Bugs <bug-gnu-emacs@HIDDEN>:
bug#3479; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Fri, 31 Oct 2014 17:00:04 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.