Add long-line output option and clean up target branch calculation.