-
-
Save invisiblek/feb442432387961bcc20 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/bin/bash | |
if [ "$1" == "careful" ] || [ "$2" == "careful" ]; then | |
set -e | |
fi | |
PWD=`pwd` | |
pickfile=~/.bin/repopicks | |
count=0 | |
source build/envsetup.sh > /dev/null | |
while read line; do | |
p=`echo $line | awk '{print $1}'` | |
echo "repopicking: $p" | |
if [ "$p" != "skip" ]; then | |
output=`repopick $p` | |
if [[ "$output" != "${output/'Commit already merged. Skipping the cherry pick.'}" ]] | |
then | |
echo "removing $p from the script" | |
sed -i "s|$line||g" $pickfile | |
sed -i "/^$/d" $pickfile | |
/home/dp/.bin/email "[email protected]" "[email protected]" "Merged cherry pick removed from auto pick script" "\n\n$line" "invisiblek.org" "[email protected]" | |
fi | |
else | |
p=`echo $line | awk '{print $2}'` | |
echo "Skipping $p" | |
fi | |
echo "" | |
count=`expr $count + 1` | |
done < $pickfile | |
while read line; do | |
user=`echo $line | awk '{print $1}'` | |
if [ "$user" != "skip" ]; then | |
repo=`echo $line | awk '{print $2}'` | |
commit=`echo $line | awk '{print $3}'` | |
localrepo=`echo $line | awk '{print $4}'` | |
cd $localrepo | |
if [ "$2" == "careful" ]; then | |
set +e | |
fi | |
set +e | |
git remote add $user http://github.com/$user/$repo | |
set -e | |
if [ "$2" == "careful" ]; then | |
set -e | |
fi | |
git fetch $user | |
git cherry-pick $commit | |
cd - | |
fi | |
done < ~/.bin/cherrypicks |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment