Skip to content

Instantly share code, notes, and snippets.

View ClementPinard's full-sized avatar

Clément Pinard ClementPinard

View GitHub Profile
@cmdcolin
cmdcolin / gather_commits.js
Last active March 18, 2024 20:47
plot lines of code over time from a git repository
#!/usr/bin/env bash
## uses home directory to avoid git clean in repo clearing files
touch ~/lines
## choice 1. for all commits
git log --pretty=format:'%h %as'|sed 's/ /\t/' >! ~/commitlog
## choice 2. for all tags
git for-each-ref --sort=creatordate --format '%(refname) %(creatordate:short)' refs/tags|sed -e 's/refs\/tags\///'|sed 's/ /\t/' >! ~/commitlog