Patrick Steinhardt <ps@xxxxxx> 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.