Add git tracked-text-files alias

This commit is contained in:
ItsDrike 2024-02-17 22:52:25 +01:00
parent 82ab38ae7f
commit 0e0dd92bb9
Signed by: ItsDrike
GPG key ID: FA2745890B7048C0

View file

@ -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 }' #"