GNU bug report logs - #33699
Multi-component paths ignored by --{exclude,include}-dir ?

Previous Next

Package: grep;

Reported by: Lyude Paul <lyude <at> redhat.com>

Date: Tue, 11 Dec 2018 00:19:02 UTC

Severity: normal

Tags: notabug

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


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

From: Lyude Paul <lyude <at> redhat.com>
To: bug-grep <at> gnu.org
Subject: Multi-component paths ignored by --{exclude,include}-dir ?
Date: Mon, 10 Dec 2018 18:48:22 -0500
Hi! Sorry for bugging you, but I noticed something a little peculiar about
grep that I wasn't expecting, and I'm not sure if this is a bug or not.
I've been trying to use grep in one of my scripts to exclude files from
any directories starting with Documentation/output using --exclude-dir.
Example:

grep vcpi_ . -rl --exclude-dir Documentation/output

However, this doesn't seem to work at all as it returns:

./Module.symvers
./drivers/gpu/drm/radeon/radeon_dp_mst.c
./drivers/gpu/drm/drm_dp_mst_topology.c
./drivers/gpu/drm/nouveau/dispnv50/disp.c
./drivers/gpu/drm/nouveau/nvkm/engine/disp/rootnv50.c
./drivers/gpu/drm/nouveau/include/nvif/cl5070.h
./drivers/gpu/drm/Module.symvers
./drivers/gpu/drm/i915/intel_dp_mst.c
./drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
./include/drm/drm_dp_mst_helper.h
./Documentation/output/gpu/drm-kms-helpers.html
./Documentation/output/gpu/drm-dp-mst-helpers.html
./Documentation/output/gpu/dp-mst.html
./Documentation/output/genindex.html
./Documentation/output/latex/gpu.aux
./Documentation/output/latex/gpu.tex
./Documentation/output/searchindex.js

I would have thought maybe this could be worked around by using
--exclude instead:

grep vcpi_ . -rl --exclude '.*Documentation/output.*'

But the result is the same. Is this intentional, or an actual bug?
Either way, at the very least it seems like something that should be
clarified in the man page.
-- 
Cheers,
	Lyude Paul





This bug report was last modified 5 years and 203 days ago.

Previous Next


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