Commit 9e791325 authored by Oswald Buddenhagen's avatar Oswald Buddenhagen
Browse files

add cleanup script for sanity bot


if the sanity bot is configured with gitdofetch=1, the repos need a
periodic cleanup - otherwise they become amazingly slow (a simple fetch
can take minutes before anything happens).

i was too lazy make this an option of the sanity-bot script itself.
maybe later.

Change-Id: I85306264cd67d321c10cb069e5bfb5b60b2ca6db
Reviewed-by: default avatarRohan McGovern <rohan.mcgovern@nokia.com>
No related merge requests found
Showing with 24 additions and 0 deletions
#! /bin/sh
# Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
# Contact: http://www.qt-project.org/
#
# You may use this file under the terms of the 3-clause BSD license.
# See the file LICENSE from this package for details.
#
# Run this once a day (from a cron job) to keep the sanity bot's
# git clones performing well.
root=$(git config sanitybot.gitbasedir)
if test -z "$root"; then
echo "Error: sanitybot.gitbasedir not set" >&2
exit 1
fi
cd "$root" || exit
find -name '*.git' -type d | while read dir; do (
echo "Entering $dir ..."
cd "$dir" || exit
find refs/changes -mindepth 1 -mtime +10 -delete
git gc
); done
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment