From 61fa7a2ed79450e2705d23f2fbfc1913c58db5d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=AD?= Date: Fri, 17 Jun 2016 11:36:18 +0100 Subject: [PATCH] hooks/pre-commit: only check changed files Speeds up commiting a single file from ~2.6s to ~1.2s on my machine. --- hooks/pre-commit | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hooks/pre-commit b/hooks/pre-commit index c0ff5d174b..007f273e98 100755 --- a/hooks/pre-commit +++ b/hooks/pre-commit @@ -7,4 +7,5 @@ set -o pipefail # Redirect output to stderr. exec 1>&2 -fdroid lint -f + +fdroid lint -f $(git diff --cached --name-only --diff-filter=ACM | sed -n 's@metadata/\(.*\).txt@\1@p')