From: Junio C Hamano <gitster@pobox.com>
To: Michael Haggerty <mhagger@alum.mit.edu>
Cc: git discussion list <git@vger.kernel.org>
Subject: Re: Buggy handling of non-canonical ref names
Date: Wed, 24 Aug 2011 11:40:24 -0700 [thread overview]
Message-ID: <7vaaayps9z.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <4E551D70.9080509@alum.mit.edu> (Michael Haggerty's message of "Wed, 24 Aug 2011 17:49:04 +0200")
Michael Haggerty <mhagger@alum.mit.edu> writes:
> What is the policy about reference names and their canonicalization?
The overall policy has been that we care about well-formed input, and
everything else is "undefined", even though as you found out some of them
try to work sensibly.
> $ git check-ref-format /foo/bar ; echo $?
> 0
>
> $ git check-ref-format --print /foo/bar
> /foo/bar
I think these are bogus. Patches welcome.
> However, creating a reference with such a name is equivalent to creating
> a reference without the leading slash:
>
> $ git update-ref /foo/bar HEAD
> $ cat .git/foo/bar
> ef6cf90ba11dd6205f8b974692d795ea0b1c0bdd
> $ git branch /bar/baz
> $ git for-each-ref | grep baz
> ef6cf90ba11dd6205f8b974692d795ea0b1c0bdd commit refs/heads/bar/baz
These are just examples of "undefined being nice to the user as a bonus".
next prev parent reply other threads:[~2011-08-24 18:40 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-24 15:49 Buggy handling of non-canonical ref names Michael Haggerty
2011-08-24 18:40 ` Junio C Hamano [this message]
2011-08-24 21:32 ` Carlos Martín Nieto
2011-08-24 22:27 ` Junio C Hamano
2011-08-25 7:54 ` Michael Haggerty
2011-08-25 8:08 ` [PATCH] Do not allow refnames to start with a slash Michael Haggerty
2011-08-25 18:17 ` Junio C Hamano
2011-08-25 19:19 ` [PATCH] check-ref-format --print: Normalize refnames that start with slashes Michael Haggerty
2011-08-25 20:42 ` Junio C Hamano
2011-08-25 21:57 ` Michael Haggerty
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=7vaaayps9z.fsf@alter.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=mhagger@alum.mit.edu \
/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).