I've tried (and will keep using) this version. But this first echo should, IMHO, not include a leading space. Let the guy constructing his prompt decide about leading/trailing whitespace. 
I'm using it like so:
`printf ']%s ' (__informative_git_prompt)`