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

@ -16,3 +16,4 @@
gpgsign = true
[alias]
pushf = push --force-with-lease
lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit

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"

1
local/bin/gitlister Symbolic link
View File

@ -0,0 +1 @@
gitfetcher