I have a user case where I need to calculate Lines of Code per BUC-ID. I have achieved the same using
git log --shortstat --grep=BUC3565-EPIC16 |grep -E "fil(e|es) changed" | awk -v BUC=$i '{ inserted+=$4; deleted+=$6; delta+=$4-$6i } END {printf "%s, %s, %s, %s \n",BUC, inserted, deleted, delta }'
Now I have BUC-ID with multiple files. Is there any way I can just skip few files/folders and still able to calculate Lines off Code for that BUC-ID?
Basically, I need to exclude some files/folders while calculating Lines of Code. I am not able to do so because each commit has multiple files. Some should be included and some excluded...Any idea how to achieve that?
Does CLOC provide any feature to exclude files?
Find all the commits that's related with a BUC-ID.
git log --pretty=%H --grep=BUC3565-EPIC16For every commit, list all the changed files excluding some files/folders.
git show $commit --pretty=format:"" --name-only | grep -ve "foo.txt" -ve "bar/"For every file of the rest, calculate its
insertions,deletionsanddelta.git show $commit --pretty=format:"" --short-stat -- $file | grep -E "fil(e|es) changed" | awkSum up the results.