[PATCH] Switch implementations of merge-base, port to parsing