git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git blame for a commit

From
Jakub Narebski <jnareb@gmail.com>
Date
Jun 23, 2008, 16:29 UTC
Message-ID
<200806231829.22004.jnareb@gmail.com>
In-Reply-To
<alpine.LFD.1.10.0806231149470.27742@sys-0.hiltweb.site>
On Mon, 23 Jun 2008, Ian Hilt wrote:
Show 10 quoted lines
> On Mon, 23 Jun 2008 at 3:01am -0700, Jakub Narebski wrote:
> 
> > 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).
> 
> Maybe I'm missing something, but I thought git-blame only worked with
> the files in the Git working directory.  Therefore, if a file had been
> deleted it would not be reachable with git-blame, whether you diff'ed
> the pre- and post-image or not.

You can give blame the revision to start blaming from; that's what I meant the "pre-image" blame (staring from parent revision).

I'm not that sure if it is the best solution...
-- 
Jakub Narebski
Poland
Previous: Ian Hilt
Message 6 of 6 in “git blame for a commit”
  1. Mircea BardacJun 22, 2008
  2. Ian HiltJun 23, 2008
  3. Mircea BardacJun 23, 2008
  4. Jakub NarebskiJun 23, 2008
  5. Ian HiltJun 23, 2008
  6. Jakub NarebskiJun 23, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.