From bc3ff46255eecda6e9817bc6fc2ab46aff93b05c Mon Sep 17 00:00:00 2001 From: Konrad Abicht Date: Fri, 23 Jun 2017 11:25:06 +0200 Subject: [PATCH] added small script to update master branch for each read-only component --- scripts/update-subpackage-repos.sh | 40 ++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100755 scripts/update-subpackage-repos.sh diff --git a/scripts/update-subpackage-repos.sh b/scripts/update-subpackage-repos.sh new file mode 100755 index 0000000..15325a2 --- /dev/null +++ b/scripts/update-subpackage-repos.sh @@ -0,0 +1,40 @@ +#!/bin/bash + +# Important: You need to run "make setup-subtrees" once before to ensure + +typeset -A repos +# core packages +repos[saft.data]=src/Saft/Data +repos[saft.rdf]=src/Saft/Rdf +repos[saft.sparql]=src/Saft/Sparql +repos[saft.store]=src/Saft/Store +repos[saft.test]=src/Saft/Test + +# additional packages +repos[saft.arc2]=src/Saft/Addition/ARC2 +repos[saft.easyrdf]=src/Saft/Addition/EasyRdf +repos[saft.hardf]=src/Saft/Addition/hardf +repos[saft.erfurt]=src/Saft/Addition/Erfurt +repos[saft.querycache]=src/Saft/Addition/QueryCache +repos[saft.redland]=src/Saft/Addition/Redland +repos[saft.store.http]=src/Saft/Addition/HttpStore +repos[saft.store.virtuoso]=src/Saft/Addition/Virtuoso + +for i in "${!repos[@]}" +do + # Access to: + # $i = branch name + # ${repos[$i]} = folder path + + echo "" + echo "Update master branch for ${repos[$i]}" + + # avoid that tags getting used for the wrong repository + git tag -l | xargs git tag -d + + # put subfolder related changes into its own branch + git subtree split --prefix=${repos[$i]} -b $i + + # push latest state to related remote with tags + git push -f $i $i:master +done