git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Bagas Sanjaya <bagasdotme@gmail.com>
Cc: Matheus Felipe via GitGitGadget <gitgitgadget@gmail.com>,
	git@vger.kernel.org,
	Matheus Felipe <matheusfelipeog@protonmail.com>
Subject: Re: [PATCH] fix: include the type flag in the cli docs
Date: Sun, 27 Feb 2022 11:48:58 -0800	[thread overview]
Message-ID: <xmqqilt03xat.fsf@gitster.g> (raw)
In-Reply-To: <f171e157-7dbc-b07e-7164-c62e2427fbe2@gmail.com> (Bagas Sanjaya's message of "Sun, 27 Feb 2022 11:29:06 +0700")

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.


  reply	other threads:[~2022-02-27 19:49 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-26  5:34 [PATCH] fix: include the type flag in the cli docs Matheus Felipe via GitGitGadget
2022-02-27  4:29 ` Bagas Sanjaya
2022-02-27 19:48   ` Junio C Hamano [this message]
2022-02-28 22:42     ` Ævar Arnfjörð Bjarmason
2022-03-04  3:56       ` Matheus Felipe
2022-03-04  4:31 ` [PATCH v2] " Matheus Felipe via GitGitGadget
2022-03-04  7:45   ` Junio C Hamano
2022-03-04 15:52     ` Matheus Felipe
2022-03-04 16:15   ` [PATCH v3] config: correct "--type" option in "git config -h" output Matheus Felipe via GitGitGadget

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqilt03xat.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=bagasdotme@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=matheusfelipeog@protonmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).