git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: Emeric Fermas <emeric.fermas@gmail.com>,
	Kevin Ballard <kevin@sb.org>,
	git@vger.kernel.org, Vicent Marti <tanoku@gmail.com>,
	libgit2@librelist.com
Subject: Re: What's the definition of a valid Git symbolic reference?
Date: Tue, 15 Feb 2011 02:09:39 -0500	[thread overview]
Message-ID: <20110215070939.GB28634@sigill.intra.peff.net> (raw)
In-Reply-To: <7vsjvpq0jk.fsf@alter.siamese.dyndns.org>

On Mon, Feb 14, 2011 at 10:22:55PM -0800, Junio C Hamano wrote:

> Emeric Fermas <emeric.fermas@gmail.com> writes:
> 
> > Once again, by reading at the code I can understand how those commands
> > currently work. What I'm trying to achieve is to understand what
> > should be their recommended usage.
> 
> There are only two valid kinds of symrefs right now:
> 
>  - .git/HEAD, pointing at somewhere under refs/heads/ hierarchy;
> 
>  - .git/refs/remotes/<some remote name>/HEAD, pointing at somewhere under
>    refs/remotes/<the same remote name>/ hierarchy.

Nit: the notes merge code uses NOTES_MERGE_REF as a symref to a notes
ref. See the create_symref call in builtin/notes.c.

I don't think that changes your point much, though.

> The code may be prepared to resolve recursive symrefs, symrefs other than
> the above two kinds, symrefs that point at elsewhere, but all of them are
> outside of the design scope of what the mechanism was intended to support.
> What the code do to them (without crashing) is not the design, but simply
> an undefined behaviour.

I was always under the impression that you could generally use symbolic
refs to point wherever you wanted inside the refs hierarchy as a
replacement for symlinks (I don't know how the latter would deal with
ref packing, though). But I think that was just my assumption rather
than anything that was ever communicated officially.

-Peff

      parent reply	other threads:[~2011-02-15  7:09 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-14 20:58 What's the definition of a valid Git symbolic reference? Emeric Fermas
2011-02-15  3:19 ` Kevin Ballard
2011-02-15  3:49   ` Emeric Fermas
2011-02-15  5:02     ` Tomas Carnecky
2011-02-19 13:10       ` Kevin P. Fleming
2011-02-15  6:22     ` Junio C Hamano
2011-02-15  6:32       ` Emeric Fermas
2011-02-15  7:09       ` Jeff King [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=20110215070939.GB28634@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=emeric.fermas@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=kevin@sb.org \
    --cc=libgit2@librelist.com \
    --cc=tanoku@gmail.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).