Created
September 20, 2018 21:00
-
-
Save filiph/a2c402dff58d37b18817cdafbb6ac65c to your computer and use it in GitHub Desktop.
A script that tells you whether a commit has landed to which Flutter branch.
This file contains 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 | |
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 | |
# Change this accordingly. | |
# You may have github.com/flutter/flutter named as "upstream". | |
REMOTE_NAME=origin | |
set -o vi | |
FLUTTER_TOOL_PATH=`which flutter` | |
DIR=`dirname $FLUTTER_TOOL_PATH`/.. | |
cd $DIR | |
git pull > /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