Re: [PATCH 0/7] grep.c: teach --column to 'git-grep(1)'
- From
Taylor Blau <me@ttaylorr.com>
- Date
- Jun 19, 2018, 18:02 UTC
- Message-ID
- <20180619180225.GA50589@syl.attlocal.net>
- In-Reply-To
- <xmqqo9g6vet5.fsf@gitster-ct.c.googlers.com>
On Tue, Jun 19, 2018 at 10:58:30AM -0700, Junio C Hamano wrote:
Show 20 quoted lines
> Jeff King <peff@peff.net> writes: > > > Although there are interesting cases around inversion. For example: > > > > git grep --not \( --not -e a --and --not -e b \) > > > > is equivalent to: > > > > git grep -e a --or -e b > > > > Do people care if we actually hunt down the exact column where we > > _didn't_ match "b" in the first case? The two are equivalent, but I > > have to wonder if somebody writing the first one really cares. > > I may be misunderstanding the question, but I personally would feel > that "git grep --not <ANYTHING>" is OK to say "the entire line is at > fault that it did not satisify the criteria to match <ANYTHING>". > I.e., I'd be happy if --column marked the first column as the > beginning of the match, or --color painted the entire line in the > output of the former.
I think that Peff is pointing out that a short-circuiting OR will cause a line like
b foo a
to print the column for "a", not "b" (when given "-e a --or -e b").
Thanks, Taylor