Add incompability check for git summary --line --no-merges, split synopsis in its manual.

This commit is contained in:
Tobias Fendin 2021-08-11 16:38:21 +02:00
parent e9708ba9f4
commit a7b7f05b5b
4 changed files with 25 additions and 15 deletions

View file

@ -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##*/}

View file

@ -4,7 +4,9 @@
.SH "NAME"
\fBgit\-summary\fR \- Show repository summary
.SH "SYNOPSIS"
\fBgit\-summary\fR [\-\-line] [\-\-dedup\-by\-email] [\-\-no\-merges] [<committish or path>]
\fBgit\-summary\fR [\-\-dedup\-by\-email] [\-\-no\-merges] [<committish>]
.br
\fBgit\-summary\fR \-\-line [<path>]
.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 <path>\.
.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

View file

@ -77,7 +77,8 @@
</p>
<h2 id="SYNOPSIS">SYNOPSIS</h2>
<p><code>git-summary</code> [--line] [--dedup-by-email] [--no-merges] [&lt;committish or path&gt;]</p>
<p><code>git-summary</code> [--dedup-by-email] [--no-merges] [&lt;committish&gt;]<br>
<code>git-summary</code> --line [&lt;path&gt;]</p>
<h2 id="DESCRIPTION">DESCRIPTION</h2>
@ -108,16 +109,16 @@ $ git summary --dedup-by-email
248 TJ Holowaychuk 18.4%
</code></pre>
<p>This option can not be used together with <code>--line</code>.</p>
<p>--no-merges</p>
<p>Exclude merge commits.</p>
<p>--line</p>
<p>Summarize with lines other than commits.
When <code>--line</code> is specified, the last argument is treated as &lt;path&gt;.</p>
<p>--no-merges</p>
<p>Exclude merge commits.</p>
<p>This option can not be used together with <code>--dedup-by-email</code> or <code>--no-merges</code>.</p>
<h2 id="EXAMPLES">EXAMPLES</h2>

View file

@ -3,7 +3,8 @@ git-summary(1) -- Show repository summary
## SYNOPSIS
`git-summary` [--line] [--dedup-by-email] [--no-merges] [&lt;committish or path&gt;]
`git-summary` [--dedup-by-email] [--no-merges] [&lt;committish&gt;]
`git-summary` --line [&lt;path&gt;]
## 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 &lt;path&gt;.
--no-merges
Exclude merge commits.
This option can not be used together with `--dedup-by-email` or `--no-merges`.
## EXAMPLES