bendun.cc

My Github Repositories

Written , a 3 minutes read

So today I decided to archive my Github repositories:

gh repo list --json sshUrl --limit 1000 | jq .[].sshUrl -r | parallel git clone

I love the github commandline interface, it makes task like this so simple. Normally you would have to do some REST API mumbo jumbo but here it is just a simple shell workflow.

How Many Commits?

ls | parallel --tag -I{} -- git -C {} rev-list --count --all \
   | awk '{printf("%6d ", $2); print $1}' \
   | sort -rn | head

produces this list of repositories with most commits:

 10983 sonic-pi
  2704 natalie
  1701 dwm
   585 nlp-menu
   562 slstatus
   523 musique
   338 link
   310 link-echo
   222 zeroconf
   219 stacky

I'm suprised that my current main project (Harmonia) hasn't made the top 10 yet, with it's predecessor (Musique) being in top 5.

What Languages?

ls | parallel cloc --csv --hide-rate --quiet \
   | grep -v 'github.com' | grep -v ',SUM,' \
   | awk -F, '{ print $2 }' | sort | uniq -c | sort -rn

produces this list of languages used across the repositories:

    104 Markdown
     44 make
     39 C++
     38 C/C++ Header
     35 Bourne Shell
     29 Python
     21 Text
     20 C
     16 HTML
     15 YAML
     15 Rust
     15 JavaScript
     15 Go
     14 TOML
     12 JSON
     12 Haskell

however this time the trail of languages used only one is interesting. We have gems like Ada, Clojure, D, Erlang, Julia, Lisp, Lua, R, Scala, Scheme, Zig, and much more!

What time?

ls | parallel -I{} -- git -C {} log --reflog \'--pretty='%an %aI'\' \
   | awk 'match($0, /Bendun.*T([0-9][0-9])/, a) { hours[a[1]]++ };
          END {
            for (hour in hours) {
               printf("%s: %4d ", hour, hours[hour]);
               for (c = 0; c < hours[hour]/4; ++c) printf("█");
               print ""
            }
          }' \
   | sort

produces this chart of how many commits I have done in each hour:

Sort by

00:  150 ██████████████████████████████████████
01:  124 ███████████████████████████████
02:  117 ██████████████████████████████
03:   68 █████████████████
04:   59 ███████████████
05:   24 ██████
06:   26 ███████
07:   14 ████
08:   18 █████
09:   30 ████████
10:   42 ███████████
11:   29 ████████
12:   54 ██████████████
13:   78 ████████████████████
14:   73 ███████████████████
15:  101 ██████████████████████████
16:  110 ████████████████████████████
17:   83 █████████████████████
18:   79 ████████████████████
19:  105 ███████████████████████████
20:   88 ██████████████████████
21:   97 █████████████████████████
22:  115 █████████████████████████████
23:  144 ████████████████████████████████████

Commit Names Wordcloud

Wordcloud created from commit names
wordcloud_cli --background 'rgba(0,0,0,0)' --mode RGBA \
  --width 1000 --height 600 --imagefile /tmp/output.png \
  --text <(ls | parallel -I{} -- git -C {} log --reflog \'--pretty='%an,,,%s'\' \
  | awk -F,,, '/Bendun/{print $2}')