git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] git-shortlog.txt: mention commit filtering options
@ 2019-10-30 20:36 Pratyush Yadav
  2019-11-02  5:43 ` Junio C Hamano
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Pratyush Yadav @ 2019-10-30 20:36 UTC (permalink / raw)
  To: git

git-shortlog, like git-log, supports options to filter what commits are
used to generate the log. These options come from git-rev-list. Add a
pointer to these options in the documentation page so readers can know
these filtering options can be used with git-shortlog too.

Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
---
Since [0] didn't get any responses, I figured a patch might get some
more attention since it is something concrete to comment on.

[0] https://public-inbox.org/git/20191024191709.gqkjljuibyashtma@yadavpratyush.com/

 Documentation/git-shortlog.txt | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/Documentation/git-shortlog.txt b/Documentation/git-shortlog.txt
index bc80905a8a..acae695388 100644
--- a/Documentation/git-shortlog.txt
+++ b/Documentation/git-shortlog.txt
@@ -76,6 +76,11 @@ them.
 Paths may need to be prefixed with `--` to separate them from
 options or the revision range, when confusion arises.

+In addition to the options above, 'git shortlog' also supports a range of
+options to select which subset of commits will be used to generate the
+shortlog. A list of these options can be found in the "Commit Limiting"
+section of linkgit:git-rev-list[1].
+
 MAPPING AUTHORS
 ---------------

--
2.21.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] git-shortlog.txt: mention commit filtering options
  2019-10-30 20:36 [PATCH] git-shortlog.txt: mention commit filtering options Pratyush Yadav
@ 2019-11-02  5:43 ` Junio C Hamano
  2019-11-02 22:50   ` Pratyush Yadav
  2019-11-04 13:08 ` [PATCH v2] git-shortlog.txt: include commit limiting options Pratyush Yadav
  2019-11-08 19:26 ` [PATCH v3] " Pratyush Yadav
  2 siblings, 1 reply; 7+ messages in thread
From: Junio C Hamano @ 2019-11-02  5:43 UTC (permalink / raw)
  To: Pratyush Yadav; +Cc: git

Pratyush Yadav <me@yadavpratyush.com> writes:

> git-shortlog, like git-log, supports options to filter what commits are
> used to generate the log. These options come from git-rev-list. Add a
> pointer to these options in the documentation page so readers can know
> these filtering options can be used with git-shortlog too.
>
> Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
> ---
> Since [0] didn't get any responses, I figured a patch might get some
> more attention since it is something concrete to comment on.
>
> [0] https://public-inbox.org/git/20191024191709.gqkjljuibyashtma@yadavpratyush.com/
>
>  Documentation/git-shortlog.txt | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/Documentation/git-shortlog.txt b/Documentation/git-shortlog.txt
> index bc80905a8a..acae695388 100644
> --- a/Documentation/git-shortlog.txt
> +++ b/Documentation/git-shortlog.txt
> @@ -76,6 +76,11 @@ them.
>  Paths may need to be prefixed with `--` to separate them from
>  options or the revision range, when confusion arises.
>
> +In addition to the options above, 'git shortlog' also supports a range of
> +options to select which subset of commits will be used to generate the
> +shortlog. A list of these options can be found in the "Commit Limiting"
> +section of linkgit:git-rev-list[1].

How does "git log --help" handle the corresponding part of its
documentation?  

	... goes and looks ...

I wonder if it is better to just include rev-list-options.txt like
"git-log.txt" does, instead of adding these four lines?

Thanks.

>  MAPPING AUTHORS
>  ---------------
>
> --
> 2.21.0

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] git-shortlog.txt: mention commit filtering options
  2019-11-02  5:43 ` Junio C Hamano
@ 2019-11-02 22:50   ` Pratyush Yadav
  2019-11-04  3:37     ` Junio C Hamano
  0 siblings, 1 reply; 7+ messages in thread
From: Pratyush Yadav @ 2019-11-02 22:50 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

On 02/11/19 02:43PM, Junio C Hamano wrote:
> Pratyush Yadav <me@yadavpratyush.com> writes:
> 
> > git-shortlog, like git-log, supports options to filter what commits are
> > used to generate the log. These options come from git-rev-list. Add a
> > pointer to these options in the documentation page so readers can know
> > these filtering options can be used with git-shortlog too.
> >
> > Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
> > ---
> > Since [0] didn't get any responses, I figured a patch might get some
> > more attention since it is something concrete to comment on.
> >
> > [0] https://public-inbox.org/git/20191024191709.gqkjljuibyashtma@yadavpratyush.com/
> >
> >  Documentation/git-shortlog.txt | 5 +++++
> >  1 file changed, 5 insertions(+)
> >
> > diff --git a/Documentation/git-shortlog.txt b/Documentation/git-shortlog.txt
> > index bc80905a8a..acae695388 100644
> > --- a/Documentation/git-shortlog.txt
> > +++ b/Documentation/git-shortlog.txt
> > @@ -76,6 +76,11 @@ them.
> >  Paths may need to be prefixed with `--` to separate them from
> >  options or the revision range, when confusion arises.
> >
> > +In addition to the options above, 'git shortlog' also supports a range of
> > +options to select which subset of commits will be used to generate the
> > +shortlog. A list of these options can be found in the "Commit Limiting"
> > +section of linkgit:git-rev-list[1].
> 
> How does "git log --help" handle the corresponding part of its
> documentation?  
> 
> 	... goes and looks ...
> 
> I wonder if it is better to just include rev-list-options.txt like
> "git-log.txt" does, instead of adding these four lines?

Quoting from my initial email [0] about this topic:

  rev-list-options.txt is a rather large file and I'm not sure if 
  including it in both git-log and git-shortlog would be a good idea. 
  The way I see it, git-log is the "primary" log interface, and 
  git-shortlog is a "secondary" log interface, so git-log warrants such 
  a large man page, but git-shortlog doesn't especially since most 
  options are repeated. So maybe it is a better idea to just include a 
  pointer to git-rev-list in the shortlog man page. 

But if you think including the whole thing is better, I don't mind that 
either. Will re-roll.

[0] https://public-inbox.org/git/20191024191709.gqkjljuibyashtma@yadavpratyush.com/

-- 
Regards,
Pratyush Yadav

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] git-shortlog.txt: mention commit filtering options
  2019-11-02 22:50   ` Pratyush Yadav
@ 2019-11-04  3:37     ` Junio C Hamano
  0 siblings, 0 replies; 7+ messages in thread
From: Junio C Hamano @ 2019-11-04  3:37 UTC (permalink / raw)
  To: Pratyush Yadav; +Cc: git

Pratyush Yadav <me@yadavpratyush.com> writes:

>> How does "git log --help" handle the corresponding part of its
>> documentation?  
>> 
>> 	... goes and looks ...
>> 
>> I wonder if it is better to just include rev-list-options.txt like
>> "git-log.txt" does, instead of adding these four lines?
>
> Quoting from my initial email [0] about this topic:
>
>   rev-list-options.txt is a rather large file and I'm not sure if 
>   including it in both git-log and git-shortlog would be a good idea. 
>   The way I see it, git-log is the "primary" log interface, and 
>   git-shortlog is a "secondary" log interface, so git-log warrants such 
>   a large man page, but git-shortlog doesn't especially since most 
>   options are repeated. So maybe it is a better idea to just include a 
>   pointer to git-rev-list in the shortlog man page. 

OK, so you also wondered the same thing and reached a different
conclusion.

Given that

 - "rev-list-options" being large is more or less irrelevant, if you
   want to give users of "short-log" an easy access to these rich
   options.  We already do so for users of "log".

 - "include" files are designed to reduce readers' mental load by
   avoding one level of indirection and also to reduce the risk of
   documentaiton going stale by avoiding repeated text in multiple
   places, and that

 - if description in parts of included file only applies to one
   including file but not others, ifdef/ifndef mechanism can be used
   to customize the contents (see how rev-list-options.txt is
   included in pages for both "log" and "rev-list", and parts of it
   are shown conditionally with "ifndef::git-rev-list[]" and
   friends; diff-options.txt and its users give you more examples to
   follow).

it is not such a bad idea to include the rev-list-options.txt.

More importantly, having a pointer to git-rev-list page may omit
what is available to users of "shortlog" (options described inside
"ifndef::git-rev-list[]" in rev-list-options.txt are not visible to
them) and/or describe what is not available to users of "shortlog"
(those described inside "ifdef::git-rev-list[]" may not in general
apply to the "log" family of commands).

Thanks.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v2] git-shortlog.txt: include commit limiting options
  2019-10-30 20:36 [PATCH] git-shortlog.txt: mention commit filtering options Pratyush Yadav
  2019-11-02  5:43 ` Junio C Hamano
@ 2019-11-04 13:08 ` Pratyush Yadav
  2019-11-06  1:24   ` Junio C Hamano
  2019-11-08 19:26 ` [PATCH v3] " Pratyush Yadav
  2 siblings, 1 reply; 7+ messages in thread
From: Pratyush Yadav @ 2019-11-04 13:08 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano

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


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] git-shortlog.txt: include commit limiting options
  2019-11-04 13:08 ` [PATCH v2] git-shortlog.txt: include commit limiting options Pratyush Yadav
@ 2019-11-06  1:24   ` Junio C Hamano
  0 siblings, 0 replies; 7+ messages in thread
From: Junio C Hamano @ 2019-11-06  1:24 UTC (permalink / raw)
  To: Pratyush Yadav; +Cc: git

Pratyush Yadav <me@yadavpratyush.com> writes:

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

I think this is much better than duplication, and we can improve it
further with follow-up patches.

Many options for history simplification are useful for shortlog.  I
very often use "git shortlog -- cache.h" myself (i.e. limiting to
the given pathspec).  I suspect most of the "--dashed-options"
listed there would make sense for some workflows, even though I do
not use them often enough with shortlog.  The only exception I can
think of that may not be useful at all for the purose of shortlog is
"--simplify-by-decoration".

I agree with the patch that all other sections (i.e. bisection
helper, commit ordering, object traversal, commit formatting and
diff formatting) make little sense to use with shortlog.

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

I would have excluded each section independently with "Heh, this
part is not needed for shortlog"; that would make it less error
prone against future shuffling of sections in the file.

Thanks.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v3] git-shortlog.txt: include commit limiting options
  2019-10-30 20:36 [PATCH] git-shortlog.txt: mention commit filtering options Pratyush Yadav
  2019-11-02  5:43 ` Junio C Hamano
  2019-11-04 13:08 ` [PATCH v2] git-shortlog.txt: include commit limiting options Pratyush Yadav
@ 2019-11-08 19:26 ` Pratyush Yadav
  2 siblings, 0 replies; 7+ messages in thread
From: Pratyush Yadav @ 2019-11-08 19:26 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano

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" and "History Simplification" sections.

Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
---
Changes in v3:
- Include the "History Simplification" section too.

- Wrap each section in an ifdef individually to make it easier to move
  them around later.

 Documentation/git-shortlog.txt     |  3 +++
 Documentation/rev-list-options.txt | 11 ++++++++++-
 2 files changed, 13 insertions(+), 1 deletion(-)

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..e37df921b5 100644
--- a/Documentation/rev-list-options.txt
+++ b/Documentation/rev-list-options.txt
@@ -579,6 +579,7 @@ above) if (1) they are referenced by tags, or (2) they change the
 contents of the paths given on the command line.  All other
 commits are marked as TREESAME (subject to be simplified away).

+ifndef::git-shortlog[]
 ifdef::git-rev-list[]
 Bisection Helpers
 ~~~~~~~~~~~~~~~~~
@@ -634,8 +635,9 @@ This option can be used along with `--bisect-vars`, in this case,
 after all the sorted commit objects, there will be the same text as if
 `--bisect-vars` had been used alone.
 endif::git-rev-list[]
+endif::git-shortlog[]

-
+ifndef::git-shortlog[]
 Commit Ordering
 ~~~~~~~~~~~~~~~

@@ -677,7 +679,9 @@ together.
 	Output the commits chosen to be shown (see Commit Limiting
 	section above) in reverse order. Cannot be combined with
 	`--walk-reflogs`.
+endif::git-shortlog[]

+ifndef::git-shortlog[]
 Object Traversal
 ~~~~~~~~~~~~~~~~

@@ -817,7 +821,9 @@ endif::git-rev-list[]

 --do-walk::
 	Overrides a previous `--no-walk`.
+endif::git-shortlog[]

+ifndef::git-shortlog[]
 Commit Formatting
 ~~~~~~~~~~~~~~~~~

@@ -973,7 +979,9 @@ ifdef::git-rev-list[]
 	counts and print the count for equivalent commits separated
 	by a tab.
 endif::git-rev-list[]
+endif::git-shortlog[]

+ifndef::git-shortlog[]
 ifndef::git-rev-list[]
 Diff Formatting
 ~~~~~~~~~~~~~~~
@@ -1016,3 +1024,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


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-11-08 19:26 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-30 20:36 [PATCH] git-shortlog.txt: mention commit filtering options Pratyush Yadav
2019-11-02  5:43 ` Junio C Hamano
2019-11-02 22:50   ` Pratyush Yadav
2019-11-04  3:37     ` Junio C Hamano
2019-11-04 13:08 ` [PATCH v2] git-shortlog.txt: include commit limiting options Pratyush Yadav
2019-11-06  1:24   ` Junio C Hamano
2019-11-08 19:26 ` [PATCH v3] " Pratyush Yadav

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).