From 7110b62a53415c029119dda90dbdc534bbc488e0 Mon Sep 17 00:00:00 2001 From: Matthew Mahnke Date: Sat, 3 Jun 2017 21:55:03 -0500 Subject: [PATCH 1/2] Add man page All commands should really have a manula page to describe all their functionality. http://asciidoc.org --- .gitignore | 2 + Makefile | 19 +++++++-- git-standup.1.asciidoc | 93 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 111 insertions(+), 3 deletions(-) create mode 100644 .gitignore create mode 100644 git-standup.1.asciidoc diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b8f513e --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +git-standup.1 +git-standup.1.gz diff --git a/Makefile b/Makefile index 33c62fe..2f4d12e 100644 --- a/Makefile +++ b/Makefile @@ -4,6 +4,7 @@ bindir=$(exec_prefix)/bin datarootdir=$(prefix)/share datadir=$(datarootdir) mandir=$(datarootdir)/man +man1_dir=$(mandir)/man1 # files that need mode 755 EXEC_FILES=git-standup @@ -13,12 +14,24 @@ EXEC_FILES=git-standup all: @echo "usage: make install" @echo " make uninstall" + @echo " make man" -install: - mkdir -p $(bindir) +git-standup.1: git-standup.1.asciidoc + a2x -Lf manpage $< + +git-standup.1.gz: git-standup.1 + gzip -f $< + +install: git-standup.1.gz + mkdir -p $(bindir) $(man1_dir) install -m 0755 $(EXEC_FILES) $(bindir) + install -m 0644 "git-standup.1.gz" $(man1_dir) + +man: git-standup.1.gz uninstall: test -d $(bindir) && \ cd $(bindir) && \ - rm -f $(EXEC_FILES) \ No newline at end of file + rm -f $(EXEC_FILES) + test -f "$(man1_dir)/git-standup.1.gz" && \ + rm -f "$(man1_dir)/git-standup.1.gz" diff --git a/git-standup.1.asciidoc b/git-standup.1.asciidoc new file mode 100644 index 0000000..b557bb0 --- /dev/null +++ b/git-standup.1.asciidoc @@ -0,0 +1,93 @@ +git-standup(1) +============== + +NAME +---- +git-standup - Recall what you did on the last working day + +SYNOPSIS +-------- +*git standup* [*-a* __] + [*-D* __] + [*-L*] + [*-d* __] + [*-f*] + [*-g*] + [*-m* __] + [*-w* __] + +*git standup* *-h* + +DESCRIPTION +----------- +Recall what you did on the last working day ... or be nosy and find what +someone else did. + +Running this command in a Git repository will only search the commits for that +specific reposity. However, when outside a repository, all subdirectories will +be searched recursively. + +OPTIONS +------- +*-a* _author_:: + Only show results for authors that match _author_, it can be a name or + an email address. + If _author_ is "all", commits by everyone will be shown. + +*-D* _format_:: + Specify the date format for _git log_. If not specified, the default is + "relative". _format_ can be any value that _git log --date_ accepts. + +*-L*:: + Toggle inclusion of symbolic links in recursive directory search. + +*-d* _num_:: + Show commits since _num_ days ago. + + Overrides the *-w* option. + +*-f*:: + Fetch the latest commits beforehand. This is useful when there are many + repositories you want to generate a standup for; _git fetch --all_ will + automatically run before printing the standup. + +*-g*:: + Show if a commit if GPG signed or not. + +*-h*:: + Prints a usage message. + +*-m* _depth_:: + Search upto _depth_ directories inside the current working directory. + +*-w* _range_:: + By default, it considers that the work week starts on Monday and ends on + Friday. So if you are running this on any day between Tuesday and Friday, it + will show you commits from the last day. However, if you are running this on + Monday, it will show you commits since Friday. + + If you want to change the work week to Sunday to Thrusday, _range_ will be + "SUN-THU". + + This is overridden by the *-d* option. + +BUGS +---- +Please submit an issue at https://github.com/kamranahmedse/git-standup/issues + +RESOURCES +--------- +Main web site: https://github.com/kamranahmedse/git-standup + +EXAMPLE +-------- +Showing commits by anyone in the last three months is done by: +[source,console] +---- +$ git standup -a "all" -d 90 +9fbe2cc - Add MIT License file (#74) (3 weeks ago) +17f03cd - Remove hugobots reference (9 weeks ago) +350e244 - Add AUR package to readme. (#65) (2 months ago) +5ae7d15 - Add the link to hugobots (2 months ago) +---- + +SEE ALSO +-------- +*git-log*(1) From 920833a3226ef99a1f950bbc3983cd3a3e30ab17 Mon Sep 17 00:00:00 2001 From: Matthew Mahnke Date: Mon, 22 Jan 2018 22:36:10 -0600 Subject: [PATCH 2/2] Change AsciiDoc-based manual page to roff-based Requiring a2x as a dependency is too heavy, considering the rest of the project is just shell script. The AsciiDoc documented has been replaced with a hand-written groff manual page. --- .gitignore | 1 - Makefile | 5 +- git-standup.1 | 126 +++++++++++++++++++++++++++++++++++++++++ git-standup.1.asciidoc | 93 ------------------------------ 4 files changed, 127 insertions(+), 98 deletions(-) create mode 100644 git-standup.1 delete mode 100644 git-standup.1.asciidoc diff --git a/.gitignore b/.gitignore index b8f513e..0e3d0db 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1 @@ -git-standup.1 git-standup.1.gz diff --git a/Makefile b/Makefile index 2f4d12e..770c1c4 100644 --- a/Makefile +++ b/Makefile @@ -16,11 +16,8 @@ all: @echo " make uninstall" @echo " make man" -git-standup.1: git-standup.1.asciidoc - a2x -Lf manpage $< - git-standup.1.gz: git-standup.1 - gzip -f $< + gzip -fk $< install: git-standup.1.gz mkdir -p $(bindir) $(man1_dir) diff --git a/git-standup.1 b/git-standup.1 new file mode 100644 index 0000000..21b609d --- /dev/null +++ b/git-standup.1 @@ -0,0 +1,126 @@ +.TH "GIT-STANDUP" "1" "2018-01-22" "v2.1.7" "Git Manual" + +.\"---------------------------------------------------------------------- +.SH "NAME" +.\"---------------------------------------------------------------------- + +git-standup \- recall what you did on the last working day + +.\"---------------------------------------------------------------------- +.SH "SYNOPSIS" +.\"---------------------------------------------------------------------- +.\" keep single-character options at the start, alphabetize the remaining +.SY "git standup" +.OP \-Lfg +.OP \-a "author" +.OP \-D "date format" +.OP \-d "days ago" +.OP \-m "max directory depth" +.OP \-w "weekstart\(enweekend" +.YS + +.SY "git standup" +.B \-h +.YS + +.\"---------------------------------------------------------------------- +.SH "DESCRIPTION" +.\"---------------------------------------------------------------------- + +Recall what you did on the last working day ... or be nosy and find out +what someone else did. +Running this command in a Git repository will only search the commits for +that specific repository. +However, when outside a repository, all subdirectories will be searched +recursively. + +.\"---------------------------------------------------------------------- +.SH "OPTIONS" +.\"---------------------------------------------------------------------- +.\" keep these sorted in the order that they're listed in the SYNOPSIS +.TP +.BI "\-L" +Enable inclusion of symbolic links in recursive directory search. +.TP +.BI "\-f" +Fetch the latest commits beforehand. +This is useful when there are many repositories you want to generate a +standup for; \fIgit fetch --all\fR will automatically run before printing +the standup. +.TP +.BI "\-g" +Show if a commit is GPG signed or not. +.TP +.BI "\-h" +Prints a usage message. +.TP +.BI "\-a"\ author +Only show results for commit authors that match \fIauthor\fR, it can be a +name, an email address, or "all". +.TP +.BI "\-D"\ format +Specify the date format for \fIgit log\fR. +If not specified, the default is "relative". +\fIformat\fR can be any value that \fIgit log --date\fR accepts. +.TP +.BI "\-d"\ num +Show commits since \fInum\fR days ago. + +Overrides the \fI\-w\fR option. +.TP +.BI "\-m"\ depth +Search upto \fIdepth\fR directories inside the current working directory. +.TP +.BI "\-w"\ range +By default, git-standup considers that the work week starts on Monday and +ends on Friday. +So if you are running this on any day between Tuesday and +Friday, it will show you commit from the last day. +However, if you are running this on Monday, it will show you commits since +Friday. + +If you want to change the work week to Sunday to Thursday, \fIrange\fR will +be "SUN-THU". + +Overridden by the \fI\-d\fR option. + +.\"---------------------------------------------------------------------- +.SH "BUGS" +.\"---------------------------------------------------------------------- + +Please submit an issue at +.UR https://github.com/kamranahmedse/git-standup/issues +.UE . + +.\"---------------------------------------------------------------------- +.SH "RESOURCES" +.\"---------------------------------------------------------------------- + +.IP \(bu 4 +Main website: +.UR https://github.com/kamranahmedse/git-standup +.UE . +.RE + +.\"---------------------------------------------------------------------- +.SH "EXAMPLE" +.\"---------------------------------------------------------------------- + +Showing commits by anyone in the last three month is done by: +.PP +.in +4n +.EX +$ \fBgit standup \-a "all" \-d 90\fR +9fbe2cc - Add MIT Livense file (#74) (3 weeks ago) +17f03cd - Remove hugobots reference (#65) (9 weeks ago) +350e244 - Add AUR package to readme. (#65) (2 months ago) +5ae7d15 - Add the link to hugobots (2 moths ago) +.EE +.in + +.\"---------------------------------------------------------------------- +.SH "SEE ALSO" +.\"---------------------------------------------------------------------- + +.BR git\-log (1) +.\" vim:tw=75: diff --git a/git-standup.1.asciidoc b/git-standup.1.asciidoc deleted file mode 100644 index b557bb0..0000000 --- a/git-standup.1.asciidoc +++ /dev/null @@ -1,93 +0,0 @@ -git-standup(1) -============== - -NAME ----- -git-standup - Recall what you did on the last working day - -SYNOPSIS --------- -*git standup* [*-a* __] - [*-D* __] - [*-L*] - [*-d* __] - [*-f*] - [*-g*] - [*-m* __] - [*-w* __] - -*git standup* *-h* - -DESCRIPTION ------------ -Recall what you did on the last working day ... or be nosy and find what -someone else did. - -Running this command in a Git repository will only search the commits for that -specific reposity. However, when outside a repository, all subdirectories will -be searched recursively. - -OPTIONS -------- -*-a* _author_:: - Only show results for authors that match _author_, it can be a name or - an email address. - If _author_ is "all", commits by everyone will be shown. - -*-D* _format_:: - Specify the date format for _git log_. If not specified, the default is - "relative". _format_ can be any value that _git log --date_ accepts. - -*-L*:: - Toggle inclusion of symbolic links in recursive directory search. - -*-d* _num_:: - Show commits since _num_ days ago. + - Overrides the *-w* option. - -*-f*:: - Fetch the latest commits beforehand. This is useful when there are many - repositories you want to generate a standup for; _git fetch --all_ will - automatically run before printing the standup. - -*-g*:: - Show if a commit if GPG signed or not. - -*-h*:: - Prints a usage message. - -*-m* _depth_:: - Search upto _depth_ directories inside the current working directory. - -*-w* _range_:: - By default, it considers that the work week starts on Monday and ends on - Friday. So if you are running this on any day between Tuesday and Friday, it - will show you commits from the last day. However, if you are running this on - Monday, it will show you commits since Friday. + - If you want to change the work week to Sunday to Thrusday, _range_ will be - "SUN-THU". + - This is overridden by the *-d* option. - -BUGS ----- -Please submit an issue at https://github.com/kamranahmedse/git-standup/issues - -RESOURCES ---------- -Main web site: https://github.com/kamranahmedse/git-standup - -EXAMPLE --------- -Showing commits by anyone in the last three months is done by: -[source,console] ----- -$ git standup -a "all" -d 90 -9fbe2cc - Add MIT License file (#74) (3 weeks ago) -17f03cd - Remove hugobots reference (9 weeks ago) -350e244 - Add AUR package to readme. (#65) (2 months ago) -5ae7d15 - Add the link to hugobots (2 months ago) ----- - -SEE ALSO --------- -*git-log*(1)