Re: [PATCH 4/5] remote.c: teach branch_get() to treat symrefs other than HEAD
- From
Felipe Contreras <felipe.contreras@gmail.com>
- Date
- May 1, 2013, 20:48 UTC
- Message-ID
- <CAMP44s1dWhpVhUar2-u1NAqK-TPssxZYgGMY9_SVxvuKSFT4QA@mail.gmail.com>
- In-Reply-To
- <CALkWK0mfHVBLPdU7jyiBR=-kSguCBFOhsEsXYYthBuQbtX7MuA@mail.gmail.com>
On Wed, May 1, 2013 at 2:50 PM, Ramkumar Ramachandra <artagnon@gmail.com> wrote:
Show 6 quoted lines
> Felipe Contreras wrote:
>> As I said, the @@{u} thing can be fixed through other ways.
>
> It's not just @@{u}. I can have lots of custom symbolic refs working
> properly; I might choose D for my deleted-reflogs, M for master and so
> on.And that doesn't require the changes you did to sha1_name.c, or t/t1508-at-combinations.sh, does it?
If you are arguing in favor of arbitrary symbolic refs plus @{u} to work, a patch that allows that, and nothing else, should make sense. Such patch would trigger further discussion, for example, if get_branch() is the right place to achieve that.
Show 7 quoted lines
> The point is that my solution solves the problem in the more general case. > >> Moreover, "HEAD" is still a special case in remote.c::branch_get() >> that you just modified. > > It's not. It's just a quick shortcut for the common case because > read_config() already sets it up.
I still see this in the code:
if (!name || !*name || !strcmp(name, "HEAD")) ret = current_branch; else ret = make_branch(name, 0);
-- Felipe Contreras