Re: git blame for a commit
- From
Jakub Narebski <jnareb@gmail.com>
- Date
- Jun 23, 2008, 10:01 UTC
- Message-ID
- <m3ve00lbby.fsf@localhost.localdomain>
- In-Reply-To
- <485F6710.1080300@mircea.bardac.net>
Mircea Bardac <dev@mircea.bardac.net> writes:
Show 23 quoted lines
> Ian Hilt wrote: >> On Sun, 22 Jun 2008 at 11:32pm +0100, Mircea Bardac wrote: >>> >>> Is there any straightforward way of doing git blame for all the >>> files that got changed in a commit. Problems are renames, deletes >>> and copies. >> >> Sounds like you want to track files rather than content. Git tracks >> the >> latter. > > Hmm... I'm not really sure that my initial intention was to track > files. I've given this some more thought and I realized that what I > actually want is a "git diff" with blame info included. I want this > information in order to facilitate code reviewing. > > It is true that this would be a front-end functionality, but I am not > sure at the moment what the best approach would be for something like > this. I would see this something like > $ git diff --blame[="parameters_for_blame"] commit1..commit2 > but this is just a thought. > > Has anyone tried blaming a "git diff"?
I think you could script it using "git diff", and "git blame -L m,n", where line ranges would be calculated from git diff header for post-image, or both pre-image and post-image (in the case of deletions).
-- Jakub Narebski Poland ShadeHawk on #git