agile - git log since yesterday for working days only -
for daily standups output commits refresher of working on.
i have following alias:
standup = log --graph --pretty=format:'%cred%h%creset -%c(yellow)%d%creset %s %cgreen(%cr) %c(green)<%an>%creset' --abbrev-commit --date=relative --committer='me' --all --since='yesterday'
however not work monday morning due weekend.
does know how use git log --since
set of working days such mon - fri, or tue - sat?
assuming posix-y shell, in case bash:
function yesterworkday() { if [[ "1" == "$(date +%u)" ]] echo "last friday" else echo "yesterday" fi } git log --since="$(yesterworkday)"
again credits go authors of git
making insanely easy by accepting "last friday" valid date specification begin with!
ps. make git alias, need include bash shell in alias, i'll edit sample in minute
edit putting logic directly git alias proves difficult (with quoting required). see here ideas: .gitconfig alias function call
i recommend making shell script of this, , alias shell script directly so:
standup = !$home/standuplog.sh
or add 1 of $path
folders , name git-standup
.
Comments
Post a Comment