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

Re: check-ref-format: include refs/ in the argument or to strip it?

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 22, 2014, 18:37 UTC
Message-ID
<xmqqmwawnzfk.fsf@gitster.dls.corp.google.com>
In-Reply-To
<20140822154151.GK20185@google.com>
Jonathan Nieder <jrnieder@gmail.com> writes:
Show 16 quoted lines
> Michael Haggerty wrote[1]:
>> Jonathan Nieder wrote:
>
>>> The check-ref-format documentation is pretty unclear, but the
>>> intent is that it would be used like
>>>
>>>	git check-ref-format heads/master
>>>
>>> (see the surviving examples in contrib/examples/). That way, it can
>>> enforce the rule (from git-check-ref-format(1))
>>>
>>>	2. They must contain at least one /. This enforces the presence
>>>	of a category like heads/, tags/ etc. but the actual names
>>>	are not restricted.
> [...]
>> Thanks for the explanation and the pointer.

I wanted to follow this discussion, especially the ellided [...] "pointer", but had a hart time finding what "pointer" was.

Anyway, the true origin of ONELEVEL as far as I recall was to give us a way to say "in this code path, we also expect to be fed HEAD, ORIG_HEAD, etc., so please do not subject us to the 'at least one slash' rule.", implication of which is that the 'at least one slash' rule was to expect things are 'refs/<anything>' so there will be at least one. Even back then, that <anything> alone had at least one slash (e.g. heads/master), but the intention was *never* that we would forbid <anything> that does not have a slash by feeding <anything> part alone to check-ref-format, i.e. things like "refs/stash" were designed to be allowed.

That the function does not reject what does not begin with "refs/" when ONELEVEL is not in effect is just being loose.

Previous: Jonathan NiederNext: Jonathan Nieder
Message 2 of 11 in “check-ref-format: include refs/ in the argument or to strip it?”
  1. Jonathan NiederAug 22, 2014
  2. Junio C HamanoAug 22, 2014
  3. Jonathan NiederAug 22, 2014
  4. Jeff KingAug 23, 2014
  5. Junio C HamanoAug 23, 2014
  6. Ronnie SahlbergAug 25, 2014
  7. Jonathan NiederAug 25, 2014
  8. Jeff KingAug 25, 2014
  9. Michael HaggertyAug 27, 2014
  10. Junio C HamanoAug 25, 2014
  11. Jonathan NiederAug 23, 2014

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.