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

2015-03-04 Thread Junio C Hamano
Jeff King writes: > On Wed, Mar 04, 2015 at 12:56:10PM -0800, Junio C Hamano wrote: > >> > As in, while working on a specific project, I sometimes just want to >> > exclude, for the time being, a bunch of stuff from 'git grep'. >> >> The key word here is "for the time being", though. What would

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

2015-03-04 Thread Jeff King
On Wed, Mar 04, 2015 at 12:56:10PM -0800, Junio C Hamano wrote: > > As in, while working on a specific project, I sometimes just want to > > exclude, for the time being, a bunch of stuff from 'git grep'. > > The key word here is "for the time being", though. What would you > do once you are done

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

2015-03-04 Thread Junio C Hamano
Noel Grandin writes: > On 2015-03-02 02:50 PM, Trevor Saunders wrote: >> I think they solve somewhat different problems, but maybe my problem >> is so specialized I should just have a wrapper around grep that >> changes defaults. Trev > > I'm with Trevor on this one. While I see the appeal of th

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

2015-03-04 Thread Noel Grandin
On 2015-03-02 02:50 PM, Trevor Saunders wrote: I think they solve somewhat different problems, but maybe my problem is so specialized I should just have a wrapper around grep that changes defaults. Trev I'm with Trevor on this one. While I see the appeal of the generality of a macro solution,

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

2015-03-02 Thread Trevor Saunders
On Sun, Mar 01, 2015 at 03:22:11PM -0800, Junio C Hamano wrote: > Trevor Saunders writes: > > >> ... 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 >

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

2015-03-01 Thread Junio C Hamano
Trevor Saunders writes: >> ... 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, ho

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

2015-03-01 Thread Trevor Saunders
On Sat, Feb 28, 2015 at 07:06:16PM -0800, Junio C Hamano wrote: > Trevor Saunders writes: > > > 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 peo

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

2015-02-28 Thread Junio C Hamano
Trevor Saunders writes: > 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

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

2015-02-27 Thread Junio C Hamano
Michael J Gruber writes: > Junio C Hamano venit, vidit, dixit 26.02.2015 21:59: > >> So that does not sound to me a summary of the discussion at all. > > Well, your conditional > >> I do not recall its conclusion, but it it were "Yes, that is what it >> means", then it might be reasonable to: >>

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

2015-02-27 Thread Michael J Gruber
Junio C Hamano venit, vidit, dixit 26.02.2015 21:59: > Michael J Gruber writes: > >> So, as a summary of the discussion, it seems it's time to switch the >> default to --textconv for git grep? > > Hmmm, why? > > Nobody seems to be asking for such a change in this thread. The > original issue I

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

2015-02-27 Thread Trevor Saunders
On Wed, Feb 25, 2015 at 02:11:08PM -0500, Jeff King wrote: > On Wed, Feb 25, 2015 at 11:01:22AM -0800, Junio C Hamano wrote: > > > Jeff King writes: > > > > > So I think _if_ using "diff" attributes is enough for this purpose, then > > > there is no code to be written. But if somebody wants to

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

2015-02-26 Thread Junio C Hamano
Michael J Gruber writes: > So, as a summary of the discussion, it seems it's time to switch the > default to --textconv for git grep? Hmmm, why? Nobody seems to be asking for such a change in this thread. The original issue IIRC was that the grep output was unnecessary for some paths and the r

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

2015-02-26 Thread Duy Nguyen
On Thu, Feb 26, 2015 at 6:16 PM, Michael J Gruber wrote: > So, as a summary of the discussion, it seems it's time to switch the > default to --textconv for git grep? Either that or make it clearer in git-grep.txt about this diff attribute. It takes me some time to make the connection after readin

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

2015-02-26 Thread Michael J Gruber
Jeff King venit, vidit, dixit 25.02.2015 20:11: > On Wed, Feb 25, 2015 at 11:01:22AM -0800, Junio C Hamano wrote: > >> Jeff King writes: >> >>> So I think _if_ using "diff" attributes is enough for this purpose, then >>> there is no code to be written. But if somebody wants to draw a >>> distinc

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

2015-02-25 Thread Jeff King
On Wed, Feb 25, 2015 at 11:01:22AM -0800, Junio C Hamano wrote: > Jeff King writes: > > > So I think _if_ using "diff" attributes is enough for this purpose, then > > there is no code to be written. But if somebody wants to draw a > > distinction between the uses (I want to diff "foo" files, bu

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

2015-02-25 Thread Junio C Hamano
Jeff King writes: > So I think _if_ using "diff" attributes is enough for this purpose, then > there is no code to be written. But if somebody wants to draw a > distinction between the uses (I want to diff "foo" files, but never see > them in grep) then we could introduce a "grep" attribute (wit

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

2015-02-25 Thread Jeff King
On Wed, Feb 25, 2015 at 10:33:53AM -0800, Junio C Hamano wrote: > Jeff King writes: > > > If it's an attribute of the file, and not the request, maybe > > gitattributes would be a better fit. You can already do this with: > > > > *.foo -diff > > > > in your .gitattributes file, though that _al

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

2015-02-25 Thread Junio C Hamano
Jeff King writes: > If it's an attribute of the file, and not the request, maybe > gitattributes would be a better fit. You can already do this with: > > *.foo -diff > > in your .gitattributes file, though that _also_ marks the files as "not > for diffing", which may not be desired. There's not

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

2015-02-25 Thread Jeff King
On Wed, Feb 25, 2015 at 08:46:37PM +0700, Duy Nguyen wrote: > On Wed, Feb 25, 2015 at 7:23 PM, Noel Grandin wrote: > > What would be nice is a per-user/repo config setting that excludes certain > > files and paths from the 'git grep' search. > > > > Does this sound reasonable/acceptable? > > The

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

2015-02-25 Thread Duy Nguyen
On Wed, Feb 25, 2015 at 7:23 PM, Noel Grandin wrote: > What would be nice is a per-user/repo config setting that excludes certain > files and paths from the 'git grep' search. > > Does this sound reasonable/acceptable? There is no config setting to do that, but since v1.9.5 you can use ':!' or ':

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

2015-02-25 Thread Noel Grandin
Hi In our repo (LibreOffice) we have various test files which tend to show up on 'grit grep', which just generate noise because (a) they have lots of common keywords that one might search for in them and (b) they have very little in the way of linebreaks So they tend to generate a lot of noise