From 711640321484a0638384b9b5b70892b424ae5f70 Mon Sep 17 00:00:00 2001 From: Jan Lindemann Date: Thu, 27 Apr 2017 13:34:50 +0000 Subject: [PATCH] pgit.sh: Prepare submodules, too Signed-off-by: Jan Lindemann --- scripts/pgit.sh | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/scripts/pgit.sh b/scripts/pgit.sh index 59ce78e2..21594cb3 100644 --- a/scripts/pgit.sh +++ b/scripts/pgit.sh @@ -18,7 +18,12 @@ fatal() marker() { - log "# ============= $@" + log "# ------------- $@" +} + +fat_marker() +{ + log "# ========================== $@" } config() @@ -73,15 +78,15 @@ clone() for p in $projects; do local pullurl=ssh://$login@git.jannet.de/srv/git/$fromuser/proj/$p local pushurl=ssh://$login@git.jannet.de/srv/git/$login/proj/$p - #marker "pulling $p from user $fromuser" + fat_marker "Fetching project $p from user $fromuser" if [ "$fromuser" = "$login" ]; then if [ -d $p ]; then run_git -C $p pull else run_git clone ssh://$login@git.jannet.de/srv/git/$fromuser/proj/$p - run_git -C $p submodule init || fatal git submodule init failed in `pwd` - run_git -C $p submodule update || fatal git submodule update failed in `pwd` fi + run_git -C $p submodule init || fatal git submodule init failed in $p + run_git -C $p submodule update || fatal git submodule update failed in $p else local remotename="user-$fromuser" if [ -d $p ]; then @@ -93,7 +98,7 @@ clone() else set -x run_git clone ssh://$login@git.jannet.de/srv/git/$fromuser/proj/$p - run_git -C $p remote rename origin $remotename || fatal failed to rename remote in `pwd` + run_git -C $p remote rename origin $remotename || fatal failed to rename remote in $p run_git -C $p remote set-url --push $remotename no_push $git_srv_admin -u $login -j create-personal-project $p run_git -C $p remote add origin $pushurl @@ -101,8 +106,8 @@ clone() run_git -C $p branch --set-upstream-to origin/master master set +x fi - run_git -C $p submodule init || fatal git submodule init failed in `pwd` - run_git -C $p submodule update || fatal git submodule update failed in `pwd` + run_git -C $p submodule init || fatal git submodule init failed in $p + run_git -C $p submodule update || fatal git submodule update failed in $p fi done )}