diff --git a/metatool b/metatool index 723762f..57c7561 100755 --- a/metatool +++ b/metatool @@ -3,17 +3,38 @@ set -e manyrepos_dir=.many +manyrepos_branch=master +metarepo_branch=meta init() { ls $manyrepos_dir | - while read path + while read project do - git subtree add --prefix=$path $manyrepos_dir/$path master + git subtree add --prefix=$project $manyrepos_dir/$project $manyrepos_branch done } sync() { - echo sync + ls $manyrepos_dir | + while read project + do + pull $project + push $project + done +} + +pull() { + project=$1 + git subtree pull --prefix=$project $manyrepos_dir/$project $manyrepos_branch +} + +push() { + project=$1 + git subtree push --prefix=$project $manyrepos_dir/$project $metarepo_branch + pushd $manyrepos_dir/$project + git merge $metarepo_branch --no-commit + git commit --no-edit + popd } print_usage() {