Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

documentation: handle non-existing html pages and document 'git version' #1038

Closed
wants to merge 2 commits into from

Conversation

rimrul
Copy link

@rimrul rimrul commented Sep 12, 2021

These two patches are grouped as one patch series, because they arose from the
same Git for Windows issue [1], but they can be reviewed or applied independent
from one another.

One interesting oddity I found while preparing V2:
git --version --help gets converted to git version --help which then calls git help version,
but git --help --version gets converted to git help --version and git help doesn't know what to do with --version.

[1] git-for-windows#3308

Changes since V1:

  • fixed various typos in the log message of patch 1
  • changed patch 1 to just check the requested page instead of both the requested page and git.html
  • moved the test up before the "generate builtin list" test
  • reworked the test slightly
  • added a second test
  • removed the redundant description of --build-options from the DESCRIPTION section
  • added a small paragraph to Documentation/git.txt that links to the new git version page (like we already do for git help)

cc: Ævar Arnfjörð Bjarmason avarab@gmail.com
cc: Eric Sunshine sunshine@sunshineco.com
cc: Matthias Aßhauer mha1993@live.de
cc: Junio C Hamano gitster@pobox.com

@gitgitgadget
Copy link

gitgitgadget bot commented Sep 12, 2021

Welcome to GitGitGadget

Hi @rimrul, and welcome to GitGitGadget, the GitHub App to send patch series to the Git mailing list from GitHub Pull Requests.

Please make sure that your Pull Request has a good description, as it will be used as cover letter.

Also, it is a good idea to review the commit messages one last time, as the Git project expects them in a quite specific form:

  • the lines should not exceed 76 columns,
  • the first line should be like a header and typically start with a prefix like "tests:" or "revisions:" to state which subsystem the change is about, and
  • the commit messages' body should be describing the "why?" of the change.
  • Finally, the commit messages should end in a Signed-off-by: line matching the commits' author.

It is in general a good idea to await the automated test ("Checks") in this Pull Request before contributing the patches, e.g. to avoid trivial issues such as unportable code.

Contributing the patches

Before you can contribute the patches, your GitHub username needs to be added to the list of permitted users. Any already-permitted user can do that, by adding a comment to your PR of the form /allow. A good way to find other contributors is to locate recent pull requests where someone has been /allowed:

Both the person who commented /allow and the PR author are able to /allow you.

An alternative is the channel #git-devel on the Libera Chat IRC network:

<newcontributor> I've just created my first PR, could someone please /allow me? https://github.com/gitgitgadget/git/pull/12345
<veteran> newcontributor: it is done
<newcontributor> thanks!

Once on the list of permitted usernames, you can contribute the patches to the Git mailing list by adding a PR comment /submit.

If you want to see what email(s) would be sent for a /submit request, add a PR comment /preview to have the email(s) sent to you. You must have a public GitHub email address for this.

After you submit, GitGitGadget will respond with another comment that contains the link to the cover letter mail in the Git mailing list archive. Please make sure to monitor the discussion in that thread and to address comments and suggestions (while the comments and suggestions will be mirrored into the PR by GitGitGadget, you will still want to reply via mail).

If you do not want to subscribe to the Git mailing list just to be able to respond to a mail, you can download the mbox from the Git mailing list archive (click the (raw) link), then import it into your mail program. If you use GMail, you can do this via:

curl -g --user "<EMailAddress>:<Password>" \
    --url "imaps://imap.gmail.com/INBOX" -T /path/to/raw.txt

To iterate on your change, i.e. send a revised patch or patch series, you will first want to (force-)push to the same branch. You probably also want to modify your Pull Request description (or title). It is a good idea to summarize the revision by adding something like this to the cover letter (read: by editing the first comment on the PR, i.e. the PR description):

Changes since v1:
- Fixed a typo in the commit message (found by ...)
- Added a code comment to ... as suggested by ...
...

To send a new iteration, just add another PR comment with the contents: /submit.

Need help?

New contributors who want advice are encouraged to join git-mentoring@googlegroups.com, where volunteers who regularly contribute to Git are willing to answer newbie questions, give advice, or otherwise provide mentoring to interested contributors. You must join in order to post or view messages, but anyone can join.

You may also be able to find help in real time in the developer IRC channel, #git-devel on Libera Chat. Remember that IRC does not support offline messaging, so if you send someone a private message and log out, they cannot respond to you. The scrollback of #git-devel is archived, though.

@rimrul rimrul force-pushed the doc-version branch 2 times, most recently from bb9f4b7 to d3635cb Compare September 12, 2021 16:57
@rimrul rimrul changed the title documentation: handle non-existing html and document git version documentation: handle non-existing html pages and document 'git version' Sep 13, 2021
@dscho
Copy link
Member

dscho commented Sep 13, 2021

/allow

@gitgitgadget
Copy link

gitgitgadget bot commented Sep 13, 2021

User rimrul is now allowed to use GitGitGadget.

WARNING: rimrul has no public email address set on GitHub

@rimrul
Copy link
Author

rimrul commented Sep 13, 2021

/preview

@gitgitgadget
Copy link

gitgitgadget bot commented Sep 13, 2021

Error: Could not determine public email of rimrul

@rimrul
Copy link
Author

rimrul commented Sep 13, 2021

/preview

@gitgitgadget
Copy link

gitgitgadget bot commented Sep 13, 2021

Error: Could not determine public email of rimrul

@rimrul
Copy link
Author

rimrul commented Sep 13, 2021

/preview

@gitgitgadget
Copy link

gitgitgadget bot commented Sep 13, 2021

Preview email sent as pull.1038.git.1631530375.gitgitgadget@gmail.com

@rimrul
Copy link
Author

rimrul commented Sep 13, 2021

/submit

@gitgitgadget
Copy link

gitgitgadget bot commented Sep 13, 2021

Submitted as pull.1038.git.1631531218.gitgitgadget@gmail.com

To fetch this version into FETCH_HEAD:

git fetch https://github.com/gitgitgadget/git pr-1038/rimrul/doc-version-v1

To fetch this version to local tag pr-1038/rimrul/doc-version-v1:

git fetch --no-tags https://github.com/gitgitgadget/git tag pr-1038/rimrul/doc-version-v1

@@ -0,0 +1,35 @@
git-version(1)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the Git mailing list, Ævar Arnfjörð Bjarmason wrote (reply to this):


On Mon, Sep 13 2021, Matthias Aßhauer via GitGitGadget wrote:

> From: =?UTF-8?q?Matthias=20A=C3=9Fhauer?= <mha1993@live.de>
>
> While 'git version' is probably the least complex git command,
> it is a non-experimental user-facing builtin command. As such
> it should have a help page.

This looks good

> Signed-off-by: Matthias Aßhauer <mha1993@live.de>
> ---
>  Documentation/git-version.txt | 35 +++++++++++++++++++++++++++++++++++
>  1 file changed, 35 insertions(+)
>  create mode 100644 Documentation/git-version.txt
>
> diff --git a/Documentation/git-version.txt b/Documentation/git-version.txt
> new file mode 100644
> index 00000000000..c7d6b496c8d
> --- /dev/null
> +++ b/Documentation/git-version.txt
> @@ -0,0 +1,35 @@
> +git-version(1)
> +==============
> +
> +NAME
> +----
> +git-version - Display version information about Git
> +
> +
> +SYNOPSIS
> +--------
> +[verse]
> +'git version' [--build-options]
>
> +
> +DESCRIPTION
> +-----------
> +
> +With no options given, the version of 'git' is printed
> +on the standard output.

Good

> +
> +If the option `--build-options` is given, information about how git was built is
> +printed on the standard output in addition to the version number.

Let's just cover this in the OPTIONS section you added...

> +Note that `git --version` is identical to `git version` because the
> +former is internally converted into the latter.

Probably better to just have a new section:

SEE ALSO
--------

linkgit:git[1]'s `--version` option, which dispatches to this command.


> +OPTIONS
> +-------
> +--build-options::
> +	Prints out additional information about how git was built for diagnostic
> +	purposes.
> +
> +GIT
> +---
> +Part of the linkgit:git[1] suite


It would also be good to update git.txt, which now says:

    Prints the Git suite version that the git program came from

To say e.g. "Dispatches to linkgit:git-version[1], prints the git
program version".

Or something like that, i.e. to cross-link the two.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the Git mailing list, Matthias Aßhauer wrote (reply to this):



On Mon, 13 Sep 2021, Ævar Arnfjörð Bjarmason wrote:

>
> On Mon, Sep 13 2021, Matthias Aßhauer via GitGitGadget wrote:
>
>> From: =?UTF-8?q?Matthias=20A=C3=9Fhauer?= <mha1993@live.de>
>>
>> While 'git version' is probably the least complex git command,
>> it is a non-experimental user-facing builtin command. As such
>> it should have a help page.
>
> This looks good
>
>> Signed-off-by: Matthias Aßhauer <mha1993@live.de>
>> ---
>>  Documentation/git-version.txt | 35 +++++++++++++++++++++++++++++++++++
>>  1 file changed, 35 insertions(+)
>>  create mode 100644 Documentation/git-version.txt
>>
>> diff --git a/Documentation/git-version.txt b/Documentation/git-version.txt
>> new file mode 100644
>> index 00000000000..c7d6b496c8d
>> --- /dev/null
>> +++ b/Documentation/git-version.txt
>> @@ -0,0 +1,35 @@
>> +git-version(1)
>> +==============
>> +
>> +NAME
>> +----
>> +git-version - Display version information about Git
>> +
>> +
>> +SYNOPSIS
>> +--------
>> +[verse]
>> +'git version' [--build-options]
>>
>> +
>> +DESCRIPTION
>> +-----------
>> +
>> +With no options given, the version of 'git' is printed
>> +on the standard output.
>
> Good
>
>> +
>> +If the option `--build-options` is given, information about how git was built is
>> +printed on the standard output in addition to the version number.
>
> Let's just cover this in the OPTIONS section you added...

Ok, I can absolutely do that.

>
>> +Note that `git --version` is identical to `git version` because the
>> +former is internally converted into the latter.
>
> Probably better to just have a new section:
>
> SEE ALSO
> --------
>
> linkgit:git[1]'s `--version` option, which dispatches to this command.
>
>

I've closely based this on git-help.txt, since `--help` and `--version` 
both are options that get internally converted to the corresponding command.

>> +OPTIONS
>> +-------
>> +--build-options::
>> +	Prints out additional information about how git was built for diagnostic
>> +	purposes.
>> +
>> +GIT
>> +---
>> +Part of the linkgit:git[1] suite
>
>
> It would also be good to update git.txt, which now says:
>
>    Prints the Git suite version that the git program came from
>
> To say e.g. "Dispatches to linkgit:git-version[1], prints the git
> program version".
>
> Or something like that, i.e. to cross-link the two.

That makes sense. Should we do the same for '--help'?

Best regards

Matthias

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the Git mailing list, Junio C Hamano wrote (reply to this):

Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:

>> +Note that `git --version` is identical to `git version` because the
>> +former is internally converted into the latter.
>
> Probably better to just have a new section:
>
> SEE ALSO
> --------
>
> linkgit:git[1]'s `--version` option, which dispatches to this command.

Hmph, I am not sure if this is a good move.

If we are not giving any more information than what the reader has
already learned from this page, other than "git --version" does the
same thing, we probably do not want to do this.  By seeing also that
other page, the user will not learn anything new about "git version".

If a related "git --version-something-else" is described over there
and may fill the need the reader had when visiting this page, that
is a different story, but I do not think it is the case.

>> +OPTIONS
>> +-------
>> +--build-options::
>> +	Prints out additional information about how git was built for diagnostic
>> +	purposes.
>> +
>> +GIT
>> +---
>> +Part of the linkgit:git[1] suite
>
>
> It would also be good to update git.txt, which now says:
>
>     Prints the Git suite version that the git program came from
>
> To say e.g. "Dispatches to linkgit:git-version[1], prints the git
> program version".

This one may be a good idea, I think.

"git --version --build-options" also works and we do not want to
clutter git[1] with descriptions on suboptions of "git version".

If we are not doing so for the "--help" option in git[1], we should
do so as well.

Thanks.

@gitgitgadget
Copy link

gitgitgadget bot commented Sep 13, 2021

User Ævar Arnfjörð Bjarmason <avarab@gmail.com> has been added to the cc: list.

@@ -467,11 +467,18 @@ static void get_html_page_path(struct strbuf *page_path, const char *page)
if (!html_path)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the Git mailing list, Eric Sunshine wrote (reply to this):

On Mon, Sep 13, 2021 at 7:07 AM Matthias Aßhauer via GitGitGadget
<gitgitgadget@gmail.com> wrote:
> We already check that git.html exists, regardless of the page the user wants
> to open. Additionally checking wether the requested page exists gives us a

s/wether/whether/

> smoother user experience when it doesn't.

> When calling a git command and there is an error, most users reasonably expect
> git to produce an error message on the standard error stream, but in this case
> we pass the filepath to git web--browse wich passes it on to a browser (or a

s/wich/which/

> helper programm like xdg-open or start that should in turn open a browser)

s/programm/program/

> without any error and many GUI based browsers or helpers won't output such a
> message onto the standard error stream.
>
> Especialy the helper programs tend to show the corresponding error message in

s/Especialy/Especially/

> a message box and wait for user input before exiting. This leaves users in
> interactive console sessions without an error message in their console,
> without a console prompt and without the help page they expected.
>
> The performance cost of the additional stat should be negliggible compared to

s/negliggible/negligible/

> the two or more pocesses that we spawn after the checks.

s/pocesses/processes/

> Signed-off-by: Matthias Aßhauer <mha1993@live.de>

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the Git mailing list, Matthias Aßhauer wrote (reply to this):



On Mon, 13 Sep 2021, Eric Sunshine wrote:

> On Mon, Sep 13, 2021 at 7:07 AM Matthias Aßhauer via GitGitGadget
> <gitgitgadget@gmail.com> wrote:
>> We already check that git.html exists, regardless of the page the user wants
>> to open. Additionally checking wether the requested page exists gives us a
>
> s/wether/whether/
>
>> smoother user experience when it doesn't.
>
>> When calling a git command and there is an error, most users reasonably expect
>> git to produce an error message on the standard error stream, but in this case
>> we pass the filepath to git web--browse wich passes it on to a browser (or a
>
> s/wich/which/
>
>> helper programm like xdg-open or start that should in turn open a browser)
>
> s/programm/program/
>
>> without any error and many GUI based browsers or helpers won't output such a
>> message onto the standard error stream.
>>
>> Especialy the helper programs tend to show the corresponding error message in
>
> s/Especialy/Especially/
>
>> a message box and wait for user input before exiting. This leaves users in
>> interactive console sessions without an error message in their console,
>> without a console prompt and without the help page they expected.
>>
>> The performance cost of the additional stat should be negliggible compared to
>
> s/negliggible/negligible/
>
>> the two or more pocesses that we spawn after the checks.
>
> s/pocesses/processes/
>
>> Signed-off-by: Matthias Aßhauer <mha1993@live.de>
>

Thank you for pointing out this embarrassing amount of typos.
I've fixed them for the next version.

Best regards

Matthias

Copy link
Author

@rimrul rimrul Sep 14, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think GitGitGadget doesn't like that I marked this as resolved after addressing Erics feedback. There is a mail from Junio on the mailing list regarding this patch that doesn't show up on GitHub.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That shouldn't matter... maybe the Azure Pipelines got stuck...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hrm. does not look like it: https://dev.azure.com/gitgitgadget/git/_build?definitionId=5

sorry, I have no idea what is going on... and I'm on a phone right now, can't dig further...

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem. I just wanted to mention it for the record. I've read Junios feedback and everyone else who's interested can read it via the link above.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hrm. Looks as if the Pipeline encountered a strange error:

HttpError: Validation Failed: {"resource":"PullRequestReviewComment","code":"custom","field":"pull_request_review_thread.end_commit_oid","message":"pull_request_review_thread.end_commit_oid is not part of the pull request"}: skipping

Quite honestly, I have no idea what to make of this.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh. I think I can (kind of) provide an insight on this. Junio commented on Patch 1/2 as sent to the mailing list. But based on the feedback I received from Eric, I had already pushed a new version of that patch with the typos in the log message fixed. Maybe it got confused by that?

@gitgitgadget
Copy link

gitgitgadget bot commented Sep 13, 2021

User Eric Sunshine <sunshine@sunshineco.com> has been added to the cc: list.

@gitgitgadget
Copy link

gitgitgadget bot commented Sep 13, 2021

User Matthias Aßhauer <mha1993@live.de> has been added to the cc: list.

@rimrul rimrul force-pushed the doc-version branch 2 times, most recently from 821e368 to 1c0f54d Compare September 14, 2021 08:53
@rimrul
Copy link
Author

rimrul commented Sep 14, 2021

/preview

@gitgitgadget
Copy link

gitgitgadget bot commented Sep 14, 2021

Preview email sent as pull.1038.v2.git.1631623752.gitgitgadget@gmail.com

We check that git.html exists, regardless of the page the user wants to open.
Checking whether the requested page exists instead gives us a smoother user
experience in two use cases:

1) The requested page doesn't exist

When calling a git command and there is an error, most users reasonably expect
git to produce an error message on the standard error stream, but in this case
we pass the filepath to git web--browse which passes it on to a browser (or a
helper program like xdg-open or start that should in turn open a browser)
without any error and many GUI based browsers or helpers won't output such a
message onto the standard error stream.

Especially the helper programs tend to show the corresponding error message in
a message box and wait for user input before exiting. This leaves users in
interactive console sessions without an error message in their console,
without a console prompt and without the help page they expected.

2) git.html is missing for some reason, but the user asked for some other page

We currently refuse to show any local html help page when we can't find
git.html. Even if the requested help page exists. If we check for the requested
page instead, we can show the user all available pages and only error out on
those that don't exist.

Signed-off-by: Matthias Aßhauer <mha1993@live.de>
While 'git version' is probably the least complex git command,
it is a non-experimental user-facing builtin command. As such
it should have a help page.

Both `git help` and `git version` can be called as options
(`--help`/`--version`) that internally get converted to the
corresponding command. Add a small paragraph to
Documentation/git.txt describing how these two options
interact with each other and link to this help page for the
sub-options that `--version` can take. Well, currently there
is only one sub-option, but that could potentially increase
in future versions of Git.

Signed-off-by: Matthias Aßhauer <mha1993@live.de>
@rimrul
Copy link
Author

rimrul commented Sep 14, 2021

/cc "Junio C Hamano" gitster@pobox.com

@rimrul
Copy link
Author

rimrul commented Sep 14, 2021

/preview

@gitgitgadget
Copy link

gitgitgadget bot commented Sep 14, 2021

Preview email sent as pull.1038.v2.git.1631625903.gitgitgadget@gmail.com

@rimrul
Copy link
Author

rimrul commented Sep 14, 2021

/submit

@gitgitgadget
Copy link

gitgitgadget bot commented Sep 14, 2021

Submitted as pull.1038.v2.git.1631626038.gitgitgadget@gmail.com

To fetch this version into FETCH_HEAD:

git fetch https://github.com/gitgitgadget/git pr-1038/rimrul/doc-version-v2

To fetch this version to local tag pr-1038/rimrul/doc-version-v2:

git fetch --no-tags https://github.com/gitgitgadget/git tag pr-1038/rimrul/doc-version-v2

@gitgitgadget
Copy link

gitgitgadget bot commented Sep 14, 2021

This branch is now known as ma/doc-git-version.

@gitgitgadget
Copy link

gitgitgadget bot commented Sep 14, 2021

This patch series was integrated into seen via git@aa33601.

@gitgitgadget gitgitgadget bot added the seen label Sep 14, 2021
@rimrul
Copy link
Author

rimrul commented Sep 15, 2021

This branch is now known as ma/doc-git-version.

That's patch 2. Patch 1 is a separate integration branch ma/help-w-check-for-requested-page

@gitgitgadget
Copy link

gitgitgadget bot commented Sep 15, 2021

This patch series was integrated into seen via git@e2fc239.

@gitgitgadget
Copy link

gitgitgadget bot commented Sep 17, 2021

This patch series was integrated into seen via git@f5b2a15.

@gitgitgadget
Copy link

gitgitgadget bot commented Sep 17, 2021

This patch series was integrated into next via git@54a6a3f.

@gitgitgadget gitgitgadget bot added the next label Sep 17, 2021
@gitgitgadget
Copy link

gitgitgadget bot commented Sep 17, 2021

There was a status update in the "New Topics" section about the branch ma/doc-git-version on the Git mailing list:

Doc update.

Will merge to 'master'.

@rimrul
Copy link
Author

rimrul commented Sep 18, 2021

The other topic also got a mention in What's cooking:

* ma/help-w-check-for-requested-page (2021-09-14) 1 commit
  (merged to 'next' on 2021-09-16 at 292dd7174d)
 + help: make sure local html page exists before calling external processes

 The error in "git help no-such-git-command" is handled better.

 Will merge to 'master'.

@gitgitgadget
Copy link

gitgitgadget bot commented Sep 20, 2021

This patch series was integrated into seen via git@20cb59f.

@gitgitgadget
Copy link

gitgitgadget bot commented Sep 21, 2021

There was a status update in the "Cooking" section about the branch ma/doc-git-version on the Git mailing list:

Doc update.

Will merge to 'master'.

@gitgitgadget
Copy link

gitgitgadget bot commented Sep 23, 2021

This patch series was integrated into seen via git@188da7d.

@gitgitgadget
Copy link

gitgitgadget bot commented Sep 23, 2021

This patch series was integrated into next via git@188da7d.

@gitgitgadget
Copy link

gitgitgadget bot commented Sep 23, 2021

This patch series was integrated into master via git@188da7d.

@gitgitgadget gitgitgadget bot added the master label Sep 23, 2021
@gitgitgadget gitgitgadget bot closed this Sep 23, 2021
@gitgitgadget
Copy link

gitgitgadget bot commented Sep 23, 2021

Closed via 188da7d.

@@ -0,0 +1,28 @@
git-version(1)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the Git mailing list, Ævar Arnfjörð Bjarmason wrote (reply to this):


On Tue, Sep 14 2021, Matthias Aßhauer via GitGitGadget wrote:

> From: =?UTF-8?q?Matthias=20A=C3=9Fhauer?= <mha1993@live.de>
>
> While 'git version' is probably the least complex git command,
> it is a non-experimental user-facing builtin command. As such
> it should have a help page.
>
> Both `git help` and `git version` can be called as options
> (`--help`/`--version`) that internally get converted to the
> corresponding command. Add a small paragraph to
> Documentation/git.txt describing how these two options
> interact with each other and link to this help page for the
> sub-options that `--version` can take. Well, currently there
> is only one sub-option, but that could potentially increase
> in future versions of Git.
>
> Signed-off-by: Matthias Aßhauer <mha1993@live.de>
> ---
>  Documentation/git-version.txt | 28 ++++++++++++++++++++++++++++
>  Documentation/git.txt         |  4 ++++
>  2 files changed, 32 insertions(+)
>  create mode 100644 Documentation/git-version.txt
>
> diff --git a/Documentation/git-version.txt b/Documentation/git-version.txt
> new file mode 100644
> index 00000000000..80fa7754a6d
> --- /dev/null
> +++ b/Documentation/git-version.txt
> @@ -0,0 +1,28 @@
> +git-version(1)
> +==============
> +
> +NAME
> +----
> +git-version - Display version information about Git
> +
> +SYNOPSIS
> +--------
> +[verse]
> +'git version' [--build-options]
> +
> +DESCRIPTION
> +-----------
> +With no options given, the version of 'git' is printed on the standard output.
> +
> +Note that `git --version` is identical to `git version` because the
> +former is internally converted into the latter.
> +
> +OPTIONS
> +-------
> +--build-options::
> +	Include additional information about how git was built for diagnostic
> +	purposes.
> +
> +GIT
> +---
> +Part of the linkgit:git[1] suite
> diff --git a/Documentation/git.txt b/Documentation/git.txt
> index 6dd241ef838..95fe6f31b4f 100644
> --- a/Documentation/git.txt
> +++ b/Documentation/git.txt
> @@ -41,6 +41,10 @@ OPTIONS
>  -------
>  --version::
>  	Prints the Git suite version that the 'git' program came from.
> ++
> +This option is internaly converted to `git version ...` and accepts
> +the same options as the linkgit:git-version[1] command. If `--help` is
> +also given, it takes precedence over `--version`.
>  
>  --help::
>  	Prints the synopsis and a list of the most commonly used

I didn't notice until after it hit master that this caused a regression
in "make check-docs":

    $ make -s check-docs
    removed but documented: git-version

The "fix" is rather easy, i.e. adding "git-version" to the whitelist.

But I wondered about $subject, i.e. we want to run the "lint" part, but
do we really need something reminding us that there isn't a mapping
between Documentation/*.txt and *.o files present at the top-level?

That whole part seems to have been some "reminder to document" addition
in 8c989ec5288 (Makefile: $(MAKE) check-docs, 2006-04-13).

If we're going to keep it in pretty much its current form then the CI
integration added in b98712b9aa9 (travis-ci: build documentation,
2016-05-04) seems rather useless when it comes to this, i.e. we should
either adjust it to exit non-zero, or check if we've got output under
"make -s" and fail the check then.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the Git mailing list, Junio C Hamano wrote (reply to this):

Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:

> I didn't notice until after it hit master that this caused a regression
> in "make check-docs":
>
>     $ make -s check-docs
>     removed but documented: git-version
>
> The "fix" is rather easy, i.e. adding "git-version" to the whitelist.
>
> But I wondered about $subject, i.e. we want to run the "lint" part, but
> do we really need something reminding us that there isn't a mapping
> between Documentation/*.txt and *.o files present at the top-level?

There were multiple things check-docs wanted to catch originally.

 - commands not referred to from the main page
 - a new command added without documentation
 - an old command removed while leaving documentation

It may be that we no longer remove commands, so the last check may
be less useful.

> If we're going to keep it in pretty much its current form then the CI
> integration added in b98712b9aa9 (travis-ci: build documentation,
> 2016-05-04) seems rather useless when it comes to this, i.e. we should
> either adjust it to exit non-zero,...

Yes, that is a good thing to do.

Thanks.

@rimrul rimrul deleted the doc-version branch November 25, 2021 07:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants