From 233b3f0dd4d7bc595a5acc3349f6bcde998ff70a Mon Sep 17 00:00:00 2001 From: Tobias Fendin Date: Sat, 14 May 2022 15:17:58 +0200 Subject: [PATCH 1/3] #970 standup added -A flag for author date --- bin/git-standup | 11 ++++++++--- man/git-standup.1 | 10 +++++++--- man/git-standup.html | 10 +++++++--- man/git-standup.md | 6 +++++- 4 files changed, 27 insertions(+), 10 deletions(-) diff --git a/bin/git-standup b/bin/git-standup index d2f0ad44f..6598e1c16 100755 --- a/bin/git-standup +++ b/bin/git-standup @@ -5,7 +5,7 @@ usage() { cat <] [-w |-d ] [-m ] [-g] [-h] [-f] [-B] [-n ] [-w |-d ] [-m ] [-D date-format] [-A] [-g] [-L] [-h] [-f] [-B] [-n NAME

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

@@ -108,13 +108,17 @@

OPTIONS

Limit the search range to weekdays. If weekstart and/or weekend are missing they default to Mon and Fri. -If the current day is weekstart commits made on weekend will be included. +If the current day is weekstart, commits made on weekend will be included. I.e. calling git standup -w - on a Monday will include commits made on the last Friday.

-D relative

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

+

-A

+ +

Print the author date instead of the commit date.

+

-h

Display help message.

@@ -214,7 +218,7 @@

SEE ALSO

  1. -
  2. April 2022
  3. +
  4. May 2022
  5. git-standup(1)
diff --git a/man/git-standup.md b/man/git-standup.md index 5956b507d..573cd188e 100644 --- a/man/git-standup.md +++ b/man/git-standup.md @@ -3,7 +3,7 @@ git-standup(1) -- Recall the commit history ## SYNOPSIS -`git-standup` [-a author] [-w |-d ] [-m depth] [-D date format] [-g] [-L] [-f] [-B] [-n number of commits] +`git-standup` [-a author] [-w |-d ] [-m depth] [-D date format] [-A] [-g] [-L] [-f] [-B] [-n number of commits] `git-standup` -h ## DESCRIPTION @@ -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. From bf240df08396c9680de146bab349be13803f30d8 Mon Sep 17 00:00:00 2001 From: Tobias Fendin Date: Sun, 26 Jun 2022 12:49:43 +0200 Subject: [PATCH 2/3] Replaced -g and -A with -F gpg|authordate --- bin/git-standup | 35 ++++++++++++++++++++++++++--------- man/git-standup.1 | 16 ++++++---------- man/git-standup.html | 16 ++++++---------- man/git-standup.md | 14 +++++--------- 4 files changed, 43 insertions(+), 38 deletions(-) diff --git a/bin/git-standup b/bin/git-standup index 6598e1c16..5a3213ee7 100755 --- a/bin/git-standup +++ b/bin/git-standup @@ -5,7 +5,7 @@ usage() { cat <] [-w |-d ] [-m ] [-D date-format] [-A] [-g] [-L] [-h] [-f] [-B] [-n ] [-w |-d ] [-m ] [-D date-format] [-L] [-h] [-f] [-B] [-n ] -a - Specify author to restrict search to, default to current git user. Use "-a all" if you don't want the restriction. @@ -14,12 +14,12 @@ 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 -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 @@ -66,8 +66,9 @@ set -e RANGE_SPECIFIED= COMMIT_DATE_FORMAT=%cd +USE_GPG_FORMAT=no -while getopts "hgfBd:a:w:m:D:An:L" opt; do +while getopts "hgfF:Bd:a:w:m:D:n:L" opt; do case $opt in h) usage @@ -80,9 +81,6 @@ while getopts "hgfBd:a:w:m:D:An: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 @@ -129,7 +127,8 @@ while getopts "hgfBd:a:w:m:D:An: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 @@ -137,6 +136,21 @@ while getopts "hgfBd:a:w:m:D:An: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 @@ -160,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(${COMMIT_DATE_FORMAT}) %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) diff --git a/man/git-standup.1 b/man/git-standup.1 index 0b42577ab..2be2d3d3b 100644 --- a/man/git-standup.1 +++ b/man/git-standup.1 @@ -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" "May 2022" "" "Git Extras" +.TH "GIT\-STANDUP" "1" "June 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] [\-A] [\-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" @@ -34,18 +34,10 @@ Limit the search range to weekdays\. If \fIweekstart\fR and/or \fIweekend\fR are .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\. .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\. @@ -59,6 +51,10 @@ 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\. \fB\-F gpg\fR: Display if commit is GPG signed (G) or not (N)\. \fB\-F authordate\fR: Print the author date instead of the commit date\. .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 diff --git a/man/git-standup.html b/man/git-standup.html index b854b6ebf..ebe3fbcf1 100644 --- a/man/git-standup.html +++ b/man/git-standup.html @@ -78,7 +78,7 @@

NAME

SYNOPSIS

-

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 [-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

@@ -115,18 +115,10 @@

OPTIONS

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

-

-A

- -

Print the author date instead of the commit date.

-

-h

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.

@@ -148,6 +140,10 @@

OPTIONS

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. @@ -218,7 +214,7 @@

SEE ALSO

  1. -
  2. May 2022
  3. +
  4. June 2022
  5. git-standup(1)
diff --git a/man/git-standup.md b/man/git-standup.md index 573cd188e..6b89c54d9 100644 --- a/man/git-standup.md +++ b/man/git-standup.md @@ -3,7 +3,7 @@ git-standup(1) -- Recall the commit history ## SYNOPSIS -`git-standup` [-a author] [-w |-d ] [-m depth] [-D date format] [-A] [-g] [-L] [-f] [-B] [-n number of commits] +`git-standup` [-a author] [-w |-d ] [-m depth] [-D date format] [-L] [-f] [-B] [-n number of commits] [-F ] `git-standup` -h ## DESCRIPTION @@ -40,18 +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. --g - -Display if commit is GPG signed (G) or not (N) in commit message. - -f Fetch the latest commits before showing commit history. @@ -73,6 +65,10 @@ 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 + +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 , which is superseded if -w or -d is given on the command line. From 48ef95d104c4cdc8ac6e2fab436af8ca742b321b Mon Sep 17 00:00:00 2001 From: Tobias Fendin Date: Fri, 1 Jul 2022 16:39:27 +0200 Subject: [PATCH 3/3] Minor changes to man/git-standup.md --- man/git-standup.1 | 9 +++++++-- man/git-standup.html | 11 +++++++++-- man/git-standup.md | 5 ++++- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/man/git-standup.1 b/man/git-standup.1 index 2be2d3d3b..f6f35e2df 100644 --- a/man/git-standup.1 +++ b/man/git-standup.1 @@ -1,6 +1,6 @@ .\" generated with Ronn-NG/v0.9.1 .\" http://github.com/apjanke/ronn-ng/tree/0.9.1 -.TH "GIT\-STANDUP" "1" "June 2022" "" "Git Extras" +.TH "GIT\-STANDUP" "1" "July 2022" "" "Git Extras" .SH "NAME" \fBgit\-standup\fR \- Recall the commit history .SH "SYNOPSIS" @@ -54,7 +54,12 @@ Limit the number of commits displayed per group\. By default, the limitation is .P \-F \fIgpg|authordate\fR .P -Change how the commits are formatted\. Takes an argument, can be specified multiple times\. \fB\-F gpg\fR: Display if commit is GPG signed (G) or not (N)\. \fB\-F authordate\fR: Print the author date instead of the commit date\. +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 diff --git a/man/git-standup.html b/man/git-standup.html index ebe3fbcf1..3b8413d03 100644 --- a/man/git-standup.html +++ b/man/git-standup.html @@ -142,7 +142,14 @@

OPTIONS

-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.

+

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

@@ -214,7 +221,7 @@

SEE ALSO

  1. -
  2. June 2022
  3. +
  4. July 2022
  5. git-standup(1)
diff --git a/man/git-standup.md b/man/git-standup.md index 6b89c54d9..49f6de5e6 100644 --- a/man/git-standup.md +++ b/man/git-standup.md @@ -67,7 +67,10 @@ display 6 commits at most. -F -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. +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