Executing commands in PS1 on macOS Sierra not working?
With a minimal test case (minus, of course, the frivolous colors) it appears that the quoting of PS1 is important:

gitfoo () {
    echo &gt;&amp;2 "was run"
    git status -bs 2&gt;/dev/null | head -1
}
#PS1="x$(gitfoo)x "
PS1='x$(gitfoo)x '