-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add script for auto-propagating changes to modern branches where poss…
…ible [skip ci]
- Loading branch information
Showing
2 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
WORK_DIR=`mktemp -d` | ||
|
||
# deletes the temp directory | ||
function cleanup { | ||
cd $HOME | ||
rm -rf "$WORK_DIR" | ||
} | ||
|
||
trap cleanup EXIT | ||
|
||
# clone ModernFix repo | ||
|
||
echo "downloading temporary modernfix..." | ||
cd $WORK_DIR | ||
git clone https://github.com/embeddedt/ModernFix mfix &>/dev/null | ||
cd mfix | ||
|
||
# gather version list | ||
readarray -t all_versions < <(git ls-remote --heads origin | awk '{print $2}' | sed 's:.*/::' | sort -V) | ||
echo "found versions: ${all_versions[@]}" | ||
|
||
# checkout base version | ||
git checkout -b propagations/${all_versions[0]} origin/${all_versions[0]} &>/dev/null | ||
|
||
our_version=${all_versions[0]} | ||
restore_version=$our_version | ||
|
||
for version in "${all_versions[@]}"; do | ||
if ! { echo "$version"; echo "$our_version"; } | sort --version-sort --check &>/dev/null; then | ||
echo -n "merging $our_version into ${version}... " | ||
git checkout -b propagations/$version origin/$version &>/dev/null | ||
if git merge -m "Merge $our_version into $version" propagations/$our_version >/dev/null; then | ||
echo "done" | ||
git push -u origin propagations/$version:$version &>/dev/null | ||
else | ||
echo "failed, this merge must be done manually" | ||
exit 1 | ||
fi | ||
our_version=$version | ||
fi | ||
done |
File renamed without changes.