Re: [PATCH] git-grep: --and to combine patterns with and instead of or
- From
- Matthias Lederhofer <matled@gmx.net>
- Date
- Jun 30, 2006, 18:20 UTC
- Message-ID
- <E1FwNb7-0000BL-Ad@moooo.ath.cx>
- In-Reply-To
- <7vfyhmil07.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano wrote:
Show 6 quoted lines
> Matthias Lederhofer <matled@gmx.net> writes: > > > -e foo --or --near \( -e A -- or -e B \) > > would mean lines containing foo or having A or B in the context. > > How would that "--near" be useful? You will see A or B either way.
Ok, this example was quite bad.
If --near is binary -e foo --and ( --near=3:0 -e A --or --near=0:3 -e B ) could not be done anymore, could it (without repeating the first pattern)? (Find foo with A in the 3 lines before or B in the 3 lines after the line.) Without different contexts for multiple --near it probably does not matter if --near is binary or unary.