Skip to content

Instantly share code, notes, and snippets.

@gorenje
Last active December 10, 2015 18:28
Show Gist options
  • Save gorenje/4474747 to your computer and use it in GitHub Desktop.
Save gorenje/4474747 to your computer and use it in GitHub Desktop.
what i did last month
====> .gitconfig
[alias]
lsloglastmonth = log --pretty=format:"%ci\\ %C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]%Creset" --decorate --after='last month' --before='today' --no-merges
====> .bashrc
function _funct_gitlog_last_month
{
local lastmonth=`gdate '+%Y-%m-01' --date '1 month ago'`
for n in */.git
do
local dirname=`dirname $n`
cd $dirname 2>/dev/null >&2
echo
echo "=========> ${dirname}"
git lsloglastmonth --since="${lastmonth}" --author="$(git config --get user.name)" | cat
cd .. 2>/dev/null >&2
done
if [ -d .git ] ; then
echo
echo "=========> $(pwd)"
git lsloglastmonth --since="${lastmonth}" --author="$(git config --get user.name)" | cat
echo
fi
}
alias gitlog-last-month=_funct_gitlog_last_month
===> usage
gitlog-last-month | grep -v "2013-01"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment