From bb7576c2dceee5ef8c65554ea0a8a34e85d4e577 Mon Sep 17 00:00:00 2001 From: Bertrand Jacquin Date: Sat, 24 May 2014 17:41:19 +0200 Subject: scripts: Add git pre-commit hook --- scripts/hook-metadata | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 scripts/hook-metadata diff --git a/scripts/hook-metadata b/scripts/hook-metadata new file mode 100755 index 00000000..fd8b3e0c --- /dev/null +++ b/scripts/hook-metadata @@ -0,0 +1,22 @@ +#!/bin/bash +# +# (c) 2014 - Bertrand Jacquin +# +# Called by git-commit with no arguments. The hook should +# exit with non-zero status after issuing an appropriate message if +# it wants to stop the commit. +# +# To enable this hook, run: +# cd $(git rev-parse --show-toplevel) +# chmod +x scripts/hook-metadata +# ln -s scripts/hook-metadata .git/hooks/pre-commit + +ROOT="$(git rev-parse --show-toplevel)" +REPO="$(< ${ROOT}/profiles/repo_name)" + +egencache --repo="${REPO}" \ + --update \ + --update-use-local-desc + +git add -vA "${ROOT}/profiles/use.local.desc" +git add -vA "${ROOT}/metadata/md5-cache" -- cgit v1.2.3