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

From: Junio C Hamano <[email-masked]>
Date: Tue, 30 Apr 2024 10:00:10 -0700

Patrick Steinhardt <[email-masked]> writes:

>> 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.