mirror of
https://github.com/tj/git-extras.git
synced 2026-09-10 07:26:17 -04:00
Merge pull request #974 from tfendin/970-standup-author-date
#970 standup added -A flag for author date
This commit is contained in:
commit
81665422b2
|
|
@ -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] [-L] [-h] [-f] [-B] [-n <number-of-commits] [-F <gpg|authordate>]
|
||||
|
||||
-a - Specify author to restrict search to, default to current git user.
|
||||
Use "-a all" if you don't want the restriction.
|
||||
|
|
@ -15,10 +15,11 @@ usage() {
|
|||
-d - Specify the number of days back to include
|
||||
-D - Specify the date format for "git log" (default: relative)
|
||||
-h - Display this help screen
|
||||
-g - Show if commit is GPG signed (G) or not (N)
|
||||
-f - Fetch the latest commits beforehand
|
||||
-B - Display the commits in branch groups
|
||||
-n - Limit the number of commits displayed per group
|
||||
-F gpg - Show if commit is GPG signed (G) or not (N)
|
||||
-F authordate - Print author date instead of commit date
|
||||
|
||||
Examples:
|
||||
git standup -a "John Doe" -w "MON-FRI" -m 3
|
||||
|
|
@ -64,8 +65,10 @@ fi
|
|||
set -e
|
||||
|
||||
RANGE_SPECIFIED=
|
||||
COMMIT_DATE_FORMAT=%cd
|
||||
USE_GPG_FORMAT=no
|
||||
|
||||
while getopts "hgfBd:a:w:m:D:n:L" opt; do
|
||||
while getopts "hgfF:Bd:a:w:m:D:n:L" opt; do
|
||||
case $opt in
|
||||
h)
|
||||
usage
|
||||
|
|
@ -124,7 +127,8 @@ while getopts "hgfBd:a:w:m:D:n:L" opt; do
|
|||
GIT_DATE_FORMAT=${OPTARG}
|
||||
;;
|
||||
g)
|
||||
GIT_PRETTY_FORMAT="%C(yellow)gpg: %G?%Creset"
|
||||
warn "-g option is deprecated, use '-F gpg' instead"
|
||||
USE_GPG_FORMAT=yes
|
||||
;;
|
||||
B)
|
||||
GROUP_BY_BRANCHES=true
|
||||
|
|
@ -132,6 +136,21 @@ while getopts "hgfBd:a:w:m:D:n:L" opt; do
|
|||
n)
|
||||
MAX_COMMIT_NUM=${OPTARG}
|
||||
;;
|
||||
F)
|
||||
case $OPTARG in
|
||||
gpg)
|
||||
USE_GPG_FORMAT=yes
|
||||
;;
|
||||
authordate)
|
||||
COMMIT_DATE_FORMAT=%ad
|
||||
;;
|
||||
*)
|
||||
warn "Invalid argument for -F: $OPTARG"
|
||||
usage
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
\?)
|
||||
usage
|
||||
exit 1
|
||||
|
|
@ -155,8 +174,11 @@ 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_DATE_FORMAT=${GIT_DATE_FORMAT:=relative}
|
||||
if [[ "$USE_GPG_FORMAT" == 'yes' ]]; then
|
||||
GIT_PRETTY_FORMAT="$GIT_PRETTY_FORMAT %C(yellow)gpg: %G?%Creset"
|
||||
fi
|
||||
|
||||
# Handle config of implicit week
|
||||
IMPLICIT_WEEK=$(git config --get git-extras.standup.implicit-week)
|
||||
|
|
|
|||
|
|
@ -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" "July 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] [\-L] [\-f] [\-B] [\-n number of commits] [\-F \fIgpg|authordate\fR]
|
||||
.br
|
||||
\fBgit\-standup\fR \-h
|
||||
.SH "DESCRIPTION"
|
||||
|
|
@ -28,7 +28,7 @@ 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
|
||||
|
|
@ -38,10 +38,6 @@ The date format displayed in commit history\. Defaults to "relative"\.
|
|||
.P
|
||||
Display help message\.
|
||||
.P
|
||||
\-g
|
||||
.P
|
||||
Display if commit is GPG signed (G) or not (N) in commit message\.
|
||||
.P
|
||||
\-f
|
||||
.P
|
||||
Fetch the latest commits before showing commit history\.
|
||||
|
|
@ -55,6 +51,15 @@ Display the commits in branch groups\.
|
|||
\-n number\-of\-commits
|
||||
.P
|
||||
Limit the number of commits displayed per group\. By default, the limitation is applied in the repository level\. For example, if you have 3 repositories under the current directory, \fBgit standup \|\.\|\.\|\. \-n 1\fR will show you 3 commits at most\. When \fB\-B\fR is specific, the limitation is applied in the branch level\. For instance, if each of your 3 repositories have 2 branches, \fBgit standup \|\.\|\.\|\. \-B \-n 1\fR will display 6 commits at most\.
|
||||
.P
|
||||
\-F \fIgpg|authordate\fR
|
||||
.P
|
||||
Change how the commits are formatted\. Takes an argument, can be specified multiple times\.
|
||||
.IP "\[ci]" 4
|
||||
\fB\-F gpg\fR: Display if commit is GPG signed (G) or not (N)\.
|
||||
.IP "\[ci]" 4
|
||||
\fB\-F authordate\fR: Print the author date instead of the commit date\.
|
||||
.IP "" 0
|
||||
.SH "GIT CONFIGS"
|
||||
You can configure a implicit \-w \fIweekstart\-weekend\fR, which is superseded if \-w or \-d is given on the command line\. Note that the \fIweekstart\-weekend\fR must be specified, they don\'t have any default values as the \fB\-w\fR flag has\.
|
||||
.IP "" 4
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@
|
|||
</p>
|
||||
<h2 id="SYNOPSIS">SYNOPSIS</h2>
|
||||
|
||||
<p><code>git-standup</code> [-a author] [-w <var>weekstart-weekend</var>|-d <var>days-ago</var>] [-m depth] [-D date format] [-g] [-L] [-f] [-B] [-n number of commits]<br>
|
||||
<p><code>git-standup</code> [-a author] [-w <var>weekstart-weekend</var>|-d <var>days-ago</var>] [-m depth] [-D date format] [-L] [-f] [-B] [-n number of commits] [-F <var>gpg|authordate</var>]<br>
|
||||
<code>git-standup</code> -h</p>
|
||||
|
||||
<h2 id="DESCRIPTION">DESCRIPTION</h2>
|
||||
|
|
@ -108,7 +108,7 @@ Defaults to <code>$(git config user.name)</code>.</p>
|
|||
|
||||
<p>Limit the search range to weekdays.
|
||||
If <var>weekstart</var> and/or <var>weekend</var> are missing they default to Mon and Fri.
|
||||
If the current day is <var>weekstart</var> commits made on <var>weekend</var> will be included.
|
||||
If the current day is <var>weekstart</var>, commits made on <var>weekend</var> will be included.
|
||||
I.e. calling <code>git standup -w -</code> on a Monday will include commits made on the last Friday.</p>
|
||||
|
||||
<p>-D relative</p>
|
||||
|
|
@ -119,10 +119,6 @@ I.e. calling <code>git standup -w -</code> on a Monday will include commits made
|
|||
|
||||
<p>Display help message.</p>
|
||||
|
||||
<p>-g</p>
|
||||
|
||||
<p>Display if commit is GPG signed (G) or not (N) in commit message.</p>
|
||||
|
||||
<p>-f</p>
|
||||
|
||||
<p>Fetch the latest commits before showing commit history.</p>
|
||||
|
|
@ -144,6 +140,17 @@ When <code>-B</code> is specific, the limitation is applied in the branch level
|
|||
if each of your 3 repositories have 2 branches, <code>git standup ... -B -n 1</code> will
|
||||
display 6 commits at most.</p>
|
||||
|
||||
<p>-F <var>gpg|authordate</var></p>
|
||||
|
||||
<p>Change how the commits are formatted. Takes an argument, can be specified multiple times.</p>
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
<code>-F gpg</code>: Display if commit is GPG signed (G) or not (N).</li>
|
||||
<li>
|
||||
<code>-F authordate</code>: Print the author date instead of the commit date.</li>
|
||||
</ul>
|
||||
|
||||
<h2 id="GIT-CONFIGS">GIT CONFIGS</h2>
|
||||
|
||||
<p>You can configure a implicit -w <var>weekstart-weekend</var>, which is superseded if -w or -d is given on the command line.
|
||||
|
|
@ -214,7 +221,7 @@ master
|
|||
|
||||
<ol class='man-decor man-foot man foot'>
|
||||
<li class='tl'></li>
|
||||
<li class='tc'>April 2022</li>
|
||||
<li class='tc'>July 2022</li>
|
||||
<li class='tr'>git-standup(1)</li>
|
||||
</ol>
|
||||
|
||||
|
|
|
|||
|
|
@ -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] [-L] [-f] [-B] [-n number of commits] [-F <gpg|authordate>]
|
||||
`git-standup` -h
|
||||
|
||||
## DESCRIPTION
|
||||
|
|
@ -44,10 +44,6 @@ The date format displayed in commit history. Defaults to "relative".
|
|||
|
||||
Display help message.
|
||||
|
||||
-g
|
||||
|
||||
Display if commit is GPG signed (G) or not (N) in commit message.
|
||||
|
||||
-f
|
||||
|
||||
Fetch the latest commits before showing commit history.
|
||||
|
|
@ -69,6 +65,13 @@ When `-B` is specific, the limitation is applied in the branch level. For insta
|
|||
if each of your 3 repositories have 2 branches, `git standup ... -B -n 1` will
|
||||
display 6 commits at most.
|
||||
|
||||
-F <gpg|authordate>
|
||||
|
||||
Change how the commits are formatted. Takes an argument, can be specified multiple times.
|
||||
|
||||
* `-F gpg`: Display if commit is GPG signed (G) or not (N).
|
||||
* `-F authordate`: Print the author date instead of the commit date.
|
||||
|
||||
## GIT CONFIGS
|
||||
|
||||
You can configure a implicit -w <weekstart-weekend>, which is superseded if -w or -d is given on the command line.
|
||||
|
|
|
|||
Loading…
Reference in a new issue