If you try to checkout the already current branch in git, git creates
HEAD.lock and renames it to HEAD. This causes the inode of HEAD to
change and so the inotify file watcher stops tracking HEAD.
The fix is to re-create the inotify watch when the file attributes
change. This is a bit of a performance penalty as most of the time the
attribute changes are simple last modified time/size changes, but since
inotify provides no way to know specifically when the inode has changed,
this is the best we can do.
No need to bother both developers (that need to create class names compatible
with file name, which is not obvious if not looking into main Powerline class)
and computer (that needs to recompute class name each time) if it is possible to
bother only developers (or only computer, but this contributes to higher startup
times).
About not obvious: when you look into zsh_prompt.py and see only
ZshPromptRenderer name you only think that powerline upstream is following
strict code style. You don’t think there is a technical reason for such naming,
like you don’t think there is technical reason for having blank lines. When you
look into zsh_prompt.py and see `renderer = ZshPromptRenderer` it is obvious
that there is technical reason for writing code this way because new variable is
never used in the module itself.