This example is very enlightening. I was kind of aware that one could run shell functions and even use a GIT function in my prompt, but I never thought it through and your example brings the point home.
I’ll waste most probably a few hours to find my perfect prompt function!