git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2] doc: option value may be separate for valid reasons

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 25, 2024, 04:49 UTC
Message-ID
<xmqq7c8r7wab.fsf@gitster.g>
In-Reply-To
<CAPig+cTCiyc-8GnEEKZvDTAvmrXNrfJ-Uq4=7TCv21UgoiKAZw@mail.gmail.com>
Eric Sunshine <sunshine@sunshineco.com> writes:
Show 27 quoted lines
> On Sun, Nov 24, 2024 at 10:14 PM Junio C Hamano <gitster@pobox.com> wrote:
>> Even though `git help cli` recommends users to prefer using
>> "--option=value" over "--option value", there can be reasons why
>> giving them separately is a good idea.  One reason is that shells do
>> not perform tilde expansion for `--option=~/path/name` but they
>> expand `--options ~/path/name` just fine.
>>
>> This is not a problem for many options whose option parsing is
>> properly written using OPT_FILENAME(), because the value given to
>> OPT_FILENAME() is tilde-expanded internally by us, but some commands
>> take a pathname as a mere string, which needs this trick to have the
>> shell help us.
>>
>> I think the reason we originally decided to recommend the stuck form
>> was because an option that takes an optional value requires you to
>> use it in the stuck form, and it is one less thing for users to
>> worry about if they get into the habit to always use the stuck form.
>> But we should be discouraging ourselves from adding an option with
>> an optional value in the first place, and we might want to weaken
>> the current recommendation.
>>
>> In any case, let's describe this one case where it is necessary to
>> use the separate form, with an example.
>>
>> Signed-off-by: Junio C Hamano <gitster@pobox.com>
>
> v2 looks good to me.
Thanks.
Previous: Eric Sunshine
Message 6 of 6 in “doc: option value may be separate for valid reasons”
  1. doc: option value may be separate for valid reasonsJunio C Hamano, Nov 24, 2024
  2. Eric SunshineNov 24, 2024
  3. Junio C HamanoNov 25, 2024
  4. doc: option value may be separate for valid reasonsJunio C Hamano, Nov 25, 2024
  5. Eric SunshineNov 25, 2024
  6. Junio C HamanoNov 25, 2024

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.