1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 22:52:11 +02:00
cdt/releng/scripts/verify_gitattributes.sh
Jonah Graham 48d2271a58 Bug 540373: Normalize newlines with .gitattributes
There is also a new script to verify completeness of .gitattributes:
releng/scripts/verify_gitattributes.sh

Change-Id: I2ce270852ab54b66b6c474a6ec94203fe5bba78b
2018-11-20 21:20:39 +00:00

22 lines
847 B
Bash
Executable file

#!/bin/bash
# Print out how many of each file extension there is
# find . ! -path "./.git/*" -type f -printf "%f\n" | sed -E -e 's/.+\./\*./' | sort -u | while read i; do find . ! -path "./.git/*" -name $i | wc -l | tr -d '\n'; echo " : $i" ; done | sort -n
# Print out all the unique file extensions, including unique names with no extension
# Each of these should be in .gitattributes
# find . ! -path "./.git/*" -type f -printf "%f\n" | sed -E -e 's/.+\./\*./' | sort -u
find . ! -path "./.git/*" -type f -printf "%f\n" | sed -E -e 's/.+\./\\\*\\./' | sort -u | while read i
do
echo -n "Checking $i in .gitattributes: "
if grep "^$i " .gitattributes
then
echo "Found"
else
echo MISSING $i in .gitattributes. List of file:
find . ! -path "./.git/*" -type f -name "$i"
exit 1
fi
done