From a7b7f05b5bab2999263bf26e5c4eaf22eaddbef4 Mon Sep 17 00:00:00 2001 From: Tobias Fendin Date: Wed, 11 Aug 2021 16:38:21 +0200 Subject: [PATCH] Add incompability check for git summary --line --no-merges, split synopsis in its manual. --- bin/git-summary | 6 ++++++ man/git-summary.1 | 12 +++++++----- man/git-summary.html | 11 ++++++----- man/git-summary.md | 11 ++++++----- 4 files changed, 25 insertions(+), 15 deletions(-) diff --git a/bin/git-summary b/bin/git-summary index d781e54..a12e2b5 100755 --- a/bin/git-summary +++ b/bin/git-summary @@ -35,6 +35,12 @@ if [ -n "$DEDUP_BY_EMAIL" ] && [ -n "$SUMMARY_BY_LINE" ]; then exit 1 fi +if [ -n "$MERGES_ARG" ] && [ -n "$SUMMARY_BY_LINE" ]; then + >&2 echo "--no-merges used with --line is not supported" + exit 1 +fi + + commit="" test $# -ne 0 && commit=$* project=${PWD##*/} diff --git a/man/git-summary.1 b/man/git-summary.1 index 85ea30c..7e6865c 100644 --- a/man/git-summary.1 +++ b/man/git-summary.1 @@ -4,7 +4,9 @@ .SH "NAME" \fBgit\-summary\fR \- Show repository summary .SH "SYNOPSIS" -\fBgit\-summary\fR [\-\-line] [\-\-dedup\-by\-email] [\-\-no\-merges] [] +\fBgit\-summary\fR [\-\-dedup\-by\-email] [\-\-no\-merges] [] +.br +\fBgit\-summary\fR \-\-line [] .SH "DESCRIPTION" Shows a summary of the repository\. .SH "OPTIONS" @@ -32,15 +34,15 @@ $ git summary \-\-dedup\-by\-email .fi .IP "" 0 .P -This option can not be used together with \fB\-\-line\fR\. +\-\-no\-merges +.P +Exclude merge commits\. .P \-\-line .P Summarize with lines other than commits\. When \fB\-\-line\fR is specified, the last argument is treated as \. .P -\-\-no\-merges -.P -Exclude merge commits\. +This option can not be used together with \fB\-\-dedup\-by\-email\fR or \fB\-\-no\-merges\fR\. .SH "EXAMPLES" Outputs a repo summary: .IP "" 4 diff --git a/man/git-summary.html b/man/git-summary.html index 9531e37..fcb0882 100644 --- a/man/git-summary.html +++ b/man/git-summary.html @@ -77,7 +77,8 @@

SYNOPSIS

-

git-summary [--line] [--dedup-by-email] [--no-merges] [<committish or path>]

+

git-summary [--dedup-by-email] [--no-merges] [<committish>]
+ git-summary --line [<path>]

DESCRIPTION

@@ -108,16 +109,16 @@ $ git summary --dedup-by-email 248 TJ Holowaychuk 18.4% -

This option can not be used together with --line.

+

--no-merges

+ +

Exclude merge commits.

--line

Summarize with lines other than commits. When --line is specified, the last argument is treated as <path>.

-

--no-merges

- -

Exclude merge commits.

+

This option can not be used together with --dedup-by-email or --no-merges.

EXAMPLES

diff --git a/man/git-summary.md b/man/git-summary.md index 9e2dd20..c41a31d 100644 --- a/man/git-summary.md +++ b/man/git-summary.md @@ -3,7 +3,8 @@ git-summary(1) -- Show repository summary ## SYNOPSIS -`git-summary` [--line] [--dedup-by-email] [--no-merges] [<committish or path>] + `git-summary` [--dedup-by-email] [--no-merges] [<committish>] + `git-summary` --line [<path>] ## DESCRIPTION @@ -33,16 +34,16 @@ Shows a summary of the repository. ... 248 TJ Holowaychuk 18.4% - This option can not be used together with `--line`. + --no-merges + + Exclude merge commits. --line Summarize with lines other than commits. When `--line` is specified, the last argument is treated as <path>. - --no-merges - - Exclude merge commits. + This option can not be used together with `--dedup-by-email` or `--no-merges`. ## EXAMPLES