Skip to content

Instantly share code, notes, and snippets.

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