Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added config git-extras.standup-implicit-week for git standup #966

Merged
merged 5 commits into from
May 9, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions bin/git-standup
Original file line number Diff line number Diff line change
Expand Up @@ -149,13 +149,26 @@ if [[ $# -gt 0 ]]; then
fi

AUTHOR=${AUTHOR:="$(git config user.name)"}
SINCE=${SINCE:=yesterday}
UNTIL=${UNTIL:=today}
FETCH_LAST_COMMIT=${FETCH_LAST_COMMIT:=false}
MAXDEPTH=${MAXDEPTH:=2}
GIT_PRETTY_FORMAT="%Cred%h%Creset - %s %Cgreen(%cd) %C(bold blue)<%an>%Creset $GIT_PRETTY_FORMAT"
GIT_DATE_FORMAT=${GIT_DATE_FORMAT:=relative}

# Handle config of implicit week
if [[ -z "$SINCE" ]] && [[ -z "$UNTIL" ]] && [[ -n "$(git config --get git-extras.standup-implicit-week)" ]]; then
week_range=$(git config --get git-extras.standup-implicit-week)
week_start=${week_range%%-*}
week_end=${week_range##*-}
shopt -s nocasematch
if [[ "$week_start" == "$(LC_ALL=C date +%a)" ]]; then
SINCE="last $week_end"
fi
UNTIL=today
else
SINCE=${SINCE:=yesterday}
UNTIL=${UNTIL:=today}
fi

GIT_LOG_COMMAND="git --no-pager log \
--no-merges
--since \"$SINCE\"
Expand Down