It is already possible to use filters in Git. But embedding the current file name in the expanded string is somewhat harder.
You can do this by some edit wrapper which inserts the file name “at the right time”, but I think it is much more cleaner to do this in the git-filter script.
For Puppet I want system administrators to see from which directory in the Git repository the file came from, like so: