magicmonty/bash-git-prompt — pull request #71 by aks (2014-08-28 18:54:40+00:00)
Title: Optimizations & aesthetics

Don't look for the same file each prompt update; use the envar.
Don't redefine the same prompt color names each prompt update; the variables are global.
Don't redefine the same git prompt color mappings on each prompt update; the variables are global.

Turns out that the `declare -g`'s were not needed.

Some small aesthetic changes:

- use `"$foo"` not `"${foo}"`. Curly braces are only needed when the surrounding token is a alphanumeric, or, an array reference. Sometimes, they add readability.
- numbers don't need to be quoted: `[[ "$value" = 1 ]]` is better than `[[ "x$val" == "x1" ]]`. The latter triggers a _regexp_ match which is unnecessary, and expensive.