Skip to content

Instantly share code, notes, and snippets.

@filiph
Last active September 20, 2018 23:33
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save filiph/a63aa722d13e5d01041c368b0675399b to your computer and use it in GitHub Desktop.
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.
#!/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