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

config: correct "--type" option in "git config -h" output #1220

Closed
wants to merge 1 commit into from
Closed

config: correct "--type" option in "git config -h" output #1220

wants to merge 1 commit into from

Conversation

matheusfelipeog
Copy link
Contributor

@matheusfelipeog matheusfelipeog commented Feb 25, 2022

When the git config --global --help command is invoked, the cli documentation is shown in the terminal with a small error in one of the values of the Type group, which is the absence of the type flag in the --type argument:

image

In the web documentation and man page:

image
image


Changes since v1:

  • Added a better commit message (as suggested by Bagas Sanjaya <bagasdotme@gmail.com>)
  • Improve the title of the commit, to make it more explicit when viewed with git shortlog --no-merges (as suggested by Junio C Hamano <gitster@pobox.com>)

cc: Bagas Sanjaya bagasdotme@gmail.com
cc: Ævar Arnfjörð Bjarmason avarab@gmail.com

@dscho
Copy link
Member

dscho commented Feb 25, 2022

/allow

@dscho
Copy link
Member

dscho commented Feb 25, 2022

Welcome to GitGitGadget

Hi @matheusfelipeog, 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. You can CC potential reviewers by adding a footer to the PR description with the following syntax:

CC: Revi Ewer <revi.ewer@example.com>, Ill Takalook <ill.takalook@example.net>

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. Note that any reviewers CC'd via the list in the PR description will not actually be sent emails.

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.

@gitgitgadget-git
Copy link

User matheusfelipeog is now allowed to use GitGitGadget.

WARNING: matheusfelipeog has no public email address set on GitHub

@matheusfelipeog
Copy link
Contributor Author

/preview

@gitgitgadget-git
Copy link

Invalid author email in 8589390: "50463866+matheusfelipeog@users.noreply.github.com"

@gitgitgadget-git
Copy link

Error: Could not determine public email of matheusfelipeog

@matheusfelipeog
Copy link
Contributor Author

Can you tell me what I should do now @dscho please?

@Abhra303
Copy link
Contributor

Hello @matheusfelipeog , looks like your email address of GitHub account is not public. Make it public.

@dscho
Copy link
Member

dscho commented Feb 25, 2022

I'm currently trying to get gitgitgadget/gitgitgadget@09d019c into GitGitGadget. Does the included information help?

@matheusfelipeog
Copy link
Contributor Author

I'm currently trying to get gitgitgadget/gitgitgadget@09d019c into GitGitGadget. Does the included information help?

Oh right, thanks

@matheusfelipeog
Copy link
Contributor Author

/preview

@gitgitgadget-git
Copy link

Invalid author email in 8589390: "50463866+matheusfelipeog@users.noreply.github.com"

@matheusfelipeog
Copy link
Contributor Author

/preview

@gitgitgadget-git
Copy link

Preview email sent as pull.1220.git.git.1645853313356.gitgitgadget@gmail.com

@matheusfelipeog
Copy link
Contributor Author

/submit

@gitgitgadget-git
Copy link

Submitted as pull.1220.git.git.1645853661519.gitgitgadget@gmail.com

To fetch this version into FETCH_HEAD:

git fetch https://github.com/gitgitgadget/git/ pr-git-1220/matheusfelipeog/fix/git-config-docs-v1

To fetch this version to local tag pr-git-1220/matheusfelipeog/fix/git-config-docs-v1:

git fetch --no-tags https://github.com/gitgitgadget/git/ tag pr-git-1220/matheusfelipeog/fix/git-config-docs-v1

@gitgitgadget-git
Copy link

On the Git mailing list, Bagas Sanjaya wrote (reply to this):

On 26/02/22 12.34, Matheus Felipe via GitGitGadget wrote:
> From: Matheus Felipe <matheusfelipeog@protonmail.com>
> > When the `git config --global --help` command is invoked,
> the cli documentation is shown in the terminal with a small
> error in one of the values of the Type group, which is the
> absence of the type flag in the `--type` argument.
> This commit fixes that.
> What about the commit message below?

```
The usage help for --type option of `git config` is missing `type`
in the argument placeholder (`<>`). Add it.
```

> -	OPT_CALLBACK('t', "type", &type, "", N_("value is given this type"), option_parse_type),
> +	OPT_CALLBACK('t', "type", &type, N_("type"), N_("value is given this type"), option_parse_type),


The help should be `give the value the specified type`.

-- 
An old man doll... just what I always wanted! - Clara

@gitgitgadget-git
Copy link

User Bagas Sanjaya <bagasdotme@gmail.com> has been added to the cc: list.

@gitgitgadget-git
Copy link

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

Bagas Sanjaya <bagasdotme@gmail.com> writes:

> On 26/02/22 12.34, Matheus Felipe via GitGitGadget wrote:
>> From: Matheus Felipe <matheusfelipeog@protonmail.com>
>> When the `git config --global --help` command is invoked,
>> the cli documentation is shown in the terminal with a small
>> error in one of the values of the Type group, which is the
>> absence of the type flag in the `--type` argument.
>> This commit fixes that.
>> 
>
> What about the commit message below?
>
> ```
> The usage help for --type option of `git config` is missing `type`
> in the argument placeholder (`<>`). Add it.
> ```

It is more concise, and at the same time points out the problem
being addressed a lot more explicitly.  Much better.

>> -	OPT_CALLBACK('t', "type", &type, "", N_("value is given this type"), option_parse_type),
>> +	OPT_CALLBACK('t', "type", &type, N_("type"), N_("value is given this type"), option_parse_type),
>
>
> The help should be `give the value the specified type`.

I am not sure if this is much of an improvement.

    $ git config --type=bool junk.flag 0
    $ git config junk.flag
    false

uses the type information to turn "0" into "false" before it writes
the value set to the variable to the file, while

    $ git config junk.flag 0
    $ git config junk.flag
    0
    $ git config --type=bool junk.flag
    false

shows that a stored value of "0" can be turned into "false" when
showing.  "Give the value the specified type" does not capture the
essense in either direction.

    Before setting or showing, convert the value to its canonical
    representation according to the given type.

is what we want to convey, but it is quote a mouthful as-is.

Saying "Assume the value is of this type" would strongly imply
"Convert ... to its canonical reporesentation", and the current
"value is given this type" may be a close enough and shorter
approximation of it.  I dunno.

@gitgitgadget-git
Copy link

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


On Sun, Feb 27 2022, Junio C Hamano wrote:

> Bagas Sanjaya <bagasdotme@gmail.com> writes:
>
>> On 26/02/22 12.34, Matheus Felipe via GitGitGadget wrote:
>>> From: Matheus Felipe <matheusfelipeog@protonmail.com>
>>> When the `git config --global --help` command is invoked,
>>> the cli documentation is shown in the terminal with a small
>>> error in one of the values of the Type group, which is the
>>> absence of the type flag in the `--type` argument.
>>> This commit fixes that.
>>> 
>>
>> What about the commit message below?
>>
>> ```
>> The usage help for --type option of `git config` is missing `type`
>> in the argument placeholder (`<>`). Add it.
>> ```
>
> It is more concise, and at the same time points out the problem
> being addressed a lot more explicitly.  Much better.
>
>>> -	OPT_CALLBACK('t', "type", &type, "", N_("value is given this type"), option_parse_type),
>>> +	OPT_CALLBACK('t', "type", &type, N_("type"), N_("value is given this type"), option_parse_type),
>>
>>
>> The help should be `give the value the specified type`.
>
> I am not sure if this is much of an improvement.
>
>     $ git config --type=bool junk.flag 0
>     $ git config junk.flag
>     false
>
> uses the type information to turn "0" into "false" before it writes
> the value set to the variable to the file, while
>
>     $ git config junk.flag 0
>     $ git config junk.flag
>     0
>     $ git config --type=bool junk.flag
>     false
>
> shows that a stored value of "0" can be turned into "false" when
> showing.  "Give the value the specified type" does not capture the
> essense in either direction.
>
>     Before setting or showing, convert the value to its canonical
>     representation according to the given type.
>
> is what we want to convey, but it is quote a mouthful as-is.
>
> Saying "Assume the value is of this type" would strongly imply
> "Convert ... to its canonical reporesentation", and the current
> "value is given this type" may be a close enough and shorter
> approximation of it.  I dunno.

Perhaps:

	"coerce (on read and write) <value> to <type>"

or:

	"coerce (on read & write) <value> to <type>"

or:

	"coerce (on rw) <value> to <type>"

For the short help, depending on how verbose we'd like to be?

In any case a follow-up fix, just the "" to "type" being proposed here
is orthagonal & looks good to me.

@gitgitgadget-git
Copy link

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

@gitgitgadget-git
Copy link

On the Git mailing list, Matheus Felipe wrote (reply to this):

> On 26/02/22 12.34, Matheus Felipe via GitGitGadget wrote:
>
> > From: Matheus Felipe matheusfelipeog@protonmail.com
> > When the `git config --global --help` command is invoked,
> > the cli documentation is shown in the terminal with a small
> > error in one of the values of the Type group, which is the
> > absence of the type flag in the `--type` argument.
> > This commit fixes that.
>
> What about the commit message below?
>
> ```
> The usage help for --type option of `git config` is missing `type`
> in the argument placeholder (`<>`). Add it.
> ```

This commit message just got better, thanks. I will update with this message.

> > - OPT_CALLBACK('t', "type", &type, "", N_("value is given this type"), option_parse_type),
> > + OPT_CALLBACK('t', "type", &type, N_("type"), N_("value is given this type"), option_parse_type),
>
> The help should be `give the value the specified type`.

About the help message, I believe the current one is adequate, as Junio C Hamano well described.

It is also worth remembering that PR proposes a change from "" to "type" only, as recalled by Ævar Arnfjörð Bjarmason.

@matheusfelipeog
Copy link
Contributor Author

/submit

@gitgitgadget-git
Copy link

Submitted as pull.1220.v2.git.git.1646368313714.gitgitgadget@gmail.com

To fetch this version into FETCH_HEAD:

git fetch https://github.com/gitgitgadget/git/ pr-git-1220/matheusfelipeog/fix/git-config-docs-v2

To fetch this version to local tag pr-git-1220/matheusfelipeog/fix/git-config-docs-v2:

git fetch --no-tags https://github.com/gitgitgadget/git/ tag pr-git-1220/matheusfelipeog/fix/git-config-docs-v2

@gitgitgadget-git
Copy link

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

"Matheus Felipe via GitGitGadget" <gitgitgadget@gmail.com> writes:

> Subject: Re: [PATCH v2] fix: include the type flag in the cli docs

One more (hopefully final) nit.  By reading the above alone (which
is what people will see in "git shortlog --no-merges" output), you
can not even guess which subcommand the "fix" is about, or if it is
even a fix to the code, or just a documentation update.

I'd retitle it to

	config: correct "--type" option in "git config -h" output

> From: Matheus Felipe <matheusfelipeog@protonmail.com>
>
> The usage help for --type option of `git config` is missing `type`
> in the argument placeholder (`<>`). Add it.

Good.

> diff --git a/builtin/config.c b/builtin/config.c
> index 542d8d02b2b..2aea465466b 100644
> --- a/builtin/config.c
> +++ b/builtin/config.c
> @@ -151,7 +151,7 @@ static struct option builtin_config_options[] = {
>  	OPT_BIT(0, "get-color", &actions, N_("find the color configured: slot [default]"), ACTION_GET_COLOR),
>  	OPT_BIT(0, "get-colorbool", &actions, N_("find the color setting: slot [stdout-is-tty]"), ACTION_GET_COLORBOOL),
>  	OPT_GROUP(N_("Type")),
> -	OPT_CALLBACK('t', "type", &type, "", N_("value is given this type"), option_parse_type),
> +	OPT_CALLBACK('t', "type", &type, N_("type"), N_("value is given this type"), option_parse_type),

Good again.

Thanks.  Will queue.

The usage help for --type option of `git config` is missing `type`
in the argument placeholder (`<>`). Add it.

Signed-off-by: Matheus Felipe <matheusfelipeog@protonmail.com>
@gitgitgadget-git
Copy link

On the Git mailing list, Matheus Felipe wrote (reply to this):

> One more (hopefully final) nit. By reading the above alone (which
> is what people will see in "git shortlog --no-merges" output), you
> can not even guess which subcommand the "fix" is about, or if it is
> even a fix to the code, or just a documentation update.
>
> I'd retitle it to
>
> config: correct "--type" option in "git config -h" output

You are right, this title is much better. I will update it.

Thank you very much, I learned a few things from this contribution.

@matheusfelipeog matheusfelipeog changed the title fix: include the type flag in the cli docs config: correct "--type" option in "git config -h" output Mar 4, 2022
@matheusfelipeog
Copy link
Contributor Author

/submit

@gitgitgadget-git
Copy link

Submitted as pull.1220.v3.git.git.1646410557888.gitgitgadget@gmail.com

To fetch this version into FETCH_HEAD:

git fetch https://github.com/gitgitgadget/git/ pr-git-1220/matheusfelipeog/fix/git-config-docs-v3

To fetch this version to local tag pr-git-1220/matheusfelipeog/fix/git-config-docs-v3:

git fetch --no-tags https://github.com/gitgitgadget/git/ tag pr-git-1220/matheusfelipeog/fix/git-config-docs-v3

@gitgitgadget-git
Copy link

This branch is now known as mf/fix-type-in-config-h.

@gitgitgadget-git
Copy link

This patch series was integrated into seen via 880ee6b.

@gitgitgadget-git gitgitgadget-git bot added the seen label Mar 4, 2022
@gitgitgadget-git
Copy link

This patch series was integrated into seen via 547d7ac.

@gitgitgadget-git
Copy link

There was a status update in the "New Topics" section about the branch mf/fix-type-in-config-h on the Git mailing list:

"git config -h" did not describe the "--type" option correctly.

Will merge to 'next'.
source: <pull.1220.v2.git.git.1646368313714.gitgitgadget@gmail.com>

@gitgitgadget-git
Copy link

This patch series was integrated into seen via 2e5590b.

@gitgitgadget-git
Copy link

This patch series was integrated into next via a914e26.

@gitgitgadget-git gitgitgadget-git bot added the next label Mar 8, 2022
@gitgitgadget-git
Copy link

This patch series was integrated into seen via 89faa2f.

@gitgitgadget-git
Copy link

This patch series was integrated into seen via a25a5ec.

@gitgitgadget-git
Copy link

This patch series was integrated into seen via 36ee06d.

@gitgitgadget-git
Copy link

This patch series was integrated into seen via 1eb38f5.

@gitgitgadget-git
Copy link

There was a status update in the "Cooking" section about the branch mf/fix-type-in-config-h on the Git mailing list:

"git config -h" did not describe the "--type" option correctly.

Will merge to 'master'.
source: <pull.1220.v2.git.git.1646368313714.gitgitgadget@gmail.com>

@gitgitgadget-git
Copy link

This patch series was integrated into seen via 9e777c5.

@gitgitgadget-git
Copy link

This patch series was integrated into seen via 7b1e530.

@gitgitgadget-git
Copy link

This patch series was integrated into seen via 8d1ae40.

@gitgitgadget-git
Copy link

This patch series was integrated into master via 8d1ae40.

@gitgitgadget-git
Copy link

This patch series was integrated into next via 8d1ae40.

@gitgitgadget-git
Copy link

Closed via 8d1ae40.

@matheusfelipeog matheusfelipeog deleted the fix/git-config-docs branch March 18, 2022 02:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants