So after using Go to do the initial activity collection, I went a bit more old school for extracting it from git repos directly. Note that this and the previous post use the data capabilities of hugo.
Yep, shell, sed
, awk
, sort
and uniq
baby! It’s not ideal, but this script only runs once so good enough.
The reason for this one-off extraction is because both gitlab and github restrict the time period they save activity data (two years for gitlab, 90 days for github - though some gitlab instances hold more and some less). Future activity recording will be done via the Go programs described before; this just runs once-ish. If I find older code repos I’ll likely add them to this.
|
|
This isn’t an uncommon sort of shell reporting pipeline. You pull in a
bunch of data, filter out the bits you don’t want (the grep
)
and then format it for future consumption. The awk
-> bash
bit is
a thing I don’t usually do - in fact I can’t think of a time I’ve done
it before - but it’s not dissimilar to awk
to xargs
say.
For something I’d run more often it’s not what I’d use, but for a one-off script this sort of thing works well.