Skip to content

Instantly share code, notes, and snippets.

@de1o
Created April 20, 2018 13:58
Show Gist options
  • Save de1o/099be5eece4d853b9d445848cca3d3fb to your computer and use it in GitHub Desktop.
Save de1o/099be5eece4d853b9d445848cca3d3fb to your computer and use it in GitHub Desktop.
weekly-commits
#!/bin/bash
last_sunday=`date -v-sunday +"%Y-%m-%d"`
author=`git config --get user.name`
cmd="git shortlog --author=$author --after=$last_sunday --oneline"
echo $cmd
for i in `ls .`;do
if [ -d ~/Codes/$i ];then
cd ~/Codes/$i
if [ ! -d ".git" ];then
continue
else
result=`$cmd`
if [ ! -z "$result" ];then
echo "========================================="
echo -e "working on $i\n"
echo -e "$result"|grep -v "Merge branch"
fi
fi
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment