public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox•com>
To: Jonathan Nieder <jrnieder@gmail•com>
Cc: git@vger•kernel.org, Ronnie Sahlberg <sahlberg@google•com>,
	Michael Haggerty <mhagger@alum•mit.edu>
Subject: Re: check-ref-format: include refs/ in the argument or to strip it?
Date: Fri, 22 Aug 2014 11:37:19 -0700	[thread overview]
Message-ID: <xmqqmwawnzfk.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <20140822154151.GK20185@google.com> (Jonathan Nieder's message of "Fri, 22 Aug 2014 08:41:51 -0700")

Jonathan Nieder <jrnieder@gmail•com> writes:

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

  reply	other threads:[~2014-08-22 18:37 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <gerrit.1408574889668.Iac983fc86f7edd2a0543779d85973c57bf068ca4@code-review.googlesource.com>
     [not found] ` <047d7b624d36142d46050131f336@google.com>
2014-08-22 15:41   ` check-ref-format: include refs/ in the argument or to strip it? Jonathan Nieder
2014-08-22 18:37     ` Junio C Hamano [this message]
2014-08-22 18:45       ` Jonathan Nieder
2014-08-23  5:46         ` Jeff King
2014-08-23  5:50           ` Junio C Hamano
2014-08-25 17:43           ` Ronnie Sahlberg
2014-08-25 18:26             ` Jonathan Nieder
2014-08-25 19:09               ` Jeff King
2014-08-27 20:53                 ` Michael Haggerty
2014-08-25 19:01             ` Junio C Hamano
2014-08-23  2:59       ` Jonathan Nieder

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqmwawnzfk.fsf@gitster.dls.corp.google.com \
    --to=gitster@pobox$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    --cc=jrnieder@gmail$(echo .)com \
    --cc=mhagger@alum$(echo .)mit.edu \
    --cc=sahlberg@google$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox