Thread (7 messages) flat view 7 messages, 5 authors, 2016-06-15

Re: feature request: excluding files/paths from "git grep"

From: Trevor Saunders <hidden>
Date: 2016-06-15 23:03:56

On Sat, Feb 28, 2015 at 07:06:16PM -0800, Junio C Hamano wrote:
Trevor Saunders [off-list ref] writes:
quoted
 There have been cases where I wanted grep to always ignore certain
 files, but to still get text diffs for those files.  One case is people
 insist on using ChangeLog files, and another is people who commit
 generated files of one sort or another.
The attributes are to say "the contents to be stored in this file is
of this nature".  Something inherent to the type of the contents,
and that is why there is no way to countermand them from the command
line.

The "nature of the content" may be "result of comparing two versions
of them textually will never make sense to humans", or "result of
finding substrings in them will never make sense to humans", which
are what "-diff" and hypothetical "-grep" mean, respectively.

"It is inconvenient that I see hits in ChangeLog files when I look
for string BUG" does not make ChangeLog inherently "result of
finding substrings in it never makes sense to humans"-kind of file
type.  Maybe somebody who is playing a role of a coder right now may
not look at existing ChangeLog entries, but when that same person
plays the role of a release manager next day, running grep on older
ChangeLog files may become necessary to find changes related to
recent changes.  For these "per-invocation" differences, attributes
to declare permenent/inherent nature of the contents is much less
suited than per-invocation inclusion/exclusion mechanism based on
pathspecs, I would think.
I think that makes some amount of sense, however typing stuff like
--exclude=ChangeLog all the time is not terribly easy on the hands.
Would it make sense to instead add a config variable grep.exclude?

Trev
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help