Last active
September 20, 2018 23:33
-
-
Save filiph/a63aa722d13e5d01041c368b0675399b to your computer and use it in GitHub Desktop.
A script that tells you whether a commit has landed to any of the Flutter channels (`master`, `dev` and `beta`). Useful when you're waiting to use a feature or remove a workaround to a bug.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -o vi | |
# Change this accordingly. | |
# You may have github.com/flutter/flutter named as "upstream". | |
REMOTE_NAME=origin | |
# The hash we search for when no argument is given. | |
DEFAULT_HASH=76468dd | |
if [ -z "$1" ] | |
then | |
echo "You can provide the commit hash you're interested in as argument." | |
echo "Defaulting to $DEFAULT_HASH." | |
HASH=$DEFAULT_HASH | |
else | |
HASH=$1 | |
echo "Searching for commit $HASH." | |
fi | |
FLUTTER_TOOL_PATH=`which flutter` | |
DIR=`dirname $FLUTTER_TOOL_PATH`/.. | |
cd $DIR | |
git fetch > /dev/null | |
git branch -r $REMOTE_NAME/master --contains $HASH | |
git branch -r $REMOTE_NAME/dev --contains $HASH | |
git branch -r $REMOTE_NAME/beta --contains $HASH |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment