Add trimmed-down version of Spark's PR merge script.