Skip to content

Commit

Permalink
hack/cherry-pick.sh: add APPLY_MERGE_COMMIT mode to apply the whole m…
Browse files Browse the repository at this point in the history
…erge commit
  • Loading branch information
sttts committed Aug 2, 2018
1 parent 9f41553 commit 7389420
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion hack/cherry-pick.sh
Expand Up @@ -35,7 +35,14 @@ os::build::require_clean_tree
remote="${UPSTREAM_REMOTE:-origin}"
git fetch ${remote}

selector="$(os::build::commit_range $pr ${remote}/${UPSTREAM_BRANCH:-master})"
if [[ -z "${APPLY_MERGE_COMMIT-}" ]]; then
selector="$(os::build::commit_range $pr ${remote}/${UPSTREAM_BRANCH:-master})"
else
pr_commit="$(git rev-parse ${remote}/pr/$1)"
merge="$(git merge-base ${pr_commit} ${remote}/${UPSTREAM_BRANCH:-master})"
echo "++ Will apply merge ${merge} as one commit ..."
selector="$(git rev-parse ${merge}^1)..${merge}"
fi

if [[ -z "${NO_REBASE-}" ]]; then
echo "++ Generating patch for ${selector} onto ${lastrev} ..." 2>&1
Expand Down

0 comments on commit 7389420

Please sign in to comment.