From: Matthieu Moy Date: Wed, 06 Apr 2016 06:05:40 GMT Subject: Re: Can `git grep` have `--Author` option? Message-ID: In-Reply-To: <8737qztya5.fsf@gmail.com> Chen Bin writes: > This is a feature request. > > From time to time, I want to re-use MY code. So git grep with --Author > options is really useful. My current git version is 2.6.3, looks it > doesn't have this option. Git doesn't "know" which line of code is yours. What it can do is walk through history to find out: this is "git blame", and you can already do "git blame | grep ...". A "git grep --author" would need to blame all files before searching inside them, or grep first and blame each line in the result to filter out lines from the wrong author. That would be possible, but relatively hard to implement and painfully slow. Which probably explains why no one implemented it yet ... -- Matthieu Moy http://www-verimag.imag.fr/~moy/