git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Sunshine <sunshine@sunshineco.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH v2] doc: option value may be separate for valid reasons
Date: Sun, 24 Nov 2024 22:35:59 -0500	[thread overview]
Message-ID: <CAPig+cTCiyc-8GnEEKZvDTAvmrXNrfJ-Uq4=7TCv21UgoiKAZw@mail.gmail.com> (raw)
In-Reply-To: <xmqqh67w6m4m.fsf@gitster.g>

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.

  reply	other threads:[~2024-11-25  3:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-24  9:43 [PATCH] doc: option value may be separate for valid reasons Junio C Hamano
2024-11-24 23:54 ` Eric Sunshine
2024-11-25  3:04   ` Junio C Hamano
2024-11-25  3:14 ` [PATCH v2] " Junio C Hamano
2024-11-25  3:35   ` Eric Sunshine [this message]
2024-11-25  4:49     ` Junio C Hamano

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='CAPig+cTCiyc-8GnEEKZvDTAvmrXNrfJ-Uq4=7TCv21UgoiKAZw@mail.gmail.com' \
    --to=sunshine@sunshineco.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.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).