Can I get git to tell me all the files one user has modified?

I would like git to give me a list of all the files modified by one user, across all commits.

My particular use case is that I've been involved in the i18n of a ruby on rails project, and we want to know what files have already been done and what files still need to be done. The users in question have only done work on the i18n, not on the rest of the code base. So the information should all be in git, but I'm not sure how to get it out.


Solution 1:

This will give you a simple list of files, nothing else:

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

Switch --author for --committer as necessary.

Solution 2:

This isn't the only way, but it works:

git log --pretty="%H" --author="authorname" |
    while read commit_hash
    do
        git show --oneline --name-only $commit_hash | tail -n+2
    done | sort | uniq

Or, as one line:

git log --pretty="%H" --author="authorname" | while read commit_hash; do git show --oneline --name-only $commit_hash | tail -n+2; done | sort | uniq

Solution 3:

Try git log --stat --committer=<user>. Just put the user's name on the --committer= option (or use --author= as appropriate).

This will spit out all the files per commit, so there will likely be some duplication.