Last active
June 16, 2016 13:42
-
-
Save erkarp/73137d51d38562160ae0 to your computer and use it in GitHub Desktop.
Revisions
-
erkarp revised this gist
Jun 16, 2016 . No changes.There are no files selected for viewing
-
erkarp revised this gist
Jun 11, 2016 . 1 changed file with 4 additions and 22 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,28 +1,10 @@ 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" -
erkarp revised this gist
Dec 24, 2015 . 1 changed file with 13 additions and 4 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,9 @@ # Use function 'datecode' (with optional date arg yyyy-mm-dd) # Copy returned string as arg with function 'gitlog' # Other optional args: short/long, -n gitlog() { command='git log ' for var in "$@" do argument=$(check-arg $var) @@ -11,10 +14,7 @@ gitlog() { } check-arg() { case "$@" in short) echo ' --pretty=format:%Cblue%s%Creset' ;; long) echo ' --pretty=format:%C(Yellow)%h%Creset_%Cred%cd%Creset_%Cblue%s%Creset%C(magenta)%d%Creset --date=local' @@ -26,4 +26,13 @@ check-arg() { 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 } -
erkarp renamed this gist
Dec 24, 2015 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
erkarp created this gist
Dec 24, 2015 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,29 @@ gitlog() { command='git log ' #if $1 == for var in "$@" do argument=$(check-arg $var) command=$command$argument done echo $command $command } check-arg() { z=':' case "$@" in [0-9]**) echo --after=\"$1 00:00\" ;; short) echo ' --pretty=format:%Cblue%s%Creset' ;; long) echo ' --pretty=format:%C(Yellow)%h%Creset_%Cred%cd%Creset_%Cblue%s%Creset%C(magenta)%d%Creset --date=local' ;; -*) echo " $1" ;; esac } datestamp() { date +"%Y-%m-%d" }