Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/releng
diff options
context:
space:
mode:
authorJonah Graham2018-11-24 10:54:54 +0000
committerJonah Graham2018-11-24 10:55:06 +0000
commit1ca30675219c639ea9cdf713d686dbb862f00d29 (patch)
tree6fb2fc15b8918732d4d86cdc1f9e08904aba25e6 /releng
parent96b71a9a4867bec3999dc254e4e486419ae745c7 (diff)
downloadorg.eclipse.cdt-1ca30675219c639ea9cdf713d686dbb862f00d29.tar.gz
org.eclipse.cdt-1ca30675219c639ea9cdf713d686dbb862f00d29.tar.xz
org.eclipse.cdt-1ca30675219c639ea9cdf713d686dbb862f00d29.zip
Bug 540373: Use git ls-files instead of find
git ls-files has two benefits: - Only finds tracked files This is necessary because we were having a few cleanups being attempted on ignored files. - Is much faster Change-Id: I5a53497f8ef9c839676b7ef7e3be35171140f4b9
Diffstat (limited to 'releng')
-rwxr-xr-xreleng/scripts/check_code_cleanliness.sh10
1 files changed, 5 insertions, 5 deletions
diff --git a/releng/scripts/check_code_cleanliness.sh b/releng/scripts/check_code_cleanliness.sh
index f33b61119d3..be8b9f04e03 100755
--- a/releng/scripts/check_code_cleanliness.sh
+++ b/releng/scripts/check_code_cleanliness.sh
@@ -28,16 +28,16 @@ rm -rf check_code_cleanliness_workspace
# The .gitattributes is used as a filter to identify files to check. Patters with
# this "# check trailing whitespace" on the line before are checked
##
-awk '/# remove trailing whitespace/{getline; print $1}' .gitattributes | \
- while read i ; do \
+awk '/# remove trailing whitespace/{getline; print $1}' .gitattributes |
+ while read i ; do
echo "Removing trailing whitespace on $i files"
- find . ! -path "./.git/*" -type f -name "$i" -exec sed -i 's/[ \t]*$//' {} +; \
+ git ls-files -- "$i" | xargs sed -i 's/[ \t]*$//'
done
##
# Add all file types to .gitattributes
##
-find . ! -path "./.git/*" -type f -printf "%f\n" | sed -E -e 's/.+\./\\\*\\./' | sort -u | while read i ; do
+git ls-files | sed -E '-es@^.*/([^/]+)$@\1@' '-es@.+\.@\\\*\\.@' | sort -u | while read i ; do
if ! grep "^$i " .gitattributes > /dev/null
then
echo "MISSING $i in .gitattributes, adding as text, check if that is correct"
@@ -48,7 +48,7 @@ done
##
# Copy JDT/PDE preferences
##
-find . ! -path "./.git/*" -name .project ! -path './core/org.eclipse.cdt.core/.project' | while read i ; do
+git ls-files -- \*\*/.project ':!core/org.eclipse.cdt.core/.project' | while read i ; do
d=`dirname $i`;
if test ! -e $d/feature.xml; then
mkdir -p $d/.settings

Back to the top