From: Albert Yale Date: Mon, 23 Jan 2012 17:10:39 GMT Subject: Re: [PATCH/RFC] Fix the result of "git grep -l -C " Message-ID: In-Reply-To: <8762g2ieq0.fsf@thomas.inf.ethz.ch> You're right. This solution is incomplete. It needs to take into account "opt.unmatch_name_only", and possibly other states. I'm open for suggestions. I've just posted Version 2 of this patch. As for creating a test, I'm unfamiliar with the testing procedure for git-core. A "how to" in the "Documentation" folder would be very useful in that regard. Albert On Mon, Jan 23, 2012 at 11:08 AM, Thomas Rast wrote: > Albert Yale writes: > >> When combining "git grep -l" with "-C ", >> the first result is omitted. > [...] >> For example, if the following command should output a list of 3 >> different files (a.txt, b.txt, c.txt): >> >> $ git grep -l -C 1 albert_yale >> b.txt >> c.txt > > Nice catch.  Can you add a test? > > Is -l the only option affected?  Why isn't, for example, -L? > > -- > Thomas Rast > trast@{inf,student}.ethz.ch