From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 11 13:37:23 2015 Received: (at submit) by debbugs.gnu.org; 11 Dec 2015 18:37:23 +0000 Received: from localhost ([127.0.0.1]:35056 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1a7SZH-0001Tu-6S for submit@debbugs.gnu.org; Fri, 11 Dec 2015 13:37:23 -0500 Received: from eggs.gnu.org ([208.118.235.92]:59016) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1a7SZF-0001Th-DM for submit@debbugs.gnu.org; Fri, 11 Dec 2015 13:37:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a7K2v-0003bQ-SJ for submit@debbugs.gnu.org; Fri, 11 Dec 2015 04:31:26 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:50069) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a7K2v-0003bM-QE for submit@debbugs.gnu.org; Fri, 11 Dec 2015 04:31:25 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47964) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a7K2u-00033u-RW for bug-grep@gnu.org; Fri, 11 Dec 2015 04:31:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a7K2q-0003af-QM for bug-grep@gnu.org; Fri, 11 Dec 2015 04:31:24 -0500 Received: from ioooi.vinc17.net ([92.243.22.117]:57123) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a7K2q-0003Vo-LJ for bug-grep@gnu.org; Fri, 11 Dec 2015 04:31:20 -0500 Received: from smtp-zira.vinc17.net (128.119.75.86.rev.sfr.net [86.75.119.128]) by ioooi.vinc17.net (Postfix) with ESMTPSA id 3CC0E36A; Fri, 11 Dec 2015 10:31:11 +0100 (CET) Received: by zira.vinc17.org (Postfix, from userid 1000) id 16A26C2024E; Fri, 11 Dec 2015 10:31:11 +0100 (CET) Date: Fri, 11 Dec 2015 10:31:11 +0100 From: Vincent Lefevre To: bug-grep@gnu.org Subject: --exclude no longer works against arguments with a directory name Message-ID: <20151211093111.GA5481@zira.vinc17.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline X-Mailer-Info: https://www.vinc17.net/mutt/ User-Agent: Mutt/1.5.24-6539-vl-r83103 (2015-12-08) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) In grep 2.22, --exclude no longer works in some cases: $ cd /usr/share/doc/grep $ grep e --exclude README README is OK, but not: $ grep e --exclude README /usr/share/doc/grep/README Copyright (C) 1992, 1997-2002, 2004-2015 Free Software Foundation, Inc. [...] This breaks at least one of my scripts, where --exclude is used to exclude filenames generated with globbing. After reverting to grep 2.21, this problem disappeared. My Debian bug report: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=3D807641 --=20 Vincent Lef=E8vre - Web: 100% accessible validated (X)HTML - Blog: Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon) From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 11 16:37:56 2015 Received: (at 22144) by debbugs.gnu.org; 11 Dec 2015 21:37:56 +0000 Received: from localhost ([127.0.0.1]:35151 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1a7VO0-00060s-9Q for submit@debbugs.gnu.org; Fri, 11 Dec 2015 16:37:56 -0500 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:36525) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1a7VNy-00060f-Lh for 22144@debbugs.gnu.org; Fri, 11 Dec 2015 16:37:55 -0500 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 9A16E16069D; Fri, 11 Dec 2015 13:37:48 -0800 (PST) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id z0yHOf0cX38i; Fri, 11 Dec 2015 13:37:47 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id A37A5160E68; Fri, 11 Dec 2015 13:37:47 -0800 (PST) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 3gwXKdFrteyc; Fri, 11 Dec 2015 13:37:47 -0800 (PST) Received: from Penguin.CS.UCLA.EDU (Penguin.CS.UCLA.EDU [131.179.64.200]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 8B07D16069D; Fri, 11 Dec 2015 13:37:47 -0800 (PST) Subject: Re: bug#22144: --exclude no longer works against arguments with a directory name To: Vincent Lefevre , 22144@debbugs.gnu.org References: <20151211093111.GA5481@zira.vinc17.org> From: Paul Eggert Organization: UCLA Computer Science Department Message-ID: <566B422A.4070505@cs.ucla.edu> Date: Fri, 11 Dec 2015 13:37:46 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: <20151211093111.GA5481@zira.vinc17.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 22144 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) The change in grep 2.22 is due to an earlier bug report: http://bugs.gnu.org/21027 and was implemented by this patch: http://git.savannah.gnu.org/cgit/grep.git/commit/?id=c5c70eae261133d71a9436557d998a48aaf0a5fe Although I can see arguments either way, the grep 2.22 behavior is consistent with grep 2.6 and earlier, so in some sense it's more-conservative. From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 11 20:56:39 2015 Received: (at 22144) by debbugs.gnu.org; 12 Dec 2015 01:56:39 +0000 Received: from localhost ([127.0.0.1]:35212 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1a7ZQN-0005OX-20 for submit@debbugs.gnu.org; Fri, 11 Dec 2015 20:56:39 -0500 Received: from ioooi.vinc17.net ([92.243.22.117]:55524) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1a7ZQL-0005OO-5J for 22144@debbugs.gnu.org; Fri, 11 Dec 2015 20:56:37 -0500 Received: from smtp-zira.vinc17.net (128.119.75.86.rev.sfr.net [86.75.119.128]) by ioooi.vinc17.net (Postfix) with ESMTPSA id DE3ED36A; Sat, 12 Dec 2015 02:56:35 +0100 (CET) Received: by zira.vinc17.org (Postfix, from userid 1000) id A32B7C204C4; Sat, 12 Dec 2015 02:56:34 +0100 (CET) Date: Sat, 12 Dec 2015 02:56:34 +0100 From: Vincent Lefevre To: Paul Eggert Subject: Re: bug#22144: --exclude no longer works against arguments with a directory name Message-ID: <20151212015634.GB5481@zira.vinc17.org> References: <20151211093111.GA5481@zira.vinc17.org> <566B422A.4070505@cs.ucla.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <566B422A.4070505@cs.ucla.edu> X-Mailer-Info: https://www.vinc17.net/mutt/ User-Agent: Mutt/1.5.24-6539-vl-r83103 (2015-12-08) X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 22144 Cc: 22144@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) On 2015-12-11 13:37:46 -0800, Paul Eggert wrote: > The change in grep 2.22 is due to an earlier bug report: > > http://bugs.gnu.org/21027 This one was about --exclude-dir, whose description in grep 2.21 is very unclear and it was already broken anyway: zira:~> grep -rl e --exclude-dir='usr*' /usr/include zira:~> grep -rl e --exclude-dir='usr*' /usr/include/stdio.h /usr/include/stdio.h But for --exclude, the description is clear: --exclude=GLOB Skip files whose base name matches GLOB (using wildcard ^^^^^^^^^ matching). A file-name glob can use *, ?, and [...] as wildcards, and \ to quote a wildcard or backslash character literally. "base name" means base name, not the full path! I suggest that you revert the behavior for --exclude so that existing scripts are not broken, and possibly add --exclude-path to match the full path. Now, --exclude was already broken: $ grep -l . /usr/share/doc/grep/* /usr/share/doc/grep/AUTHORS /usr/share/doc/grep/NEWS.gz /usr/share/doc/grep/README /usr/share/doc/grep/THANKS.gz /usr/share/doc/grep/TODO.gz /usr/share/doc/grep/changelog.Debian.gz /usr/share/doc/grep/changelog.gz /usr/share/doc/grep/copyright $ grep -l --exclude='*e*' . /usr/share/doc/grep/* outputs nothing, while one should get: /usr/share/doc/grep/AUTHORS /usr/share/doc/grep/NEWS.gz /usr/share/doc/grep/README /usr/share/doc/grep/THANKS.gz /usr/share/doc/grep/TODO.gz /usr/share/doc/grep/copyright excluding files whose base name contains a letter "e". And with grep 2.22, this is still inconsistent: ypig:~> grep -l --exclude=AUTHORS . /usr/share/doc/grep/* /usr/share/doc/grep/AUTHORS /usr/share/doc/grep/NEWS.gz /usr/share/doc/grep/README /usr/share/doc/grep/THANKS.gz /usr/share/doc/grep/TODO.gz /usr/share/doc/grep/changelog.Debian.gz /usr/share/doc/grep/changelog.gz /usr/share/doc/grep/copyright ypig:~> grep -rl --exclude=AUTHORS . /usr/share/doc/grep /usr/share/doc/grep/TODO.gz /usr/share/doc/grep/changelog.gz /usr/share/doc/grep/changelog.Debian.gz /usr/share/doc/grep/THANKS.gz /usr/share/doc/grep/NEWS.gz /usr/share/doc/grep/copyright /usr/share/doc/grep/README -- Vincent Lefèvre - Web: 100% accessible validated (X)HTML - Blog: Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon) From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 11 22:31:56 2015 Received: (at 22144) by debbugs.gnu.org; 12 Dec 2015 03:31:56 +0000 Received: from localhost ([127.0.0.1]:35224 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1a7auZ-0007W5-LO for submit@debbugs.gnu.org; Fri, 11 Dec 2015 22:31:55 -0500 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:51349) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1a7auY-0007Vs-4t for 22144@debbugs.gnu.org; Fri, 11 Dec 2015 22:31:54 -0500 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 0C1C916066A; Fri, 11 Dec 2015 19:31:48 -0800 (PST) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id YTtrsQCf9mra; Fri, 11 Dec 2015 19:31:47 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 60540160E68; Fri, 11 Dec 2015 19:31:47 -0800 (PST) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 7B7OaMKEh4s0; Fri, 11 Dec 2015 19:31:47 -0800 (PST) Received: from Penguin.CS.UCLA.EDU (Penguin.CS.UCLA.EDU [131.179.64.200]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 47B9A16066A; Fri, 11 Dec 2015 19:31:47 -0800 (PST) Subject: Re: bug#22144: --exclude no longer works against arguments with a directory name To: Vincent Lefevre References: <20151211093111.GA5481@zira.vinc17.org> <566B422A.4070505@cs.ucla.edu> <20151212015634.GB5481@zira.vinc17.org> From: Paul Eggert Organization: UCLA Computer Science Department Message-ID: <566B9522.2030100@cs.ucla.edu> Date: Fri, 11 Dec 2015 19:31:46 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: <20151212015634.GB5481@zira.vinc17.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 22144 Cc: 22144@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) On 12/11/2015 05:56 PM, Vincent Lefevre wrote: > or --exclude, the description is clear: The description changed in grep 2.22, to match the 2.22 (also, 2.6-and-earlier) behavior. As you say, the 2.22 behavior does not seem ideal. However, the 2.7 through 2.21 behavior wasn't ideal either. It's not clear which behavior is better overall, nor is it clear whether we could unify parts of the two behaviors to get the best of both worlds. I'd rather not add yet another option in this area, if that can be avoided. From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 15 03:59:49 2015 Received: (at 22144) by debbugs.gnu.org; 15 Dec 2015 08:59:49 +0000 Received: from localhost ([127.0.0.1]:52186 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1a8lSW-0003TR-Pb for submit@debbugs.gnu.org; Tue, 15 Dec 2015 03:59:48 -0500 Received: from ioooi.vinc17.net ([92.243.22.117]:56020) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1a8lSV-0003TJ-3q for 22144@debbugs.gnu.org; Tue, 15 Dec 2015 03:59:47 -0500 Received: from smtp-zira.vinc17.net (128.119.75.86.rev.sfr.net [86.75.119.128]) by ioooi.vinc17.net (Postfix) with ESMTPSA id D7E611C0; Tue, 15 Dec 2015 09:59:45 +0100 (CET) Received: by zira.vinc17.org (Postfix, from userid 1000) id 90ABEC207B6; Tue, 15 Dec 2015 09:59:43 +0100 (CET) Date: Tue, 15 Dec 2015 09:59:43 +0100 From: Vincent Lefevre To: Paul Eggert Subject: Re: bug#22144: --exclude no longer works against arguments with a directory name Message-ID: <20151215085943.GA15131@zira.vinc17.org> References: <20151211093111.GA5481@zira.vinc17.org> <566B422A.4070505@cs.ucla.edu> <20151212015634.GB5481@zira.vinc17.org> <566B9522.2030100@cs.ucla.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <566B9522.2030100@cs.ucla.edu> X-Mailer-Info: https://www.vinc17.net/mutt/ User-Agent: Mutt/1.5.24-6539-vl-r83103 (2015-12-08) X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 22144 Cc: 22144@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) On 2015-12-11 19:31:46 -0800, Paul Eggert wrote: > On 12/11/2015 05:56 PM, Vincent Lefevre wrote: > >or --exclude, the description is clear: > > The description changed in grep 2.22, to match the 2.22 (also, > 2.6-and-earlier) behavior. My quote was from the grep 2.22 description (grep 2.22-1 Debian package). It seems that this has changed later: http://www.gnu.org/software/grep/manual/grep.html which is different: Skip files whose name matches the pattern glob, using wildcard matching. When searching recursively, skip any subfile whose base name matches glob; the base name is the part after the last ‘/’. A pattern can use ‘*’, ‘?’, and ‘[’...‘]’ as wildcards, and \ to quote a wildcard or backslash character literally. The documentation is still ambiguous. For the "main case", is this the canonical name as returned by realpath? > As you say, the 2.22 behavior does not seem ideal. By doing a difference for subfiles of a recursive search, this is even worse! -- Vincent Lefèvre - Web: 100% accessible validated (X)HTML - Blog: Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon) From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 15 18:27:39 2015 Received: (at 22144) by debbugs.gnu.org; 15 Dec 2015 23:27:39 +0000 Received: from localhost ([127.0.0.1]:53042 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1a8z0N-00081P-GC for submit@debbugs.gnu.org; Tue, 15 Dec 2015 18:27:39 -0500 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:47072) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1a8z0L-00081C-3n for 22144@debbugs.gnu.org; Tue, 15 Dec 2015 18:27:37 -0500 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id E38671601A7; Tue, 15 Dec 2015 15:27:30 -0800 (PST) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id yiKbdt5wA1GX; Tue, 15 Dec 2015 15:27:30 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 4CB3116066A; Tue, 15 Dec 2015 15:27:30 -0800 (PST) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id IRTIgxXtEV5n; Tue, 15 Dec 2015 15:27:30 -0800 (PST) Received: from [192.168.1.9] (pool-100-32-155-148.lsanca.fios.verizon.net [100.32.155.148]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 25BEB1601A7; Tue, 15 Dec 2015 15:27:30 -0800 (PST) Subject: Re: bug#22144: --exclude no longer works against arguments with a directory name To: Vincent Lefevre References: <20151211093111.GA5481@zira.vinc17.org> <566B422A.4070505@cs.ucla.edu> <20151212015634.GB5481@zira.vinc17.org> <566B9522.2030100@cs.ucla.edu> <20151215085943.GA15131@zira.vinc17.org> From: Paul Eggert Organization: UCLA Computer Science Department Message-ID: <5670A1DF.3080308@cs.ucla.edu> Date: Tue, 15 Dec 2015 15:27:27 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <20151215085943.GA15131@zira.vinc17.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 22144 Cc: 22144@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) Vincent Lefevre wrote: > For the "main case", is this > the canonical name as returned by realpath? I don't see why. grep doesn't need to compute anything's realpath. From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 15 20:00:22 2015 Received: (at 22144) by debbugs.gnu.org; 16 Dec 2015 01:00:22 +0000 Received: from localhost ([127.0.0.1]:53067 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1a90S5-0001et-UC for submit@debbugs.gnu.org; Tue, 15 Dec 2015 20:00:22 -0500 Received: from ioooi.vinc17.net ([92.243.22.117]:56136) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1a90S3-0001el-UO for 22144@debbugs.gnu.org; Tue, 15 Dec 2015 20:00:20 -0500 Received: from smtp-zira.vinc17.net (128.119.75.86.rev.sfr.net [86.75.119.128]) by ioooi.vinc17.net (Postfix) with ESMTPSA id 8FC3A29F; Wed, 16 Dec 2015 02:00:18 +0100 (CET) Received: by zira.vinc17.org (Postfix, from userid 1000) id 23FF0C207B9; Wed, 16 Dec 2015 02:00:18 +0100 (CET) Date: Wed, 16 Dec 2015 02:00:18 +0100 From: Vincent Lefevre To: Paul Eggert Subject: Re: bug#22144: --exclude no longer works against arguments with a directory name Message-ID: <20151216010018.GC15131@zira.vinc17.org> References: <20151211093111.GA5481@zira.vinc17.org> <566B422A.4070505@cs.ucla.edu> <20151212015634.GB5481@zira.vinc17.org> <566B9522.2030100@cs.ucla.edu> <20151215085943.GA15131@zira.vinc17.org> <5670A1DF.3080308@cs.ucla.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <5670A1DF.3080308@cs.ucla.edu> X-Mailer-Info: https://www.vinc17.net/mutt/ User-Agent: Mutt/1.5.24-6539-vl-r83103 (2015-12-08) X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 22144 Cc: 22144@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) On 2015-12-15 15:27:27 -0800, Paul Eggert wrote: > Vincent Lefevre wrote: > >For the "main case", is this > >the canonical name as returned by realpath? > > I don't see why. grep doesn't need to compute anything's realpath. How is the file name defined, then? -- Vincent Lefèvre - Web: 100% accessible validated (X)HTML - Blog: Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon) From debbugs-submit-bounces@debbugs.gnu.org Wed Dec 16 01:24:34 2015 Received: (at 22144) by debbugs.gnu.org; 16 Dec 2015 06:24:34 +0000 Received: from localhost ([127.0.0.1]:53150 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1a95Vq-0000Py-08 for submit@debbugs.gnu.org; Wed, 16 Dec 2015 01:24:34 -0500 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:59969) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1a95Vo-0000Pl-Da for 22144@debbugs.gnu.org; Wed, 16 Dec 2015 01:24:32 -0500 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 600DB1601A7; Tue, 15 Dec 2015 22:24:26 -0800 (PST) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id RCj3fYVdNT6S; Tue, 15 Dec 2015 22:24:25 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id AFE1816066A; Tue, 15 Dec 2015 22:24:25 -0800 (PST) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id S45HtzevvvQJ; Tue, 15 Dec 2015 22:24:25 -0800 (PST) Received: from [192.168.1.9] (pool-100-32-155-148.lsanca.fios.verizon.net [100.32.155.148]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 914711601A7; Tue, 15 Dec 2015 22:24:25 -0800 (PST) Subject: Re: bug#22144: --exclude no longer works against arguments with a directory name To: Vincent Lefevre References: <20151211093111.GA5481@zira.vinc17.org> <566B422A.4070505@cs.ucla.edu> <20151212015634.GB5481@zira.vinc17.org> <566B9522.2030100@cs.ucla.edu> <20151215085943.GA15131@zira.vinc17.org> <5670A1DF.3080308@cs.ucla.edu> <20151216010018.GC15131@zira.vinc17.org> From: Paul Eggert Organization: UCLA Computer Science Department Message-ID: <56710399.8000707@cs.ucla.edu> Date: Tue, 15 Dec 2015 22:24:25 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <20151216010018.GC15131@zira.vinc17.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 22144 Cc: 22144@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) Vincent Lefevre wrote: > How is the file name defined, then? It's built as a string, which is passed to 'open' without worrying about realpath. By the way in case it's not already clear, I agree with you that the current behavior is not good, it's just that we can't simply revert (as that was also not good), we need to make it better. From debbugs-submit-bounces@debbugs.gnu.org Wed Dec 16 05:26:46 2015 Received: (at 22144) by debbugs.gnu.org; 16 Dec 2015 10:26:47 +0000 Received: from localhost ([127.0.0.1]:53226 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1a99IE-0005zR-Ne for submit@debbugs.gnu.org; Wed, 16 Dec 2015 05:26:46 -0500 Received: from ioooi.vinc17.net ([92.243.22.117]:56189) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1a99IC-0005zH-Pt for 22144@debbugs.gnu.org; Wed, 16 Dec 2015 05:26:45 -0500 Received: from smtp-zira.vinc17.net (128.119.75.86.rev.sfr.net [86.75.119.128]) by ioooi.vinc17.net (Postfix) with ESMTPSA id 8D025242; Wed, 16 Dec 2015 11:26:43 +0100 (CET) Received: by zira.vinc17.org (Postfix, from userid 1000) id 36EF2C20549; Wed, 16 Dec 2015 11:26:43 +0100 (CET) Date: Wed, 16 Dec 2015 11:26:43 +0100 From: Vincent Lefevre To: Paul Eggert Subject: Re: bug#22144: --exclude no longer works against arguments with a directory name Message-ID: <20151216102643.GD15131@zira.vinc17.org> References: <20151211093111.GA5481@zira.vinc17.org> <566B422A.4070505@cs.ucla.edu> <20151212015634.GB5481@zira.vinc17.org> <566B9522.2030100@cs.ucla.edu> <20151215085943.GA15131@zira.vinc17.org> <5670A1DF.3080308@cs.ucla.edu> <20151216010018.GC15131@zira.vinc17.org> <56710399.8000707@cs.ucla.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <56710399.8000707@cs.ucla.edu> X-Mailer-Info: https://www.vinc17.net/mutt/ User-Agent: Mutt/1.5.24-6539-vl-r83103 (2015-12-08) X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 22144 Cc: 22144@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) On 2015-12-15 22:24:25 -0800, Paul Eggert wrote: > Vincent Lefevre wrote: > >How is the file name defined, then? > > It's built as a string, which is passed to 'open' without worrying > about realpath. So, for instance, "foo" and "./foo" are regarded as different? The way how files are regarded to be the same needs to be clarified. For instance, some utilities consider the device & inode numbers (which have their own problems with broken FS implementations). That's the case of cp (if this has not changed since 2004). That's also the case of diff (if this has not changed since 2005), but you know that. :) -- Vincent Lefèvre - Web: 100% accessible validated (X)HTML - Blog: Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon) From debbugs-submit-bounces@debbugs.gnu.org Wed Dec 16 18:12:26 2015 Received: (at 22144) by debbugs.gnu.org; 16 Dec 2015 23:12:26 +0000 Received: from localhost ([127.0.0.1]:53959 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1a9LFC-0001fu-IW for submit@debbugs.gnu.org; Wed, 16 Dec 2015 18:12:26 -0500 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:45563) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1a9LFA-0001fg-KL for 22144@debbugs.gnu.org; Wed, 16 Dec 2015 18:12:25 -0500 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 9F226160DFE; Wed, 16 Dec 2015 15:12:18 -0800 (PST) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id qZvcf4-anW_Z; Wed, 16 Dec 2015 15:12:18 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 04E78160E2A; Wed, 16 Dec 2015 15:12:18 -0800 (PST) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id EGtCcgDRXCpM; Wed, 16 Dec 2015 15:12:17 -0800 (PST) Received: from [192.168.1.9] (pool-100-32-155-148.lsanca.fios.verizon.net [100.32.155.148]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id DC70C160DFE; Wed, 16 Dec 2015 15:12:17 -0800 (PST) Subject: Re: bug#22144: --exclude no longer works against arguments with a directory name To: Vincent Lefevre References: <20151211093111.GA5481@zira.vinc17.org> <566B422A.4070505@cs.ucla.edu> <20151212015634.GB5481@zira.vinc17.org> <566B9522.2030100@cs.ucla.edu> <20151215085943.GA15131@zira.vinc17.org> <5670A1DF.3080308@cs.ucla.edu> <20151216010018.GC15131@zira.vinc17.org> <56710399.8000707@cs.ucla.edu> <20151216102643.GD15131@zira.vinc17.org> From: Paul Eggert Organization: UCLA Computer Science Department Message-ID: <5671EFD1.7060407@cs.ucla.edu> Date: Wed, 16 Dec 2015 15:12:17 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <20151216102643.GD15131@zira.vinc17.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 22144 Cc: 22144@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) Vincent Lefevre wrote: > So, for instance, "foo" and "./foo" are regarded as different? Yes. Grep does not need to worry about inodes or realpath or anything like that, so it doesn't. From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 28 04:09:55 2015 Received: (at 22144) by debbugs.gnu.org; 28 Dec 2015 09:09:55 +0000 Received: from localhost ([127.0.0.1]:45302 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aDToR-00079M-8H for submit@debbugs.gnu.org; Mon, 28 Dec 2015 04:09:55 -0500 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:39973) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aDToP-00079A-PK for 22144@debbugs.gnu.org; Mon, 28 Dec 2015 04:09:54 -0500 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id EE423160095; Mon, 28 Dec 2015 01:09:47 -0800 (PST) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id wpk3cEDxejwf; Mon, 28 Dec 2015 01:09:46 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 7E45A160D25; Mon, 28 Dec 2015 01:09:46 -0800 (PST) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id uAZaUXftee0O; Mon, 28 Dec 2015 01:09:46 -0800 (PST) Received: from [192.168.1.9] (pool-100-32-155-148.lsanca.fios.verizon.net [100.32.155.148]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 52757160095; Mon, 28 Dec 2015 01:09:46 -0800 (PST) Subject: Re: bug#22144: --exclude no longer works against arguments with a directory name To: Vincent Lefevre References: <20151211093111.GA5481@zira.vinc17.org> <566B422A.4070505@cs.ucla.edu> <20151212015634.GB5481@zira.vinc17.org> <566B9522.2030100@cs.ucla.edu> <20151215085943.GA15131@zira.vinc17.org> From: Paul Eggert Organization: UCLA Computer Science Department Message-ID: <5680FC54.2060902@cs.ucla.edu> Date: Mon, 28 Dec 2015 01:09:40 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <20151215085943.GA15131@zira.vinc17.org> Content-Type: multipart/mixed; boundary="------------050507000809080209030500" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 22144 Cc: 22144@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) This is a multi-part message in MIME format. --------------050507000809080209030500 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Vincent Lefevre wrote: > The documentation is still ambiguous. For the "main case", is this > the canonical name as returned by realpath? > >> >As you say, the 2.22 behavior does not seem ideal. > By doing a difference for subfiles of a recursive search, this is > even worse! Please try the attached patch, which I've installed into the savannah repository. It attempts to fix the behavior, and to clarify the documentation. It is a tricky area. Hope this helps. --------------050507000809080209030500 Content-Type: text/x-diff; name="0001-grep-exclude-matches-trailing-parts-of-args.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0001-grep-exclude-matches-trailing-parts-of-args.patch" >From 7dc95d5dd3965df188533ac1ffef903cf41a11e5 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 28 Dec 2015 01:04:18 -0800 Subject: [PATCH] grep: --exclude matches trailing parts of args Problem reported by Vincent Lefevre in: http://bugs.gnu.org/22144 * NEWS: * doc/grep.texi (File and Directory Selection): Document this. * src/grep.c (excluded_patterns, excluded_directory_patterns): Now 2-element arrays, with one element for subfiles and another for command-line args. All uses changed. This implements the change. (exclude_options): New function. * tests/include-exclude: Test the change. --- NEWS | 5 ++++ doc/grep.texi | 13 +++++++---- src/grep.c | 65 +++++++++++++++++++++++++++++++++------------------ tests/include-exclude | 4 +++- 4 files changed, 58 insertions(+), 29 deletions(-) diff --git a/NEWS b/NEWS index fc5fd3a..4e54b49 100644 --- a/NEWS +++ b/NEWS @@ -8,6 +8,11 @@ GNU grep NEWS -*- outline -*- invalid UTF8 just before a match. [bug introduced in grep-2.22] + --exclude and related options are now matched against trailing + parts of command-line arguments, not against the entire arguments. + This partly reverts the --exclude-related change in 2.22. + [bug introduced in grep-2.22] + * Noteworthy changes in release 2.22 (2015-11-01) [stable] diff --git a/doc/grep.texi b/doc/grep.texi index e3495bb..76c7f46 100644 --- a/doc/grep.texi +++ b/doc/grep.texi @@ -661,8 +661,10 @@ this is equivalent to the @option{-r} option. @opindex --exclude @cindex exclude files @cindex searching directory trees -Skip files whose name matches the pattern @var{glob}, using wildcard -matching. When searching recursively, skip any subfile whose base +Skip any command-line file with a name suffix that matches the pattern +@var{glob}, using wildcard matching; a name suffix is either the whole +name, or any suffix starting after a @samp{/} and before a +non-@samp{/}. When searching recursively, skip any subfile whose base name matches @var{glob}; the base name is the part after the last @samp{/}. A pattern can use @samp{*}, @samp{?}, and @samp{[}...@samp{]} as wildcards, @@ -679,9 +681,10 @@ under @option{--exclude}). @item --exclude-dir=@var{glob} @opindex --exclude-dir @cindex exclude directories -Skip any directory whose name matches the pattern @var{glob}. When -searching recursively, skip any subdirectory whose base name matches -@var{glob}. Ignore any redundant trailing slashes in @var{glob}. +Skip any command-line directory with a name suffix that matches the +pattern @var{glob}. When searching recursively, skip any subdirectory +whose base name matches @var{glob}. Ignore any redundant trailing +slashes in @var{glob}. @item -I Process a binary file as if it did not contain matching data; diff --git a/src/grep.c b/src/grep.c index 2c5e09a..19ba208 100644 --- a/src/grep.c +++ b/src/grep.c @@ -296,8 +296,8 @@ static const struct color_cap color_dict[] = { NULL, NULL, NULL } }; -static struct exclude *excluded_patterns; -static struct exclude *excluded_directory_patterns; +static struct exclude *excluded_patterns[2]; +static struct exclude *excluded_directory_patterns[2]; /* Short options. */ static char const short_options[] = "0123456789A:B:C:D:EFGHIPTUVX:abcd:e:f:hiLlm:noqRrsuvwxyZz"; @@ -640,19 +640,30 @@ context_length_arg (char const *str, intmax_t *out) } } +/* Return the add_exclude options suitable for excluding a file name. + If COMMAND_LINE, it is a command-line file name. */ +static int +exclude_options (bool command_line) +{ + return EXCLUDE_WILDCARDS | (command_line ? 0 : EXCLUDE_ANCHORED); +} + /* Return true if the file with NAME should be skipped. If COMMAND_LINE, it is a command-line argument. If IS_DIR, it is a directory. */ static bool skipped_file (char const *name, bool command_line, bool is_dir) { - return (is_dir - ? (directories == SKIP_DIRECTORIES - || (! (command_line && omit_dot_slash) - && excluded_directory_patterns - && excluded_file_name (excluded_directory_patterns, name))) - : (excluded_patterns - && excluded_file_name (excluded_patterns, name))); + struct exclude **pats; + if (! is_dir) + pats = excluded_patterns; + else if (directories == SKIP_DIRECTORIES) + return true; + else if (command_line && omit_dot_slash) + return false; + else + pats = excluded_directory_patterns; + return pats[command_line] && excluded_file_name (pats[command_line], name); } /* Hairy buffering mechanism for grep. The intent is to keep @@ -2446,28 +2457,36 @@ main (int argc, char **argv) case EXCLUDE_OPTION: case INCLUDE_OPTION: - if (!excluded_patterns) - excluded_patterns = new_exclude (); - add_exclude (excluded_patterns, optarg, - (EXCLUDE_ANCHORED | EXCLUDE_WILDCARDS - | (opt == INCLUDE_OPTION ? EXCLUDE_INCLUDE : 0))); + for (int cmd = 0; cmd < 2; cmd++) + { + if (!excluded_patterns[cmd]) + excluded_patterns[cmd] = new_exclude (); + add_exclude (excluded_patterns[cmd], optarg, + ((opt == INCLUDE_OPTION ? EXCLUDE_INCLUDE : 0) + | exclude_options (cmd))); + } break; case EXCLUDE_FROM_OPTION: - if (!excluded_patterns) - excluded_patterns = new_exclude (); - if (add_exclude_file (add_exclude, excluded_patterns, optarg, - EXCLUDE_ANCHORED | EXCLUDE_WILDCARDS, '\n') != 0) + for (int cmd = 0; cmd < 2; cmd++) { - error (EXIT_TROUBLE, errno, "%s", optarg); + if (!excluded_patterns[cmd]) + excluded_patterns[cmd] = new_exclude (); + if (add_exclude_file (add_exclude, excluded_patterns[cmd], + optarg, exclude_options (cmd), '\n') + != 0) + error (EXIT_TROUBLE, errno, "%s", optarg); } break; case EXCLUDE_DIRECTORY_OPTION: - if (!excluded_directory_patterns) - excluded_directory_patterns = new_exclude (); strip_trailing_slashes (optarg); - add_exclude (excluded_directory_patterns, optarg, - EXCLUDE_ANCHORED | EXCLUDE_WILDCARDS); + for (int cmd = 0; cmd < 2; cmd++) + { + if (!excluded_directory_patterns[cmd]) + excluded_directory_patterns[cmd] = new_exclude (); + add_exclude (excluded_directory_patterns[cmd], optarg, + exclude_options (cmd)); + } break; case GROUP_SEPARATOR_OPTION: diff --git a/tests/include-exclude b/tests/include-exclude index 6a9d269..c3d22a1 100755 --- a/tests/include-exclude +++ b/tests/include-exclude @@ -66,9 +66,11 @@ for exclude in 'x' 'x*'; do grep -rl --exclude-dir="$exclude" . x > out test $? -eq 1 || fail=1 compare /dev/null out || fail=1 +done +for exclude in 'x' 'x*' './x' './x*'; do grep -rl --exclude-dir="$exclude" . ./x | sort > out || fail=1 - compare exp-dotnames out || fail=1 + compare /dev/null out || fail=1 done Exit $fail -- 2.5.0 --------------050507000809080209030500-- From debbugs-submit-bounces@debbugs.gnu.org Wed Dec 30 09:24:32 2015 Received: (at 22144) by debbugs.gnu.org; 30 Dec 2015 14:24:32 +0000 Received: from localhost ([127.0.0.1]:49434 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aEHg0-0003cv-0N for submit@debbugs.gnu.org; Wed, 30 Dec 2015 09:24:32 -0500 Received: from ioooi.vinc17.net ([92.243.22.117]:58196) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aEHfy-0003cm-9t for 22144@debbugs.gnu.org; Wed, 30 Dec 2015 09:24:30 -0500 Received: from smtp-zira.vinc17.net (jlefevre.net1.nerim.net [80.65.226.245]) by ioooi.vinc17.net (Postfix) with ESMTPSA id B4A3831E; Wed, 30 Dec 2015 15:24:28 +0100 (CET) Received: by zira.vinc17.org (Postfix, from userid 1000) id B4159C20C8F; Wed, 30 Dec 2015 15:24:27 +0100 (CET) Date: Wed, 30 Dec 2015 15:24:27 +0100 From: Vincent Lefevre To: Paul Eggert Subject: Re: bug#22144: --exclude no longer works against arguments with a directory name Message-ID: <20151230142427.GN5163@zira.vinc17.org> References: <20151211093111.GA5481@zira.vinc17.org> <566B422A.4070505@cs.ucla.edu> <20151212015634.GB5481@zira.vinc17.org> <566B9522.2030100@cs.ucla.edu> <20151215085943.GA15131@zira.vinc17.org> <5680FC54.2060902@cs.ucla.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <5680FC54.2060902@cs.ucla.edu> X-Mailer-Info: https://www.vinc17.net/mutt/ User-Agent: Mutt/1.5.24-6542-vl-r83103 (2015-12-17) X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 22144 Cc: 22144@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) On 2015-12-28 01:09:40 -0800, Paul Eggert wrote: > Vincent Lefevre wrote: > > The documentation is still ambiguous. For the "main case", is this > > the canonical name as returned by realpath? > > > > > >As you say, the 2.22 behavior does not seem ideal. > > By doing a difference for subfiles of a recursive search, this is > > even worse! > > Please try the attached patch, which I've installed into the savannah > repository. It attempts to fix the behavior, and to clarify the > documentation. It is a tricky area. Hope this helps. I've done various tests, and it seems fine. Thanks. -- Vincent Lefèvre - Web: 100% accessible validated (X)HTML - Blog: Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon) From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 31 01:37:26 2015 Received: (at 22144-done) by debbugs.gnu.org; 31 Dec 2015 06:37:26 +0000 Received: from localhost ([127.0.0.1]:50857 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aEWrW-0001tj-Ic for submit@debbugs.gnu.org; Thu, 31 Dec 2015 01:37:26 -0500 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:39139) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aEWrV-0001tW-0L for 22144-done@debbugs.gnu.org; Thu, 31 Dec 2015 01:37:25 -0500 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 43ACC160ED0; Wed, 30 Dec 2015 22:37:17 -0800 (PST) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id Ak7Z0twNEZCo; Wed, 30 Dec 2015 22:37:16 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 8523B160ED7; Wed, 30 Dec 2015 22:37:16 -0800 (PST) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 9Tj2Vn1s4-ld; Wed, 30 Dec 2015 22:37:16 -0800 (PST) Received: from [192.168.1.9] (pool-100-32-155-148.lsanca.fios.verizon.net [100.32.155.148]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 5E558160ED0; Wed, 30 Dec 2015 22:37:16 -0800 (PST) Subject: Re: bug#22144: --exclude no longer works against arguments with a directory name To: Vincent Lefevre References: <20151211093111.GA5481@zira.vinc17.org> <566B422A.4070505@cs.ucla.edu> <20151212015634.GB5481@zira.vinc17.org> <566B9522.2030100@cs.ucla.edu> <20151215085943.GA15131@zira.vinc17.org> <5680FC54.2060902@cs.ucla.edu> <20151230142427.GN5163@zira.vinc17.org> From: Paul Eggert Organization: UCLA Computer Science Department Message-ID: <5684CD1C.5070900@cs.ucla.edu> Date: Wed, 30 Dec 2015 22:37:16 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <20151230142427.GN5163@zira.vinc17.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 22144-done Cc: 22144-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) Vincent Lefevre wrote: > I've done various tests, and it seems fine. Thanks. You're welcome; closing the bug report. From unknown Sun Jun 15 08:55:11 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 28 Jan 2016 12:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator