pgit.sh: Log more git commands

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2017-04-21 16:47:20 +00:00
commit f9c20f6a64

View file

@ -76,33 +76,33 @@ clone()
marker "pulling $p from user $fromuser"
if [ "$fromuser" = "$login" ]; then
if [ -d $p ]; then
git -C $p pull
run_git -C $p pull
else
git clone ssh://$login@git.jannet.de/srv/git/$fromuser/proj/$p
git -C $p submodule init || fatal git submodule init failed in `pwd`
git -C $p submodule update || fatal git submodule update failed in `pwd`
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
else
local remotename="user-$fromuser"
if [ -d $p ]; then
git -C $p remote | grep -q "^$remotename$" || {
git -C $p remote add $remotename $pullurl
git -C $p remote set-url --push $remotename no_push
run_git -C $p remote | grep -q "^$remotename$" || {
run_git -C $p remote add $remotename $pullurl
run_git -C $p remote set-url --push $remotename no_push
}
git -C $p pull $remotename master
run_git -C $p pull $remotename master
else
set -x
git clone ssh://$login@git.jannet.de/srv/git/$fromuser/proj/$p
git -C $p remote rename origin $remotename || fatal failed to rename remote in `pwd`
git -C $p remote set-url --push $remotename no_push
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 set-url --push $remotename no_push
$git_srv_admin -u $login -j create-personal-project $p
git -C $p remote add origin $pushurl
git -C $p push origin master
git -C $p branch --set-upstream-to origin/master master
run_git -C $p remote add origin $pushurl
run_git -C $p push origin master
run_git -C $p branch --set-upstream-to origin/master master
set +x
fi
git -C $p submodule init || fatal git submodule init failed in `pwd`
git -C $p submodule update || fatal git submodule update failed in `pwd`
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
done
)}
@ -114,7 +114,7 @@ diff()
cd $pdir
for d in $pdirs; do
marker $d
git -C $d diff --src-prefix=a/$d/ --dst-prefix=b/$d/ "$@"
run_git -C $d diff --src-prefix=a/$d/ --dst-prefix=b/$d/ "$@"
done
)}