Last active
August 29, 2015 14:08
-
-
Save timuruski/0335b7d1c2d9f8def059 to your computer and use it in GitHub Desktop.
Git SRED helper.
This file contains 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
# In your .gitconfig add this alias: | |
# [alias] | |
# sred = "!source ~/.git_sred_log && sred_log" | |
# Assumes input date is formatted as YYYY-MM-DD, | |
# passes additional arguments to git-log. | |
sred_log() { | |
sred_date="${1:-$(date +"%Y-%m-%d")}" | |
shift | |
until_date=$(date -v "+1d" -jf "%Y-%m-%d" "${sred_date}") | |
since_date=$(date -v "-6d" -jf "%Y-%m-%d" "${sred_date}") | |
author=$(git config --get user.email) | |
git log --reverse --author "${author}" --since "${since_date}" --until "${until_date}" ${@} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment