I donβt think that you are far away, but I also donβt think that it can be obtained directly using GIT, instead list all the monitored files first and then iterate over them each.
for file in $(git ls-files | grep \.java$) do echo "Looking at $file"; git log --pretty=format:"The author of commit %h was %ae on %aD" -- $file; echo; done
Note. Using git ls-files *.java will only display monitored java files in the current directory, and not all java files in the repo.
source share