Are_we_there_yet.sh -- simple tool to check if a commit has made it to Flutter stable

Here’s something I wrote a long time ago and still find useful from time to time: a tool to check whether a specific github.com/flutter/flutter commit has been merged into one of the branches.

Let’s say a fix you care about has just been approved and merged into main. Unless you’re on the bleeding edge, you probably need to wait until it’s in stable or beta. But how do you check this quickly?

AFAIK, the easiest way is by using the shell script below, which I wrote some very long time ago (the year was 2018!).

Usage:

This will list all the important branches the commit has been merged into so far.

Output for a commit that just landed in main:

Searching for commit 8eab409.
Commit is merged into:
  upstream/main

Output for a commit that’s already all the way in stable:

Commit is merged into:
  upstream/main
  upstream/beta
  upstream/stable

Source code

Here’s the complete source code:

#!/usr/bin/env bash
set -o vi

# Change this accordingly.
# You may have github.com/flutter/flutter named as "origin", "upstream", or any other string.
REMOTE_NAME=upstream

# 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`/..

# Overriding the heuristic above.
DIR="/Users/filiph/dev/flutter"

cd $DIR
# echo $DIR

git fetch $REMOTE_NAME # > /dev/null

echo "Commit is merged into:"
git branch -r $REMOTE_NAME/main --contains $HASH
git branch -r $REMOTE_NAME/beta --contains $HASH
git branch -r $REMOTE_NAME/stable --contains $HASH

This has only been tested on my own devices but it’s so simple it should work in any POSIX shell. You need git installed but nothing else. Obviously, I share this you “AS IS”, no guarantees and no liability implied. Consider it public domain.

6 Likes

That’s so nifty! How many commits are you watching right now haha

Just one. I almost forgot I had this script for a few years.

But yeah, I would probably subscribe (or maybe even pay for) a service that lets me follow a set of PRs and notifies me by email once they’re merged into beta or stable. I bet major releases would be small christmases.

1 Like

That sounds like a fun tool to build!

1 Like