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

blame on a deleted/renamed file

From
Dan McGee <dpmcgee@gmail.com>
Date
Aug 5, 2009, 12:16 UTC
Message-ID
<449c10960908050516k25ef0a92sd8616de29a93ea5f@mail.gmail.com>

Is there no easy way in git to get a blame on a file that has either been renamed or deleted? I'll step through my thought process, and a quick google and read of the manpage returned nothing obvious. Here is the repository in question if it matters: git://projects.archlinux.org/pacman.git. I located a particular commit I was interested using a plain git-blame: $ git blame scripts/makepkg.sh.in

OK, looks like lines moved around enough that we got stuck here, let's see what this patch did: $ git show e19d7da4

OK, it did a move of a bunch of lines into functions that GIT couldn't quite track: $ git annotate --follow "scripts/makepkg.in" e19d7da4~1 fatal: cannot stat path 'scripts/makepkg.in': No such file or directory

$ git annotate --follow "scripts/makepkg.sh.in" e19d7da4~1 fatal: no such path scripts/makepkg.sh.in in e19d7da4~1

Help? Or do I need to think about writing some sort of patch for it? This is the first thing I have seen svn be able to do[1] that git can't. :)

-Dan
[1] svn annotate http://path/to/repo/path/to/file@2345
Next: Björn Steinbrink
Message 1 of 8 in “blame on a deleted/renamed file”
  1. Dan McGeeAug 5, 2009
  2. Björn SteinbrinkAug 5, 2009
  3. Matthieu MoyAug 5, 2009
  4. Dan McGeeAug 5, 2009
  5. Björn SteinbrinkAug 5, 2009
  6. Thomas RastAug 5, 2009
  7. Junio C HamanoAug 5, 2009
  8. Björn SteinbrinkAug 5, 2009

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.