Skip to content

Instantly share code, notes, and snippets.

@eckelon
Created November 14, 2019 11:33
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eckelon/386f0b200b107b5231431fcf815c8f4a to your computer and use it in GitHub Desktop.
Save eckelon/386f0b200b107b5231431fcf815c8f4a to your computer and use it in GitHub Desktop.
script for generating a markdown styled report based on the last 7 days git activity, on all the repos inside the current dir. Inspired by https://twitter.com/climagic/status/1194712444201054209?s=12
#!/bin/bash
CUR_DIR=$(pwd)
GIT_USER="JA Samitier"
report="# Git report from last week\n"
printf "Generating git report...\n\n"
repos=$(find . -name ".git" | cut -c 3-)
for i in $repos; do
cd "$i";
cd ..;
current_report=`git log --author="$GIT_USER" --format="- %aI %B" --since=-7days --reverse`
[ -z "$current_report" ] || report="${report}\n## ${i/\/\.git/}\n${current_report}\n";
cd $CUR_DIR
done
printf "$report\n";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment