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

Re: support comma-separated fetch specs list?

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 9, 2020, 22:45 UTC
Message-ID
<xmqqsg9i9mk4.fsf@gitster.c.googlers.com>
In-Reply-To
<CAKkAvawVbyTPxDFQMEJMh+dzgQ_C0PXtbQKMo8xMNjgL_buGng@mail.gmail.com>
ryenus <ryenus@gmail.com> writes:
Show 6 quoted lines
> Maybe the cause is also my ignorance or lack of carefulness to read the
> docs, but searching for "comma separated list" in Git manual would
> return hundreds of results:
> https://www.google.com/search?q=%22comma+separated%22+list+site%3Agit-scm.com
>
> So I guess it's fair to expect it to work in the fetch spec as well?
I doubt it.

The contents of these "comma separated list" are taken from a fixed vocabulary and not from unbounded set of things the end-user can freely come up with that allows a comma as part of values.

In other words, "--option=ours,theirs" may make sense only because we control the vocabulary 'common', 'ours', and 'theirs', and we make sure the vocabulary does not contain any word with comma in it.

When somebody adds a new option, we try hard during the review not to allow "--option=thing1,thing2,thing3" as the syntax we give at the UI level where thing$n are end-user controlled values, because that would rob end-users from the option of having a comma in their thing$n (for whatever reason). Certain kind of things naturally do not make sense to contain comma in them (e.g. list of numbers, for example) and we may allow end-user controlled input as part of a comma separated tuple, and when the tuple has a fixed length whose size will never change, we may allow end-user controlled thing as the last element of such a comma-separated tuple, but extending that to refspec, pathspec, etc. is a bit of stretch, I would have to say.

Previous: ryenus
Message 4 of 4 in “support comma-separated fetch specs list?”
  1. ryenusNov 4, 2020
  2. Junio C HamanoNov 4, 2020
  3. ryenusNov 7, 2020
  4. Junio C HamanoNov 9, 2020

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.