tools: update tools/codelines to use "git ls-files"
authorBruce Momjian <bruce@momjian.us>
Thu, 20 Nov 2025 20:23:39 +0000 (15:23 -0500)
committerBruce Momjian <bruce@momjian.us>
Thu, 20 Nov 2025 20:23:39 +0000 (15:23 -0500)
This generates a more accurate code count because 'make distclean'
doesn't always remove build files.

Author: idea from David Rowley

Discussion: https://postgr.es/m/aR4hoOotVHB7TXo5@momjian.us

Backpatch-through: master

src/tools/codelines

index 11e86accf271d7656f7c53311dc03454e4b6df9d..93ad571acf9fc39c203a512b22f700c16f0bc48a 100755 (executable)
@@ -3,5 +3,5 @@
 # src/tools/codelines
 
 # This script is used to compute the total number of "C" lines in the release
-# This should be run from the top of the Git tree after a 'make distclean'
-find . -name '*.[chyl]' | xargs cat| wc -l
+# This should be run from the top of the Git tree.
+git ls-files -- '*.[chyl]' | xargs cat | wc -l