Skip to content

Commit 233b3f0

Browse files
committed
tj#970 standup added -A flag for author date
1 parent fdf89cd commit 233b3f0

File tree

4 files changed

+27
-10
lines changed

4 files changed

+27
-10
lines changed

bin/git-standup

+8-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
usage() {
66
cat <<EOS
77
Usage:
8-
git standup [-a <author name>] [-w <weekstart-weekend>|-d <days-ago>] [-m <max-dir-depth>] [-g] [-h] [-f] [-B] [-n <number-of-commits]
8+
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]
99
1010
-a - Specify author to restrict search to, default to current git user.
1111
Use "-a all" if you don't want the restriction.
@@ -14,6 +14,7 @@ usage() {
1414
-L - Toggle inclusion of symbolic links in recursive directory search
1515
-d - Specify the number of days back to include
1616
-D - Specify the date format for "git log" (default: relative)
17+
-A - Print author date instead of commit date
1718
-h - Display this help screen
1819
-g - Show if commit is GPG signed (G) or not (N)
1920
-f - Fetch the latest commits beforehand
@@ -64,8 +65,9 @@ fi
6465
set -e
6566

6667
RANGE_SPECIFIED=
68+
COMMIT_DATE_FORMAT=%cd
6769

68-
while getopts "hgfBd:a:w:m:D:n:L" opt; do
70+
while getopts "hgfBd:a:w:m:D:An:L" opt; do
6971
case $opt in
7072
h)
7173
usage
@@ -78,6 +80,9 @@ while getopts "hgfBd:a:w:m:D:n:L" opt; do
7880
AUTHOR="$OPTARG"
7981
fi
8082
;;
83+
A)
84+
COMMIT_DATE_FORMAT=%ad
85+
;;
8186
d)
8287
test -n "$RANGE_SPECIFIED" && warn "-d option is conflict with -w"
8388
RANGE_SPECIFIED=yes
@@ -155,7 +160,7 @@ fi
155160
AUTHOR=${AUTHOR:="$(git config user.name)"}
156161
FETCH_LAST_COMMIT=${FETCH_LAST_COMMIT:=false}
157162
MAXDEPTH=${MAXDEPTH:=2}
158-
GIT_PRETTY_FORMAT="%Cred%h%Creset - %s %Cgreen(%cd) %C(bold blue)<%an>%Creset $GIT_PRETTY_FORMAT"
163+
GIT_PRETTY_FORMAT="%Cred%h%Creset - %s %Cgreen(${COMMIT_DATE_FORMAT}) %C(bold blue)<%an>%Creset $GIT_PRETTY_FORMAT"
159164
GIT_DATE_FORMAT=${GIT_DATE_FORMAT:=relative}
160165

161166
# Handle config of implicit week

man/git-standup.1

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
.\" generated with Ronn-NG/v0.9.1
22
.\" http://github.com/apjanke/ronn-ng/tree/0.9.1
3-
.TH "GIT\-STANDUP" "1" "April 2022" "" "Git Extras"
3+
.TH "GIT\-STANDUP" "1" "May 2022" "" "Git Extras"
44
.SH "NAME"
55
\fBgit\-standup\fR \- Recall the commit history
66
.SH "SYNOPSIS"
7-
\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]
7+
\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]
88
.br
99
\fBgit\-standup\fR \-h
1010
.SH "DESCRIPTION"
@@ -28,12 +28,16 @@ The start of commit history\. Defaults to 1, means "1 days ago"\.
2828
.P
2929
\-w \fIweekstart\-weekend\fR
3030
.P
31-
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\.
31+
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\.
3232
.P
3333
\-D relative
3434
.P
3535
The date format displayed in commit history\. Defaults to "relative"\.
3636
.P
37+
\-A
38+
.P
39+
Print the author date instead of the commit date\.
40+
.P
3741
\-h
3842
.P
3943
Display help message\.

man/git-standup.html

+7-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/git-standup.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ git-standup(1) -- Recall the commit history
33

44
## SYNOPSIS
55

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

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

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

43+
-A
44+
45+
Print the author date instead of the commit date.
46+
4347
-h
4448

4549
Display help message.

0 commit comments

Comments
 (0)