git: list files authored by someone and limit them to those existing in HEAD

Viewed 74

We list all the files contributed by certain developer as follows:

git log --no-merges --author="SomeDev" --name-only --pretty=format:"" | sort -u

The problem with this approach that it lists also files that were created by SomeDev at some point but later removed. How can I limit the above only to those files currently present in HEAD? (Maybe that output can be piped together with git ls-files somehow).

Preferably

  1. it should track renames also, i.e.: if SomeDev has authored file_old.txt and it was later renamed (by him or anybody else) to file_new.txt - it should be listed as well.
  2. it should list the first(/original) author if a file has several authors (e.g. when it was removed and then readded).
0 Answers
Related