diff --git a/home/.config/git/config b/home/.config/git/config index 5588dbc..0812624 100644 --- a/home/.config/git/config +++ b/home/.config/git/config @@ -71,7 +71,8 @@ show-merge = "!sh -c 'merge=$(git find-merge $0 $1) && [ -n \"$merge\" ] && git show $merge'" tracked-files = "ls-tree --full-tree --name-only -r HEAD" - total-lines = "!git tracked-files | xargs cat | wc -l" + tracked-text-files = "!git tracked-files | while IFS= read -r file; do mime_type=$(file -b --mime-type "$file"); [[ $mime_type == text/* ]] && echo "$file"; done" + total-lines = "!git tracked-text-files | xargs cat | wc -l" total-files = "!git tracked-files | wc -l" total-commits = "!git log --oneline | wc -l" comitter-lines = "!git log --author=\"$1\" --pretty=tformat: --numstat | awk '{ add += $1; subs += $2; loc += $1 - $2 } END { printf \"added lines: %s, removed lines: %s, total lines: %s\\n\", add, subs, loc }' #"