Last active
April 30, 2025 10:34
-
-
Save ei-grad/ee64f3dd2f23b6564f6bda4aeb0f91da to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
git log --pretty=%H "$@" | while read -r sha; do | |
added=$(git show --word-diff=porcelain "$sha" | grep '^+' | cut -c2- | wc -w) | |
removed=$(git show --word-diff=porcelain "$sha" | grep '^-' | cut -c2- | wc -w) | |
git show --pretty="- hash: %h%n date: %aI%n author: |-2%w(0,0,4)%n%an <%ae>%w(0,0,2)%nmessage: |-2%w(0,0,4)%n%s%w(0,0,0)%n added: $added%n removed: $removed" -s "$sha" | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import sys | |
from yaml import safe_load | |
import pandas as pd | |
import matplotlib.pyplot as plt | |
df = pd.DataFrame.from_records(safe_load(sys.stdin), index="date").sort_index() | |
pd.DataFrame({"added": df.added.cumsum(), "removed": df.removed.cumsum()}).plot() | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment