public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Andreas Ericsson <ae@op5•se>
To: Junio C Hamano <junkio@cox•net>
Cc: Matthias Lederhofer <matled@gmx•net>, git@vger•kernel.org
Subject: Re: [PATCH] git-grep: --and to combine patterns with and instead of or
Date: Mon, 03 Jul 2006 09:54:22 +0200	[thread overview]
Message-ID: <44A8CD2E.8020208@op5.se> (raw)
In-Reply-To: <7vejx6k54p.fsf@assigned-by-dhcp.cox.net>

Junio C Hamano wrote:
> Matthias Lederhofer <matled@gmx•net> writes:
> 
> 
>>Junio C Hamano wrote:
>>
>>>I see you are trying hard to think of a way to justify your
>>>original prefix "--and" (or --FOO) implementation, but I simply
>>>do not see much point in that.  I doubt changing the default
>>>operator from --or to --and is less confusing than changing the
>>>precedence for the users, so you would hear the same "I
>>>personally feel FOO should not even exist" objection from me.
>>
>>It just happens to make more sense to me and I don't see a reason not to
>>add this. If no one else is interested in this I'll just stop arguing :)
>>Here again an overview of the arguments if anyone is interested:
>>- Less to type for common searches using only AND (or more ANDs than
>>  ORs).
>>- Easy to implement (both with and without extended expressions).
>>- AND/* is the normal implicit operator in other contexts than grep
>>  (math).
>>- The high precedence operator (AND) should be implicit rather than
>>  the low precedence one (OR) (so this is only fulfilled when the
>>  option is used).
> 
> 
> Side note.  It would be interesting to have a slightly different
> form of --and called --near.  You would use it like this:
> 
> 	git grep -C -e AND --near -e OR
> 
> to find lines that has AND on it, and within the context
> distance there is a line that has OR on it.  The lines that are
> hit with such a query are still the ones that have AND on them
> (in other words, a line that has OR is used to further filter
> out the results so it will be prefixed with '-', not ':', unless
> that line happens to also have AND on it).
> 

It would also be neat to have --inside main or some such, to make it 
only check for things inside whatever's printed on the diff --git line.

-- 
Andreas Ericsson                   andreas.ericsson@op5•se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

  parent reply	other threads:[~2006-07-03  7:54 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-25 15:38 [PATCH] git-grep: allow patterns starting with - Matthias Lederhofer
2006-06-25 15:47 ` Timo Hirvonen
2006-06-25 16:07   ` [PATCH] correct documentation for git grep Matthias Lederhofer
2006-06-25 23:10     ` Johannes Schindelin
2006-06-25 23:39       ` Matthias Lederhofer
2006-06-26  0:06         ` Matthias Lederhofer
2006-06-26  6:59           ` Johannes Schindelin
2006-06-26  0:02       ` [PATCH] git-grep: --and to combine patterns with and instead of or Matthias Lederhofer
2006-06-29 22:20         ` Thomas Glanzmann
2006-06-29 22:44           ` Junio C Hamano
2006-06-30  2:25             ` Matthias Lederhofer
2006-06-30  4:13               ` Junio C Hamano
2006-06-30  7:46                 ` Matthias Lederhofer
2006-06-30  7:56                   ` Junio C Hamano
2006-06-30 10:08                     ` [PATCH] git-grep: boolean expression on pattern matching Junio C Hamano
2006-06-30 10:24                       ` Jakub Narebski
2006-06-30 10:29                         ` Junio C Hamano
2006-06-30 15:11                       ` Matthias Lederhofer
2006-06-30 10:57                     ` [PATCH] git-grep: --and to combine patterns with and instead of or Matthias Lederhofer
2006-06-30 15:57                       ` Junio C Hamano
2006-06-30 17:04                         ` Matthias Lederhofer
2006-06-30 17:18                           ` Junio C Hamano
2006-06-30 17:33                             ` Jakub Narebski
2006-06-30 17:49                               ` Matthias Lederhofer
2006-06-30 17:58                                 ` Junio C Hamano
2006-06-30 18:20                                   ` Matthias Lederhofer
2006-06-30 18:03                                 ` Jakub Narebski
2006-06-30 18:16                                   ` Junio C Hamano
2006-06-30 19:11                                     ` Jakub Narebski
2006-06-30 20:26                                       ` Junio C Hamano
2006-07-03  7:54                         ` Andreas Ericsson [this message]
2006-06-25 16:18   ` [PATCH] git-grep: allow patterns starting with - Matthias Lederhofer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=44A8CD2E.8020208@op5.se \
    --to=ae@op5$(echo .)se \
    --cc=git@vger$(echo .)kernel.org \
    --cc=junkio@cox$(echo .)net \
    --cc=matled@gmx$(echo .)net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox