geometry-zsh / geometry

geometry is a minimal, fully customizable and composable zsh prompt theme
ISC License
931 stars 94 forks source link

Guard against stderr output in non-git directories #296

Closed duncanbeevers closed 4 years ago

duncanbeevers commented 4 years ago

This is a naive guard to prevent stderr spew when navigating directories in non-.git folder hierarchies.

This is the first bit of zsh scripting I've done; if there's a way to memoize this guard to make it more efficient that would be cool; there's lots of wasted work done otherwise.

I wrote this by working one-by-one through the geometry_git_* calls as sequenced in the meta geometry_git, identifying those that emitted unwanted output (stderr or stdout) and added the guard to just those calls.