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

Re: [PATCH 6/8] check_refname_format(): add FULLY_QUALIFIED flag

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 30, 2024, 17:00 UTC
Message-ID
<xmqqmspardk5.fsf@gitster.g>
In-Reply-To
<ZjDDa5PIxPCFzMhq@tanuki>
Patrick Steinhardt <ps@pks.im> writes:
Show 5 quoted lines
>> valid. E.g., validating a refspec may involve a name like "main" on its
>> own. I suspect it would be OK in practice to just give it an arbitrary
>> "refs/foo/$main", but that feels kind of hacky.
>
> Ah, fair enough.

I actually do not think it is fair enough. Why does the caller want to validate "main" in the first place? To make the example more realistic, lets imagine a caller wants to validate "HEAD". We can say "it is syntactically correct", but in what context is that answer useful? If the caller is contemplating to create a new branch given a short-name, we would want to say "no, refs/heads/HEAD is not something we want you to create", but if the caller is planning to create refs/remotes/origin/HEAD, our answer would be different.

Previous: Patrick Steinhardt
Message 8 of 8 in “check_refname_format(): add FULLY_QUALIFIED flag”
  1. 6/8 check_refname_format(): add FULLY_QUALIFIED flagJeff King, Apr 29, 2024
  2. Karthik NayakApr 29, 2024
  3. Jeff KingApr 30, 2024
  4. Patrick SteinhardtApr 30, 2024
  5. Patrick SteinhardtApr 30, 2024
  6. Jeff KingApr 30, 2024
  7. Patrick SteinhardtApr 30, 2024
  8. Junio C HamanoApr 30, 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.