Last active
March 6, 2020 13:44
-
-
Save rokibhasansagar/d60c6ea6f61c51a430d16c6f1c638ded to your computer and use it in GitHub Desktop.
This file contains 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 | |
username=rokibhasansagar | |
url="gerrit.omnirom.org" | |
port="29418" | |
branch="android-6.0" | |
ref="android-6.0.1_r81" | |
wget -q https://github.com/omnirom/android_vendor_omni/raw/android-6.0/utils/aosp-forked-list | |
while read path; do | |
project=`echo android_${path} | sed -e 's/\//\_/g'` | |
echo "" | |
echo "=====================================================================" | |
echo " PROJECT: ${project} -> [ ${path}/ ]" | |
echo "" | |
git clone "ssh://${username}@${url}:${port}/${project}" -b ${branch} --single-branch ${path} && scp -p -P ${port} ${username}@${url}:hooks/commit-msg "${path}/.git/hooks/" | |
cd ${path} | |
git remote add aosp https://android.googlesource.com/platform/${path} | |
git remote add gerrit ssh://${username}@${url}:${port}/${project} | |
ret=$(git pull aosp ${ref} 2>&1) | |
if echo $ret | grep "CONFLICT (content)" > /dev/null ; then | |
echo " -> WARNING!: MERGE CONFLICT" | |
else | |
echo " -> DONE MERGING!" | |
echo "" | |
echo " -> Adding changes" | |
git add -A . || true | |
git commit || git commit -m "Merge tag '${ref}' into ${branch}" | |
echo " Now pushing" | |
git push --no-thin gerrit HEAD:refs/for/${branch} | |
echo "" | |
fi | |
cd - | |
done < aosp-forked-list | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment