I currently maintain a project for a git-prompt for bash (https://github.com/magicmonty/bash-git-prompt) and I just got a bug report (https://github.com/magicmonty/bash-git-prompt/issues/97) from someone who works with Docker, who tells me, that everytime he uses the prompt, the cache is invalidated, because the .git
directory is constantly touched.
I have looked into this, and found out, that it is the command git status
, which touches the .git
directory.
It seems, that only the directory entry itself and no contents are touched.
Can anyone explain, why this is needed, or is this maybe a bug in Git.
Is there a way to show all status info, without touching the .git directory?
Thanks for the help
Update:
Since the whole reason to use the git status
command was, to determine the number of untracked files, I replaced it with git ls-files --others --exclude-standard | wc -l
, which doesn't need a lock.