git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] show doc: redirect user to git log manual instead of git diff-tree
@ 2023-09-05 12:12 Han Young
  2023-09-05 23:26 ` Junio C Hamano
  2023-09-20 13:27 ` [PATCH v2] " Han Young
  0 siblings, 2 replies; 6+ messages in thread
From: Han Young @ 2023-09-05 12:12 UTC (permalink / raw)
  To: git; +Cc: Han Young

While git show accepts options that apply to the git diff-tree command,
some options do not make sense in the context of git show.
The options of git show are handled using the machinery of git log.
The git log manual page is a better place to look into than git diff-tree
for options that are not in the git show manual page.

Signed-off-by: Han Young <hanyang.tony@bytedance.com>
---
 Documentation/git-show.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/git-show.txt b/Documentation/git-show.txt
index 2b1bc7288d..13f63f5210 100644
--- a/Documentation/git-show.txt
+++ b/Documentation/git-show.txt
@@ -26,7 +26,7 @@ with --name-only).
 
 For plain blobs, it shows the plain contents.
 
-The command takes options applicable to the 'git diff-tree' command to
+The command takes options applicable to the 'git log' command to
 control how the changes the commit introduces are shown.
 
 This manual page describes only the most frequently used options.
-- 
2.40.0


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

* Re: [PATCH] show doc: redirect user to git log manual instead of git diff-tree
  2023-09-05 12:12 [PATCH] show doc: redirect user to git log manual instead of git diff-tree Han Young
@ 2023-09-05 23:26 ` Junio C Hamano
  2023-09-06  6:09   ` Han Young
  2023-09-20 13:27 ` [PATCH v2] " Han Young
  1 sibling, 1 reply; 6+ messages in thread
From: Junio C Hamano @ 2023-09-05 23:26 UTC (permalink / raw)
  To: Han Young; +Cc: git

Han Young <hanyang.tony@bytedance.com> writes:

> While git show accepts options that apply to the git diff-tree command,
> some options do not make sense in the context of git show.

Wow, "diff-tree" is a bit too arcane, I would agree.

Strictly speaking, "options to control how the changes are shown"
are options that are meant for "diff" command (e.g. "--stat", "-w"),
but "log" understands some of the "diff" command options, the
updated text is *not* incorrect.

Because "show" is about displaying individual commits and not range,
some options that are meant for the "log" command (e.g.
"--first-parent", "--no-merges") do not make much sense.  So

    Some options that `git log` command understands can be used to
    control how the changes the commit introduces are shown.

or something like that, perhaps?  I dunno.

> -The command takes options applicable to the 'git diff-tree' command to
> +The command takes options applicable to the 'git log' command to
>  control how the changes the commit introduces are shown.
>  
>  This manual page describes only the most frequently used options.

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

* Re: [PATCH] show doc: redirect user to git log manual instead of git diff-tree
  2023-09-05 23:26 ` Junio C Hamano
@ 2023-09-06  6:09   ` Han Young
  2023-09-06 17:26     ` Junio C Hamano
  0 siblings, 1 reply; 6+ messages in thread
From: Han Young @ 2023-09-06  6:09 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

> Strictly speaking, "options to control how the changes are shown"
> are options that are meant for "diff" command (e.g. "--stat", "-w"),
> but "log" understands some of the "diff" command options, the
> updated text is *not* incorrect.

On a closer look, the manual page of git show does lists
all the "diff" options by including diff-options.txt.
The options omitted are revision parsing related.
Perhaps we remove the line

> The command takes options applicable to the git diff-tree command to
> control how the changes the commit introduces are shown.

And rephrase the line

> This manual page describes only the most frequently used options.

to

>  This manual page describes only the most frequently used options.
> Some options that `git rev-list` command understands can be used to
> control how commits are shown.

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

* Re: [PATCH] show doc: redirect user to git log manual instead of git diff-tree
  2023-09-06  6:09   ` Han Young
@ 2023-09-06 17:26     ` Junio C Hamano
  0 siblings, 0 replies; 6+ messages in thread
From: Junio C Hamano @ 2023-09-06 17:26 UTC (permalink / raw)
  To: Han Young; +Cc: git

Han Young <hanyang.tony@bytedance.com> writes:

>> Strictly speaking, "options to control how the changes are shown"
>> are options that are meant for "diff" command (e.g. "--stat", "-w"),
>> but "log" understands some of the "diff" command options, the
>> updated text is *not* incorrect.
>
> On a closer look, the manual page of git show does lists
> all the "diff" options by including diff-options.txt.
> The options omitted are revision parsing related.

The primary difference between "log" and "show" is that the latter
is not about walking a range of commits.  Both grok "diff" related
options that control how the changes introduced by each commit are
shown equally well.  But in the context of "show", options that
control revision traversal (i.e. which commits are chosen to be
shown and in what order) do not make much sense.

So ...

> Perhaps we remove the line
>
>> The command takes options applicable to the git diff-tree command to
>> control how the changes the commit introduces are shown.
>
> And rephrase the line
>
>> This manual page describes only the most frequently used options.
>
> to
>
>>  This manual page describes only the most frequently used options.
>> Some options that `git rev-list` command understands can be used to
>> control how commits are shown.

... I do not find the above an improvement.

Perhaps we should start with just "diff-tree" -> "log" and doing no
other damage to the existing text.  That will give us some baseline
that is a strict improvement.

Thanks.


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

* [PATCH v2] show doc: redirect user to git log manual instead of git diff-tree
  2023-09-05 12:12 [PATCH] show doc: redirect user to git log manual instead of git diff-tree Han Young
  2023-09-05 23:26 ` Junio C Hamano
@ 2023-09-20 13:27 ` Han Young
  2023-09-20 15:52   ` Junio C Hamano
  1 sibling, 1 reply; 6+ messages in thread
From: Han Young @ 2023-09-20 13:27 UTC (permalink / raw)
  To: git; +Cc: Han Young

While git show accepts options that apply to the git diff-tree command,
some options do not make sense in the context of git show.
The options of git show are handled using the machinery of git log.
The git log manual page is a better place to look into than git diff-tree
for options that are not in the git show manual page.

Signed-off-by: Han Young <hanyang.tony@bytedance.com>
---
Changes since v1:
* change wording to clarify not all options of `git log` are meant for `git show`

 Documentation/git-show.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/git-show.txt b/Documentation/git-show.txt
index 2b1bc7288d..fc46b3687b 100644
--- a/Documentation/git-show.txt
+++ b/Documentation/git-show.txt
@@ -26,7 +26,7 @@ with --name-only).
 
 For plain blobs, it shows the plain contents.
 
-The command takes options applicable to the 'git diff-tree' command to
+Some options that 'git log' command understands can be used to
 control how the changes the commit introduces are shown.
 
 This manual page describes only the most frequently used options.
-- 
2.42.0


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

* Re: [PATCH v2] show doc: redirect user to git log manual instead of git diff-tree
  2023-09-20 13:27 ` [PATCH v2] " Han Young
@ 2023-09-20 15:52   ` Junio C Hamano
  0 siblings, 0 replies; 6+ messages in thread
From: Junio C Hamano @ 2023-09-20 15:52 UTC (permalink / raw)
  To: Han Young; +Cc: git

Han Young <hanyang.tony@bytedance.com> writes:

> While git show accepts options that apply to the git diff-tree command,
> some options do not make sense in the context of git show.
> The options of git show are handled using the machinery of git log.
> The git log manual page is a better place to look into than git diff-tree
> for options that are not in the git show manual page.
>
> Signed-off-by: Han Young <hanyang.tony@bytedance.com>
> ---
> Changes since v1:
> * change wording to clarify not all options of `git log` are meant for `git show`

Nice.  Thank you very much for not forgetting this topic.



>  Documentation/git-show.txt | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/Documentation/git-show.txt b/Documentation/git-show.txt
> index 2b1bc7288d..fc46b3687b 100644
> --- a/Documentation/git-show.txt
> +++ b/Documentation/git-show.txt
> @@ -26,7 +26,7 @@ with --name-only).
>  
>  For plain blobs, it shows the plain contents.
>  
> -The command takes options applicable to the 'git diff-tree' command to
> +Some options that 'git log' command understands can be used to
>  control how the changes the commit introduces are shown.
>  
>  This manual page describes only the most frequently used options.

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

end of thread, other threads:[~2023-09-20 15:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-05 12:12 [PATCH] show doc: redirect user to git log manual instead of git diff-tree Han Young
2023-09-05 23:26 ` Junio C Hamano
2023-09-06  6:09   ` Han Young
2023-09-06 17:26     ` Junio C Hamano
2023-09-20 13:27 ` [PATCH v2] " Han Young
2023-09-20 15:52   ` Junio C Hamano

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 NNTP newsgroup(s).