threads / discuss / 19876

Feature suggestion: git grep --blame

Subject: Feature suggestion: git grep --blame

## tl;dr

2 messages between Jun 20, 2009 and Jun 20, 2009.

replies: 1people: 2as markdown or json

David Christensen· Jun 20, 2009, 15:29 UTC · lore
Hey folks,

It's occurred to me on several occasions that a useful output option for `git grep` would be to prefix lines with the same commit/author/ date annotation that `git blame` shows when viewing an individual file. I didn't find anything myself with a quick google search so I was wondering if anyone a) has a recipe for this either with a trivial command alias (I couldn't come up with one myself), b) know if this has been done/attempted before, or c) have a reason why this is a really stupid idea? :-)

Regards,

David -- David Christensen End Point Corporation david@endpoint.com

René Scharfe· Jun 20, 2009, 18:19 UTC · re: David Christensen · lore

Re: Feature suggestion: git grep --blame

David Christensen schrieb:
Show 10 quoted lines
> Hey folks,
> 
> It's occurred to me on several occasions that a useful output option for
> `git grep` would be to prefix lines with the same commit/author/date
> annotation that `git blame` shows when viewing an individual file.  I
> didn't find anything myself with a quick google search so I was
> wondering if anyone a) has a recipe for this either with a trivial
> command alias (I couldn't come up with one myself), b) know if this has
> been done/attempted before, or c) have a reason why this is a really
> stupid idea? :-)

This is a very good idea -- so good, in fact, that Pi Song sent patches to implement it a quarter ago. There were a few issues which prevented them from being merged unchanged. Junio merged an initial cleanup patch into pu instead ("blame.c: start libifying the blame infrastructure", 97926c6c). Work on the remaining parts seems to have stalled, though. Pi Song?

René

← back to recent threads