Split find_rebase_point to its own function so we can use it to scan other refs
Fix indent and message formatting
\e -> \033 for bash 3 compat (OS X)