Make gerrit git-flow compatible with MacOSX

* Use BRE instead of ERE
* | wc -l should be tested as integer
* Fix fails to error on blank strings when used with "local"