I would like to visual the file system actions that are caused by running something like git lg -n3
. I'm on a Mac. So I thought, ok let's run dtruss git lg -n3
.
Unfortunately this doesn't give me the expected output. I would expect to see file access to some files at .git/objects
.
Is dtruss
not what I'm looking for?
I should add that I also don't see the output of git log
when I run it through dtruss
. If I run dtruss git
I see the output of the git command overview at least. Am I doing it wrong?
UPDATE
Ok, turns out it's a problem with how dtruss handles the multi word command git log
. If I use dtruss /usr/local/git/libexec/git-core/git-log
it works as expected.
I can go further and run dtruss /usr/local/git/libexec/git-core/git-log -n3 2>&1 | grep access
and get pretty much what I was looking for. So the only remaining question really would be why I have to use the full path to git-log
instead of just the git log
command.
On UNIXoid systems like Linux (embedded or desktop) I like to use inotify-tools for that purpose, e.g. inotifywait or inotifywatch, depending on my exact purpose.
Edit: I wonder why someone has downvoted my answer. Inotify-tools is a specialised set of tools for monitoring file system access, and this is what was asked. I would appreciate a remark with a request for clarification first, if my answer does not seem to be good or relevant enough. Thank you.