From 45ed11f638444386d413266149edec03fef3814e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Reynolds?= Date: Mon, 10 Dec 2012 19:40:33 -0300 Subject: Work with mirrors --- git-shell-commands/fetch-mirrors | 20 ++++++++++++++++++++ git-shell-commands/mirrors | 11 +++++++++++ 2 files changed, 31 insertions(+) create mode 100755 git-shell-commands/fetch-mirrors create mode 100755 git-shell-commands/mirrors diff --git a/git-shell-commands/fetch-mirrors b/git-shell-commands/fetch-mirrors new file mode 100755 index 0000000..62ed9f1 --- /dev/null +++ b/git-shell-commands/fetch-mirrors @@ -0,0 +1,20 @@ +#!/bin/sh +# * fetch-mirrors +# Updates mirrors created with `mirror` +# ssh git@host fetch-mirrors + +set -e + +# Find all mirrors +mirrors | \ + while read _mirror; do + + pushd "$_mirror" >/dev/null + + git fetch + + popd >dev/null + +done + +exit $? diff --git a/git-shell-commands/mirrors b/git-shell-commands/mirrors new file mode 100755 index 0000000..d0ae3f4 --- /dev/null +++ b/git-shell-commands/mirrors @@ -0,0 +1,11 @@ +#!/bin/sh +# * mirrors +# Prints all mirrored repos +# ssh git@host mirrors + +set -e + +# Find all mirrors +find *.git -maxdepth 1 -iname config -print0 | \ + xargs -0 grep -l 'mirror = true' | \ + sed 's,/config$,,' -- cgit v1.2.3