We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 59b5363 + 1c6b5c4 commit e3b2d26Copy full SHA for e3b2d26
scripts/pre-commit.hook
@@ -207,9 +207,16 @@ for FILE in $C_FILES; do
207
fi
208
done
209
210
-if [ ! -z "${FILES[*]}" ]; then
+if [ "${#FILES[@]}" -gt 0 ]; then
211
echo "Following files were changed:"
212
- echo "${FILES[*]}"
+ for file in "${FILES[@]}"; do
213
+ if command -v diffstat >/dev/null 2>&1; then
214
+ summary=$(git diff --cached "$file" | diffstat -s | sed -E 's/^[[:space:]]*[0-9]+ files? changed,?[[:space:]]*//')
215
+ echo " - $file | $summary"
216
+ else
217
+ echo " - $file"
218
+ fi
219
+ done
220
221
222
$SHA1SUM -c scripts/checksums 2>/dev/null >/dev/null
0 commit comments