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

Re: gitrevisions: be more chatty about shell metacharacter gotchas?

From
KHKristoffer Haugsbakk <kristofferhaugsbakk@fastmail.com>
Date
Dec 2, 2024, 16:17 UTC
Message-ID
<8752f4b3-db2e-4db5-bb1d-8b87cb6fadbd@app.fastmail.com>
In-Reply-To
<xmqqttbmkh8h.fsf@gitster.g>
On Mon, Dec 2, 2024, at 02:26, Junio C Hamano wrote:
Show 29 quoted lines
> There already is a note about '*'; we can add another note about
> whitespace next to it, perhaps here.
>
>  Documentation/gitcli.txt | 10 ++++++++++
>  1 file changed, 10 insertions(+)
>
> diff --git c/Documentation/gitcli.txt w/Documentation/gitcli.txt
> index 7c709324ba..0a67005fc6 100644
> --- c/Documentation/gitcli.txt
> +++ w/Documentation/gitcli.txt
> @@ -57,6 +57,16 @@ When writing a script that is expected to handle
> random user-input, it is
>  a good practice to make it explicit which arguments are which by
> placing
>  disambiguating `--` at appropriate places.
>
> + * Arguments, options, and option values given on the shell command
> +   line follow the usual shell syntax rules.  You'd need to quote
> +   your string with whitespace in it appropriately if you do not
> +   want it to be split by the shell, for example.
> ++
> +--------------------------------
> +$ git commit -m "my message with whitespace"
> +$ git show "HEAD^{/^my message with whitespace}"
> +--------------------------------
> +
>   * Many commands allow wildcards in paths, but you need to protect
>     them from getting globbed by the shell.  These two mean different
>     things:
This is a good addition. Including a couple of good examples.
-- 
Kristoffer Haugsbakk
Previous: Junio C Hamano
Message 3 of 3 in “gitrevisions: be more chatty about shell metacharacter gotchas?”
  1. Kristoffer HaugsbakkNov 28, 2024
  2. Junio C HamanoDec 2, 2024
  3. Kristoffer HaugsbakkDec 2, 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.