I can do this just fine:
git log --format=%h -- filename | while read f; do git show $f:filename; done
However, if I try to add --follow
to the git log
call, the file moves through directories and changes names, so the git show
call fails on the path change. I've tried inserting various things to grab the full path (fullname=`ls-tree --name-only $f -- filename`
, etc.) and passing it on to git show
, but nothing's working, and I'm not finding much with google and SO searches. I feel like I'm missing something obvious, like a git log --format
trick.
I'd also accept just getting all the full path names the file has ever been, and a way to get the full history of no-longer existing paths. Then I could take this in stages, though of course I'd prefer the all-at-once approach.