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

#970 standup added -A flag for author date #974

Merged
merged 3 commits into from
Jul 4, 2022
Merged
Show file tree
Hide file tree
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
11 changes: 8 additions & 3 deletions bin/git-standup
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
usage() {
cat <<EOS
Usage:
git standup [-a <author name>] [-w <weekstart-weekend>|-d <days-ago>] [-m <max-dir-depth>] [-g] [-h] [-f] [-B] [-n <number-of-commits]
git standup [-a <author name>] [-w <weekstart-weekend>|-d <days-ago>] [-m <max-dir-depth>] [-D date-format] [-A] [-g] [-L] [-h] [-f] [-B] [-n <number-of-commits]

-a - Specify author to restrict search to, default to current git user.
Use "-a all" if you don't want the restriction.
Expand All @@ -14,6 +14,7 @@ usage() {
-L - Toggle inclusion of symbolic links in recursive directory search
-d - Specify the number of days back to include
-D - Specify the date format for "git log" (default: relative)
-A - Print author date instead of commit date
-h - Display this help screen
-g - Show if commit is GPG signed (G) or not (N)
-f - Fetch the latest commits beforehand
Expand Down Expand Up @@ -64,8 +65,9 @@ fi
set -e

RANGE_SPECIFIED=
COMMIT_DATE_FORMAT=%cd

while getopts "hgfBd:a:w:m:D:n:L" opt; do
while getopts "hgfBd:a:w:m:D:An:L" opt; do
case $opt in
h)
usage
Expand All @@ -78,6 +80,9 @@ while getopts "hgfBd:a:w:m:D:n:L" opt; do
AUTHOR="$OPTARG"
fi
;;
A)
COMMIT_DATE_FORMAT=%ad
;;
d)
test -n "$RANGE_SPECIFIED" && warn "-d option is conflict with -w"
RANGE_SPECIFIED=yes
Expand Down Expand Up @@ -155,7 +160,7 @@ fi
AUTHOR=${AUTHOR:="$(git config user.name)"}
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_PRETTY_FORMAT="%Cred%h%Creset - %s %Cgreen(${COMMIT_DATE_FORMAT}) %C(bold blue)<%an>%Creset $GIT_PRETTY_FORMAT"
tfendin marked this conversation as resolved.
Show resolved Hide resolved
GIT_DATE_FORMAT=${GIT_DATE_FORMAT:=relative}

# Handle config of implicit week
Expand Down
10 changes: 7 additions & 3 deletions man/git-standup.1
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
.\" generated with Ronn-NG/v0.9.1
.\" http://github.com/apjanke/ronn-ng/tree/0.9.1
.TH "GIT\-STANDUP" "1" "April 2022" "" "Git Extras"
.TH "GIT\-STANDUP" "1" "May 2022" "" "Git Extras"
.SH "NAME"
\fBgit\-standup\fR \- Recall the commit history
.SH "SYNOPSIS"
\fBgit\-standup\fR [\-a author] [\-w \fIweekstart\-weekend\fR|\-d \fIdays\-ago\fR] [\-m depth] [\-D date format] [\-g] [\-L] [\-f] [\-B] [\-n number of commits]
\fBgit\-standup\fR [\-a author] [\-w \fIweekstart\-weekend\fR|\-d \fIdays\-ago\fR] [\-m depth] [\-D date format] [\-A] [\-g] [\-L] [\-f] [\-B] [\-n number of commits]
.br
\fBgit\-standup\fR \-h
.SH "DESCRIPTION"
Expand All @@ -28,12 +28,16 @@ The start of commit history\. Defaults to 1, means "1 days ago"\.
.P
\-w \fIweekstart\-weekend\fR
.P
Limit the search range to weekdays\. If \fIweekstart\fR and/or \fIweekend\fR are missing they default to Mon and Fri\. If the current day is \fIweekstart\fR commits made on \fIweekend\fR will be included\. I\.e\. calling \fBgit standup \-w \-\fR on a Monday will include commits made on the last Friday\.
Limit the search range to weekdays\. If \fIweekstart\fR and/or \fIweekend\fR are missing they default to Mon and Fri\. If the current day is \fIweekstart\fR, commits made on \fIweekend\fR will be included\. I\.e\. calling \fBgit standup \-w \-\fR on a Monday will include commits made on the last Friday\.
.P
\-D relative
.P
The date format displayed in commit history\. Defaults to "relative"\.
.P
\-A
.P
Print the author date instead of the commit date\.
.P
\-h
.P
Display help message\.
Expand Down
10 changes: 7 additions & 3 deletions man/git-standup.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion man/git-standup.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ git-standup(1) -- Recall the commit history

## SYNOPSIS

`git-standup` [-a author] [-w <weekstart-weekend>|-d <days-ago>] [-m depth] [-D date format] [-g] [-L] [-f] [-B] [-n number of commits]
`git-standup` [-a author] [-w <weekstart-weekend>|-d <days-ago>] [-m depth] [-D date format] [-A] [-g] [-L] [-f] [-B] [-n number of commits]
`git-standup` -h

## DESCRIPTION
Expand Down Expand Up @@ -40,6 +40,10 @@ I.e. calling `git standup -w -` on a Monday will include commits made on the las

The date format displayed in commit history. Defaults to "relative".

-A

Print the author date instead of the commit date.

-h

Display help message.
Expand Down