Skip to content

Commit

Permalink
sync draft
Browse files Browse the repository at this point in the history
  • Loading branch information
krlmlr committed Dec 24, 2017
1 parent 967f626 commit fe1a62b
Showing 1 changed file with 24 additions and 3 deletions.
27 changes: 24 additions & 3 deletions metatool
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit fe1a62b

Please sign in to comment.