Skip to content

Instantly share code, notes, and snippets.

@invisiblek
Last active August 29, 2015 14:10
Show Gist options
  • Save invisiblek/ff0c57ad0e08a2a3840f to your computer and use it in GitHub Desktop.
Save invisiblek/ff0c57ad0e08a2a3840f to your computer and use it in GitHub Desktop.
#!/bin/bash
if [ "$1" == "careful" ]; then
set -e
fi
PWD=`pwd`
count=0
source build/envsetup.sh > /dev/null
rm -f ~/.bin/repopicks-tmp
while read line; do
p=`echo $line | awk '{print $1}'`
echo "repopicking: $p"
if [ "$p" != "skip" ] && [ "$p" != "" ]; then
output=`repopick $p`
if [[ "$output" != "${output/'Commit already merged. Skipping the cherry pick.'}" ]]
then
echo "removing $p from the script"
else
echo $line >> ~/.bin/repopicks-tmp
fi
else
echo $line >> ~/.bin/repopicks-tmp
p=`echo $line | awk '{print $2}'`
echo "Skipping $p"
fi
echo ""
count=`expr $count + 1`
done < ~/.bin/repopicks
cp ~/.bin/repopicks-tmp ~/.bin/repopicks
rm -f ~/.bin/repopicks-tmp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment