13

Is there a way to list files created by a specific author using Git? I also need to filter these results, either by filename (regex/pattern) or folder where they were created.

So what I'm looking for is a list of created (not updated) files by author without filename duplication and without commit messages.

Vadorequest
  • 16,593
  • 24
  • 118
  • 215
  • See http://stackoverflow.com/questions/4259996/how-can-i-view-a-git-log-of-just-one-users-commits – Pascal Precht Jun 09 '14 at 14:17
  • What I want to do is a bit more complicated than a `git log author=foobar`. The closest I found yet is `git whatchanged --author="foobar" --name-only --oneline` – Vadorequest Jun 09 '14 at 14:23

3 Answers3

21

List all commits adding files, showing the commit author and the added files; then paste the author to the front of each file listed:

# add `--author=pattern` to the log arguments to restrict by author
# add anything you like to the `--format=` template
# add any restrictions you like to the `/^A\t/` selector in the awk,
#     ... say /^A\t/ && /\.c$/ { etc.

git log --name-status --diff-filter=A --format='> %aN' \
| awk '/^>/ {tagline=$0}
       /^A\t/ {print tagline "\t" $0}'
jthill
  • 55,082
  • 5
  • 77
  • 137
  • 10
    Perfect: `git log --author="Vadorequest" --name-status --diff-filter=A --format='> %aN' | awk '/^>/ {tagline=$0} /^A\t/ {print tagline "\t" $0}'`. Thank you! – Vadorequest Jun 10 '14 at 07:19
5

try this

$ git whatchanged --author="yourAthor" --name-only

And also here you have some filters

http://gitref.org/inspect/

Miktown
  • 89
  • 5
  • Closer, but I don't want to see it by commit, neither the commit message and without filename duplication. But thanks. – Vadorequest Jun 09 '14 at 14:25
0
git whatchanged --author="AuthorName" --name-only --oneline | grep FilePath | sort | uniq -c
daidai21
  • 170
  • 2
  • 11