Files
qdrant/tools/missed_cherry_picks.sh
Tim Visée e1a69099fc Add script to list commits that have yet to be picked into master (#2108)
* Add script to list commits that have yet to be picked into master

This allows us to easily detect cherry-picks we missed from dev to
master on our release branch.

* Update missed cherry picks ignore hash
2023-06-28 14:57:49 +02:00

30 lines
912 B
Bash
Executable File

#!/usr/bin/env bash
# List all commits that have not been cherry-picked from dev into master yet
#
# Example usage:
# ./missed_cherry_picks.sh
set -euo pipefail
# Ignore all commits upto and including this commit hash on dev
IGNORE_UPTO=1d035501a4de27065e6fefe7bcff7cfa4d754713
# Fetch latest branch info from remote
git fetch -q origin master
git fetch -q origin dev
# Get remote/local commit hash of dev, user must have up-to-date branch
REMOTE_SHA=$(git log -n 1 --pretty=format:"%H" origin/dev)
LOCAL_SHA=$(git log -n 1 --pretty=format:"%H" dev)
if [[ "$REMOTE_SHA" != "$LOCAL_SHA" ]]; then
echo Error: your local dev branch must match the current remote
echo To pull latest dev, use: git checkout dev \&\& git pull --ff-only origin dev
exit 1
fi
# List all commits yet-to-be-cherry-picked
git cherry -v origin/master origin/dev $IGNORE_UPTO \
| grep --color=never '^+ ' \
| cut -d' ' -f2-