git log -p .
only within the current directory but not in subdirectories
equivalent
svn log --diff --depth files .
Is it possible?
How about:
$ git log -p file1 file2 ...
Or, if they're too many to type:
$ find . -maxdepth 1 -type f | xargs git log -p
On Linux or the like you can list only the files in the current directory with:
ls -p | grep -v /
so:
git log -p `ls -p | grep -v /`
is one way to do it.
Something like this will work:
git log --all --pretty=format: --name-only --relative="$(git rev-parse --show-prefix)" -- . | sed '/\//d ; /^[[:space:]]*$/d' | sort | uniq | xargs git log -p --
--relative
will remove files not from this directory and also remove the subdirectory prefix from the file names.git log -p
. The --
is needed otherwise it won't know what to do with the deleted files.It seems like an inefficient way of completing the task but I don't think git has the concept of "every file", it just has the current set of files and a list of diffs. So you have to go through every change set to get the complete list.