mirror of
https://github.com/keanuplayz/dotfiles.git
synced 2024-08-15 02:33:12 +00:00
[scripts/category-count] Add script.
This commit is contained in:
parent
006b9f37a2
commit
6a46c28a10
1 changed files with 24 additions and 0 deletions
24
scripts/category-count
Executable file
24
scripts/category-count
Executable file
|
@ -0,0 +1,24 @@
|
||||||
|
#!/usr/bin/env zsh
|
||||||
|
# Script to fetch commit messages and display the category frequencies.
|
||||||
|
# Example:
|
||||||
|
# 047c36c [Meta] Added README.
|
||||||
|
# 5b16912 [Init] Added scripts.
|
||||||
|
#
|
||||||
|
# Will output:
|
||||||
|
# Meta: 1
|
||||||
|
# Init: 1
|
||||||
|
#
|
||||||
|
# Authored by:
|
||||||
|
# Alyxia Sother <lexisoth2005@gmail.com>
|
||||||
|
# Mijyuoon <mijyuoon@gmail.com>
|
||||||
|
|
||||||
|
data=$(git log --oneline | awk -F '[][]' '{for (i=2; i<=NF; i+=2) {printf "%s ", $i}; print ""}')
|
||||||
|
keys=$(echo "$data" | sort -u | uniq)
|
||||||
|
|
||||||
|
for type in $data; do
|
||||||
|
eval "count_$type="'$'"((count_$type+1))"
|
||||||
|
done
|
||||||
|
|
||||||
|
for type in $keys; do
|
||||||
|
echo "$type: $(eval "echo "'$'"count_$type")"
|
||||||
|
done
|
Loading…
Add table
Add a link
Reference in a new issue