diff --git a/README.md b/README.md index 7468ae11..e005d6c3 100644 --- a/README.md +++ b/README.md @@ -282,3 +282,15 @@ $ git fetch xo-foo main ``` $ git subtree add --prefix=xo-foo xo-foo main ``` + +## To push changes to satellite repos + +``` +$ git subtree push --prefix=xo-foo xo-foo main +``` + +## To pull changes from satellite repos + +``` +$ git subtree pull --prefix=xo-foo xo-foo main +``` diff --git a/xo-cmake/bin/xo-build.in b/xo-cmake/bin/xo-build.in index 9c36b434..4f1caf92 100644 --- a/xo-cmake/bin/xo-build.in +++ b/xo-cmake/bin/xo-build.in @@ -6,10 +6,12 @@ usage() { cat < 0 ]]; do case "$1" in @@ -98,9 +107,6 @@ while [[ $# > 0 ]]; do --xoname=*) xoname="${1#*=}" ;; - --repo) - repo_flag=1 - ;; --clone) clone_flag=1 ;; @@ -137,6 +143,18 @@ while [[ $# > 0 ]]; do --with-vulkan=*) with_vulkan="${1#*=}" ;; + --repo) + repo_flag=1 + ;; + --add-umbrella-remote) + add_umbrella_remote_flag=1 + ;; + --pull-umbrella-remote) + pull_umbrella_remote_flag=1 + ;; + --push-umbrella-remote) + push_umbrella_remote_flag=1 + ;; xo-*) xoname="$1" ;; @@ -169,7 +187,12 @@ subsystem_list() { cat ${SUBSYSTEMLIST_FILE} } -XO_REPO_STEM="https://github.com/Rconybea" +XO_REPO_STEM= +if [[ $(whoami) == "roland" ]]; then + XO_REPO_STEM="git@github.com:Rconybea" +else + XO_REPO_STEM="https://github.com/Rconybea" +fi printrepo() { xoname=$1 @@ -222,6 +245,52 @@ if [[ $repo_flag -eq 1 ]]; then fi fi +if [[ $add_umbrella_remote_flag -eq 1 ]]; then + if [[ $clone_flag -eq 1 || $configure_flag -eq 1 || $build_flag -eq 1 || $build_docs_flag -eq 1 || $install_flag -eq 1 || $realclean_flag -eq 1 ]]; then + 2>&1 echo "error: xo-build: repo operation --add-umbrella-remote conflicts with" + 2>&1 echo " build operation --clone|--configure|--build|--build-docs|--install|--realclean" + exit 1 + fi + + if [[ -n "$xoname" ]]; then + url=$(printrepo $xoname) + + cmd="git remote add $xoname $url" + + if [[ $noop_flag -eq 1 ]]; then + echo $cmd + else + $cmd + fi + fi +fi + +if [[ $pull_umbrella_remote_flag -eq 1 ]]; then + if [[ -n "$xoname" ]]; then + branch=$(git branch --show-current) + cmd="git subtree pull --prefix=$xoname $xoname ${branch}" + + if [[ $noop_flag -eq 1 ]]; then + echo $cmd + else + $cmd + fi + fi +fi + +if [[ $push_umbrella_remote_flag -eq 1 ]]; then + if [[ -n "$xoname" ]]; then + branch=$(git branch --show-current) + cmd="git subtree push --prefix=$xoname $xoname ${branch}" + + if [[ $noop_flag -eq 1 ]]; then + echo $cmd + else + $cmd + fi + fi +fi + if [[ $clone_flag -eq 1 ]]; then if [[ -n "$xoname" ]]; then url=$(printrepo $xoname) @@ -243,6 +312,7 @@ if [[ $configure_flag -eq 1 ]]; then testingarg="-DENABLE_TESTING=1" fi + asmarg= if [[ $with_asm -eq 1 ]]; then asmarg="-DENABLE_ASM=1" fi diff --git a/xo-cmake/etc/xo/subsystem-list b/xo-cmake/etc/xo/subsystem-list index 555bd2e9..900cbb19 100644 --- a/xo-cmake/etc/xo/subsystem-list +++ b/xo-cmake/etc/xo/subsystem-list @@ -4,6 +4,7 @@ xo-alloc xo-object xo-refcnt xo-subsys +xo-testutil xo-randomgen xo-ordinaltree xo-pyutil