From: Matthias Lederhofer Date: Fri, 30 Jun 2006 18:20:09 GMT Subject: Re: [PATCH] git-grep: --and to combine patterns with and instead of or Message-ID: In-Reply-To: <7vfyhmil07.fsf@assigned-by-dhcp.cox.net> Junio C Hamano wrote: > Matthias Lederhofer 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.