git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v2] git-shortlog.txt: include commit limiting options

From
Pratyush Yadav <me@yadavpratyush.com>
Date
Nov 4, 2019, 13:08 UTC
Message-ID
<20191104130858.23673-1-me@yadavpratyush.com>
In-Reply-To
<20191030203603.27497-1-me@yadavpratyush.com>

git-shortlog, like git-log, supports options to filter what commits are used to generate the log. These options come from git-rev-list, and are documented in Documentation/rev-list-options.txt. Include those options in shortlog's documentation.

But since rev-list-options.txt contains some other options that don't really apply in the context of shortlog (like diff formatting, commit ordering, etc), add a switch in rev-list-options.txt that excludes those sections from the shortlog documentation. To be more specific, include only the "Commit Limiting" section.

Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
---
That ifdef covers almost the entire document. Is there a better way in
Asciidoc to do something like this?
 Documentation/git-shortlog.txt     | 3 +++
 Documentation/rev-list-options.txt | 2 ++
 2 files changed, 5 insertions(+)
diff --git a/Documentation/git-shortlog.txt b/Documentation/git-shortlog.txt
index bc80905a8a..a72ea7f7ba 100644
--- a/Documentation/git-shortlog.txt
+++ b/Documentation/git-shortlog.txt
@@ -76,6 +76,9 @@ them.
 Paths may need to be prefixed with `--` to separate them from
 options or the revision range, when confusion arises.

+:git-shortlog: 1
+include::rev-list-options.txt[]
+
 MAPPING AUTHORS
 ---------------

diff --git a/Documentation/rev-list-options.txt b/Documentation/rev-list-options.txt
index 90ff9e2bea..f4b67a917d 100644
--- a/Documentation/rev-list-options.txt
+++ b/Documentation/rev-list-options.txt
@@ -314,6 +314,7 @@ ifdef::git-rev-list[]
 	`<header>` text will be printed with each progress update.
 endif::git-rev-list[]

+ifndef::git-shortlog[]
 History Simplification
 ~~~~~~~~~~~~~~~~~~~~~~

@@ -1016,3 +1017,4 @@ options may be given. See linkgit:git-diff-files[1] for more options.
 -t::
 	Show the tree objects in the diff output. This implies `-r`.
 endif::git-rev-list[]
+endif::git-shortlog[]
--
2.21.0
Previous: Junio C HamanoNext: Junio C Hamano
Message 5 of 7 in “git-shortlog.txt: mention commit filtering options”
  1. git-shortlog.txt: mention commit filtering optionsPratyush Yadav, Oct 30, 2019
  2. Junio C HamanoNov 2, 2019
  3. Pratyush YadavNov 2, 2019
  4. Junio C HamanoNov 4, 2019
  5. git-shortlog.txt: include commit limiting optionsPratyush Yadav, Nov 4, 2019
  6. Junio C HamanoNov 6, 2019
  7. git-shortlog.txt: include commit limiting optionsPratyush Yadav, Nov 8, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.