mirror of
https://github.com/tj/git-extras.git
synced 2026-09-12 08:26:17 -04:00
modify to count for text file
This commit is contained in:
parent
0386eb5bbe
commit
dbc9fe0be4
|
|
@ -8,7 +8,9 @@ project=${PWD##*/}
|
|||
function single_file {
|
||||
while read data
|
||||
do
|
||||
git blame --line-porcelain $data | sed -n 's/^author //p'
|
||||
if [[ $(file $data) = *text ]]; then #
|
||||
git blame --line-porcelain $data | sed -n 's/^author //p';
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
|
|
@ -40,8 +42,10 @@ function result {
|
|||
authors | awk '
|
||||
{ args[NR] = $0; sum += $0 }
|
||||
END {
|
||||
printf " %-9s: %i\n", "lines", sum
|
||||
printf " %-9s: \n", "authors"
|
||||
for (i = 1; i <= NR; ++i) {
|
||||
printf "%-30s %2.1f%%\n", args[i], 100 * args[i] / sum
|
||||
printf " %-30s %2.1f%%\n", args[i], 100 * args[i] / sum
|
||||
}
|
||||
}
|
||||
'
|
||||
|
|
@ -51,8 +55,6 @@ function result {
|
|||
|
||||
echo
|
||||
echo " project : $project"
|
||||
echo " lines :" $(count)
|
||||
echo " authors : "
|
||||
result
|
||||
echo
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue