Skip to content

Instantly share code, notes, and snippets.

@spotlesstofu
Last active May 2, 2025 12:24
Show Gist options
  • Save spotlesstofu/a073e0509c74777e342eefa01b60eced to your computer and use it in GitHub Desktop.
Save spotlesstofu/a073e0509c74777e342eefa01b60eced to your computer and use it in GitHub Desktop.
Help review a rebase pull request by highlighting downstream changes that have not been ported
#!/usr/bin/env sh
set -xe
CURRENT_BASE_TAG=$1
NEW_BASE_TAG=$2
REBASE_PR=$3
PR_REMOTE=openshift
[ -n "$REBASE_PR" ]
CURRENT_BASE_DIFF=current-base.diff
NEW_BASE_DIFF=new-base.diff
REBASE_BRANCH=pr-${PR_REMOTE}-${REBASE_PR}
git fetch $PR_REMOTE pull/$REBASE_PR/head:$REBASE_BRANCH
git diff ${CURRENT_BASE_TAG}..main > $CURRENT_BASE_DIFF
git diff ${NEW_BASE_TAG}..${REBASE_BRANCH} > $NEW_BASE_DIFF
diff $CURRENT_BASE_DIFF $NEW_BASE_DIFF --side-by-side --suppress-common-lines --suppress-blank-empty
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment