git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael J Gruber <git@drmicha.warpmail.net>
To: geoffrey.russell@gmail.com
Cc: git@vger.kernel.org, Daniel Barkalow <barkalow@iabervon.org>,
	Junio C Hamano <gitster@pobox.com>
Subject: Re: check-ref-format question
Date: Thu, 14 May 2009 09:24:07 +0200	[thread overview]
Message-ID: <4A0BC717.1060900@drmicha.warpmail.net> (raw)
In-Reply-To: <93c3eada0905131726p3afe8e68j160bd3931886093d@mail.gmail.com>

Geoff Russell venit, vidit, dixit 14.05.2009 02:26:
> On Wed, May 13, 2009 at 11:43 PM, Michael J Gruber
> <git@drmicha.warpmail.net> wrote:
>> Geoff Russell venit, vidit, dixit 13.05.2009 02:09:
>>> 1 $ git --version
>>> git version 1.6.2.3
>>> 2 $ git check-ref-format xxxx && echo OK
>>> 3 $ git-check-ref-format --branch xxxx && echo OK
>>> xxxx
>>> OK
>>> 4 $ git check-ref-format --branch xxxx && echo OK
>>> usage: git check-ref-format refname
>>>
>>>
>>> 2 seems wrong,
>>> I tried 3 after looking at  builtin-check-ref-format.c
>>> I couldn't find any test cases in the git/t directory
>>>
>>> From the documenation, I expect "git check-ref-format xxx" to return 0 if xxx is
>>> a valid branch or ref name.  git version 1.6.3 gives the same results.
>>
>> There are several things going on:
>>
>> A) In 3 you use a different git than in 1,2,4. You told us the latter is
>> 1.6.2.3, and I'm telling you the former contains v1.6.2.1-310-ga31dca0
>> (which has the new --branch option).
>> This simply checks whether refs/heads/xxxx is sane. (It also resolves
>> @{-1} and such, which is what makes it useful at all.)
> 
> Sorry, my mistake I was running in 2 windows on 2 machine and got
> confused. Ignore
> line 3 in my example.
> 
>>
>> B) "master" certainly looks like a valid refname, the doc seems to imply
>> that it should pass the check.
> 
> $ git --version
> git version 1.6.2.3
> $ git check-ref-format xxxx && echo OK
> $ git check-ref-format master && echo OK
> $ git check-ref-format master/xxxx && echo OK
> OK
> 
> I'm confused.
> 
> Geoff.

Please read on to my item C), and check the documentation patch which I
submitted. If you're still confused after that I need to revise my patch ;)

> 
> 
>>
>> C) Looking at the code, check-ref-format checks explicitly for the
>> presence of at least 2 levels: foo/bar is good, foo is bad. So, master
>> always had been bad, as well (or bad) as full sha1s!
>>
>> The code has always behaved like C since its inception but I don't know
>> the rationale behind the 2 level requirement. Daniel, Junio?
>>
>> Michael
>>

      reply	other threads:[~2009-05-14  7:24 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-13  0:09 check-ref-format question Geoff Russell
2009-05-13 14:13 ` Michael J Gruber
2009-05-13 14:40   ` Sverre Rabbelier
2009-05-13 15:03   ` Daniel Barkalow
2009-05-13 15:43     ` [PATCH] Documentation: clarify / requirement in 'git check-ref-format' Michael J Gruber
2009-05-18  2:36       ` Geoff Russell
2009-05-14  0:26   ` check-ref-format question Geoff Russell
2009-05-14  7:24     ` Michael J Gruber [this message]

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=4A0BC717.1060900@drmicha.warpmail.net \
    --to=git@drmicha.warpmail.net \
    --cc=barkalow@iabervon.org \
    --cc=geoffrey.russell@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).