Last active
June 16, 2016 13:42
-
-
Save erkarp/73137d51d38562160ae0 to your computer and use it in GitHub Desktop.
Bash functions to format git log
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
| gitlog() { | |
| c="git log --all --decorate --graph --pretty=format:%C(Yellow)%h%Creset_%Cred%cd%Creset_%Cblue%s%Creset%C(magenta)%d%Creset --date=local" | |
| $c | |
| } | |
| # Use function 'datecode' (with optional date arg yyyy-mm-dd) | |
| datestamp() { | |
| date +"%Y-%m-%d" | |
| } | |
| datecode() { | |
| if [[ $1 =~ [0-9] ]] | |
| then | |
| echo "--after='$1 00:00' --before='23:59'" | |
| else | |
| echo $1 | |
| echo "--after='$(datestamp) 00'" | |
| fi | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment