Created
December 13, 2022 06:48
-
-
Save hytopoulos/948a2e8b57c53d3ca566b3520ae1f07c to your computer and use it in GitHub Desktop.
Count lines of code for a specific language using git blame
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
c_files=$(find . -name "*.c") | |
loc=0 | |
# Loop through each C file | |
for file in $c_files; do | |
loc=$((loc + $(git blame $file | grep $1 | wc -l))) | |
done | |
echo "Total LOC of C authored by $1: $loc" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment