Reputation: 276
I often use git log --name-only
when viewing the log to see what files each commit changed or introduced. Git tacks on a list of file paths to each log entry.
However, if you use git log --name-only path-to-file
you will just get the commits involving that file as expected, but it will only additionally list the file specified rather than the full list of files that commit changed. Making it quite useless. This behavior was seen for Git version 2.1.4.
Is there a different incantation available to list all files changed per commit when viewing the log for a particular file?
Upvotes: 0
Views: 63
Reputation: 275
I believe that you're are asking for git log -p --full-diff
. Here is the definition from that command:
--full-diff
Without this flag, git log -p <path>... shows commits that touch the
specified paths, and diffs about the same specified paths. With this, the
full diff is shown for commits that touch the specified paths; this means
that "<path>…" limits only commits, and doesn’t limit diff for those commits.
You can see this web page to search for more advanced ways to search logs.
Upvotes: 1
Reputation: 95080
git log --pretty=%H $FILENAME | while read sha1
do
git show --pretty='%nCommit: %h' --name-only $sha1
done
Upvotes: 0