improve gitfetcher/lister and add pretty overview log

This commit is contained in:
Felix Van der Jeugt 2017-05-30 10:47:13 +02:00
parent 97e8eb2320
commit 0e721f7973
No known key found for this signature in database
GPG key ID: 58B209295023754D
3 changed files with 16 additions and 7 deletions

View file

@ -2,16 +2,23 @@
wd="$(pwd)"
temp="$(mktemp)"
name="$(basename "$0")"
find /data -name '.git' -exec dirname \{\} \; | while read gitrepo; do
cd "$gitrepo"
echo "$gitrepo"
git remote | while read remote; do
git fetch --prune "$remote"
done 2>&1 | sed 's/^/ /'
git status | grep behind | sed 's/^/ /'
case "$name" in
"gitfetcher")
echo "$gitrepo"
git remote | while read remote; do
git fetch --prune "$remote"
done 2>&1 | sed 's/^/ /'
;;
"gitlister")
if git status | grep -q behind; then
echo "$gitrepo"
fi
;;
esac
done
cd "$wd"