Skip to content

Instantly share code, notes, and snippets.

@afknapping
Created May 14, 2014 15:59
Show Gist options
  • Save afknapping/ef9d0fb753fde7bf33ae to your computer and use it in GitHub Desktop.
Save afknapping/ef9d0fb753fde7bf33ae to your computer and use it in GitHub Desktop.
bash aliases for wtf did i do today (and yesterday)
alias wtf-did-i-do-yesterday="echo '' && echo 'wtf did i do yesterday?' && echo '' && git log --pretty=format:'%Cred%h%Creset - %s%Creset - %Cgreen%cd%Creset ' --date=relative --all --since=2.days.ago --until=1.day.ago --author=\"$(git config user.name)\""
alias wtf-did-i-do-today="echo '' && echo 'wtf did i do today?' && echo '' && git log --pretty=format:'%Cred%h%Creset - %s%Creset - %Cgreen%cd%Creset ' --date=relative --all --since=6am --author=\"$(git config user.name)\""
# the aliases need escaped double quotes
# to try the commands directly, copy this and paste into your terminal:
# echo '' && echo 'wtf did i do today?' && echo '' && git log --pretty=format:'%Cred%h%Creset - %s%Creset - %Cgreen%cd%Creset ' --date=relative --all --since=6am --author="$(git config user.name)"
@afknapping
Copy link
Author

true, the relative dates seem to have a breakpoint somewhere in the "30s of hours ago" where they switch to "2 days ago".

the original idea was to have a list of commits for the morning daily, so the the timestamps would normally not go below 24 hours.

@romanbloeth
Copy link

Sure they are from 1 day ago? The command reads "--since=2.days.ago --until=1.day.ago", so it shows stuff from 2 days ago as well - works like that here.

@stryju
Copy link

stryju commented May 15, 2014

the original idea was to have a list of commits for the morning daily, so the the timestamps would normally not go below 24 hours.

but that wouldn't show anything from yesterday if i check it in the morning...

@romanbloeth is right, i think it should be --since=yesterday --until=6am

@romanbloeth
Copy link

Anyway, big thx to you, @filtercake, as this is really a very nice and handy alias for my everyday use from now on! Great idea!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment