All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Rast <trast@inf.ethz.ch>
To: Duy Nguyen <pclouds@gmail.com>
Cc: Ramkumar Ramachandra <artagnon@gmail.com>,
	Junio C Hamano <gitster@pobox.com>,
	Git List <git@vger.kernel.org>,
	Felipe Contreras <felipe.contreras@gmail.com>,
	Michael Haggerty <mhagger@alum.mit.edu>
Subject: Re: [PATCH] refs.c: interpret @ as HEAD
Date: Wed, 1 May 2013 10:35:00 +0200	[thread overview]
Message-ID: <87li7zcd3f.fsf@hexa.v.cablecom.net> (raw)
In-Reply-To: <CACsJy8CZ8E-ASmo237rRbYR7pqoseo-NpU6jVrg6Rvd9qSY01w@mail.gmail.com> (Duy Nguyen's message of "Wed, 1 May 2013 09:18:41 +0700")

Duy Nguyen <pclouds@gmail.com> writes:

> On Wed, May 1, 2013 at 12:15 AM, Ramkumar Ramachandra
> <artagnon@gmail.com> wrote:
>> Duy Nguyen wrote:
>>> We could put still ref aliases
>>> into the same ref namespace, with lower precedence that actual refs,
>>> so no new syntax required.
>>
>> Actually, ref-alises are the right way to solve the problem.
>> Recursive symref peeling is a bad idea: I can't take my aliases with
>> me, and they complicate unnecessarily.
>>
>> Any thoughts on how to implement it?  Should it go as deep as
>> resolve_ref_unsafe()?
>
> Depends on how you define ref alias. resolve_ref_unsafe allows you to
> substitute one ref with another. Thomas was talking about substituting
> part of extended sha-1 syntax (U -> @{u}) so it can't be done down
> there. I still think get_sha1_with_context_1() is the right place.
> Still not so sure how to handle when we have both alias "U" and
> refs/heads/U.

Well, I'm not sure about the semantics that I want.  But so far I am
*pretty* sure that I don't want it to be parameterized / part of another
ref.

So I'm fine with looking at *just* the alias, and resolving that to a
SHA1, and going from there.  So assuming U = @{u} and H = HEAD, you'd be
allowed to say U^ or U..H but not HU or H@U or whatever contortionate
syntax that would need.

As for the collisions, not sure which one is better.  Probably having
the same semantics as command aliases would be less confusing, i.e.,
existing refs take precedence.

-- 
Thomas Rast
trast@{inf,student}.ethz.ch

  reply	other threads:[~2013-05-01  8:35 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-30 12:24 [PATCH] refs.c: interpret @ as HEAD Ramkumar Ramachandra
2013-04-30 12:31 ` Duy Nguyen
2013-04-30 13:01 ` Thomas Rast
2013-04-30 13:32   ` Ramkumar Ramachandra
2013-04-30 15:04   ` Duy Nguyen
2013-04-30 16:08     ` Michael Haggerty
2013-04-30 16:09     ` Junio C Hamano
2013-04-30 16:26       ` Duy Nguyen
2013-04-30 17:15         ` Ramkumar Ramachandra
2013-05-01  2:18           ` Duy Nguyen
2013-05-01  8:35             ` Thomas Rast [this message]
2013-04-30 17:07       ` Ramkumar Ramachandra
2013-04-30 17:23       ` Ramkumar Ramachandra
2013-04-30 17:28         ` Felipe Contreras
2013-04-30 17:32           ` Ramkumar Ramachandra
2013-04-30 18:08             ` Junio C Hamano
2013-04-30 18:22               ` Ramkumar Ramachandra
2013-04-30 18:24                 ` Ramkumar Ramachandra
2013-04-30 18:40                 ` Ramkumar Ramachandra
2013-04-30 18:50                   ` Ramkumar Ramachandra
2013-04-30 22:00                 ` Felipe Contreras

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=87li7zcd3f.fsf@hexa.v.cablecom.net \
    --to=trast@inf.ethz.ch \
    --cc=artagnon@gmail.com \
    --cc=felipe.contreras@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=mhagger@alum.mit.edu \
    --cc=pclouds@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.