Git development
 help / color / mirror / Atom feed
From: Ben Knoble <ben.knoble@gmail.com>
To: Harald Nordgren via GitGitGadget <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org, Harald Nordgren <haraldnordgren@gmail.com>,
	nahidhasan141400@gmail.com
Subject: Re: [PATCH] config: make the suggested "set" command safe to paste
Date: Thu, 26 Nov 2026 07:30:09 -0500	[thread overview]
Message-ID: <02A50A47-A048-417E-9D1E-0C12D8FB1476@gmail.com> (raw)
In-Reply-To: <pull.2457.git.git.1795632875345.gitgitgadget@gmail.com>

+Cc Nasid, who sent a similar « suggested command should 
shell quote » patch. (Pasting links on mobile breaks plain-text mode,
apologies for the vague reference.)

> Le 25 nov. 2026 à 13:54, Harald Nordgren via GitGitGadget <gitgitgadget@gmail.com> a écrit :
> 
> From: Harald Nordgren <haraldnordgren@gmail.com>
> 
> When "git config" is given "<key>=<value>" as a single argument and
> the value contains spaces, the suggested command does not work when
> pasted back into a shell:
> 
>    $ git config status.comparebranches="@{upstream} @{push}"
>    error: missing value to set to the variable 'status.comparebranches=@{upstream} @{push}'
>    hint: did you mean "git config set status.comparebranches @{upstream} @{push}"?
> 
> The shell splits the value into two arguments and the command fails
> with "wrong number of arguments".
> 
> Quote the value when it needs it, and put the command on a line of
> its own the way other hints show commands, so it can be copied
> without the surrounding quotes:
> 
>    hint: did you mean:
>    hint:
>    hint:   git config set status.comparebranches '@{upstream} @{push}'

I wanted to bring both folks together to figure out: should we shell quote
assuming a POSIX-like shell, and do the current patches
work or not on Windows?

In other words, would we need to do something different to
behave sensibly in other shells (fish?), or is that not a target worth
worrying about (GfW comes with a Bash environment)?

One other thing: it might be nice to centralize some kind of 
automatic quoting for suggested commands.

  reply	other threads:[~2026-11-26 12:30 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-25 18:54 [PATCH] config: make the suggested "set" command safe to paste Harald Nordgren via GitGitGadget
2026-11-26 12:30 ` Ben Knoble [this message]
2026-11-26 14:56   ` Phillip Wood
2026-11-26 15:06     ` Ben Knoble
2026-11-26 18:26     ` Junio C Hamano
2026-11-26 15:00 ` Phillip Wood
2026-11-28 18:13 ` [PATCH v2] " Harald Nordgren via GitGitGadget
2026-11-29 16:08   ` Phillip Wood

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=02A50A47-A048-417E-9D1E-0C12D8FB1476@gmail.com \
    --to=ben.knoble@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=haraldnordgren@gmail.com \
    --cc=nahidhasan141400@gmail.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