GNU bug report logs - #68666
warning if --exclude-dir arg contains /?

Previous Next

Package: grep;

Reported by: Karl Berry <karl <at> freefriends.org>

Date: Mon, 22 Jan 2024 23:49:02 UTC

Severity: normal

Full log


Message #8 received at 68666 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Karl Berry <karl <at> freefriends.org>, 68666 <at> debbugs.gnu.org
Subject: Re: bug#68666: warning if --exclude-dir arg contains /?
Date: Mon, 22 Jan 2024 21:37:26 -0800
On 2024-01-22 15:48, Karl Berry wrote:
> Would it be crazy for  grep --exclude-dir=foo/bar  to give a warning?
> 
> Since, as I understand it, any non-trailing / in the arg can never match
> since the arg is matched against the basename.

That's not quite true, as it can match command-line arguments. For example:

  $ grep -rl . lib/* | grep '^lib/unictype/\.gitignore$'
  lib/unictype/.gitignore
  $ grep --exclude-dir=lib/unictype -rl . lib/* | grep 
'^lib/unictype/\.gitignore$'
  $

It should be possible to give useful warnings in some cases, though.

It's too bad the rules are so complicated - that's partly my fault, as 
the various options were added at different times and I didn't think 
things through as suggestions were made. Probably too late to change the 
meaning of existing options now, though.




This bug report was last modified 1 year and 207 days ago.

Previous Next


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