* Ambiguous ref names
@ 2009-11-20 10:18 Jeenu V
2009-11-20 10:26 ` Junio C Hamano
0 siblings, 1 reply; 6+ messages in thread
From: Jeenu V @ 2009-11-20 10:18 UTC (permalink / raw)
To: git
Hi,
I'm re-posting this from the git-users Google Groups:
If I've two branches a.b.c and a.b.c.d, why does 'git checkout'
complains about ambiguous ref names? For example, if I'm in a.b.c.d,
896 $ git checkout a.b.c
warning: refname 'a.b.c' is ambiguous.
Switched to branch "a.b.c"
Is this some kind of a side effect of commit abbreviation? If so is
this kind of branch naming considered unsafe? Is there a way to make
git accept ref names verbatim, even if there's potential operation
that'd fail because of ambiguity?
--
:J
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Ambiguous ref names
2009-11-20 10:18 Ambiguous ref names Jeenu V
@ 2009-11-20 10:26 ` Junio C Hamano
2009-11-20 10:48 ` Jeenu V
0 siblings, 1 reply; 6+ messages in thread
From: Junio C Hamano @ 2009-11-20 10:26 UTC (permalink / raw)
To: Jeenu V; +Cc: git
Jeenu V <jeenuv@gmail.com> writes:
> If I've two branches a.b.c and a.b.c.d, why does 'git checkout'
> complains about ambiguous ref names?
Because it doesn't???
: demo; git init
Initialized empty Git repository in /var/tmp/gomi/twelve/.git/
: demo/master; >f
: demo/master; git add f
: demo/master; git commit -a -m 'initial'
[master (root-commit) cb1d5f2] initial
0 files changed, 0 insertions(+), 0 deletions(-)
create mode 100644 f
: demo/master; git branch a.b.c
: demo/master; git branch a.b.c.d
: demo/master; git checkout a.b.c
Switched to branch 'a.b.c'
It could be that you have a tag and a branch that are both named a.b.c,
though.
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: Ambiguous ref names
2009-11-20 10:26 ` Junio C Hamano
@ 2009-11-20 10:48 ` Jeenu V
2009-11-20 10:59 ` Junio C Hamano
0 siblings, 1 reply; 6+ messages in thread
From: Jeenu V @ 2009-11-20 10:48 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
On Fri, Nov 20, 2009 at 3:56 PM, Junio C Hamano <gitster@pobox.com> wrote:
> [...]
> It could be that you have a tag and a branch that are both named a.b.c,
> though.
Hm, right. But I'm getting this from an existing local repo of mine. I
can't see any tags; 'git tag -l' is empty. Is there any more info that
I can provide?
FWIW, I'm running Git under Cygwin.
--
:J
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Ambiguous ref names
2009-11-20 10:48 ` Jeenu V
@ 2009-11-20 10:59 ` Junio C Hamano
2009-11-20 11:55 ` Jeenu V
0 siblings, 1 reply; 6+ messages in thread
From: Junio C Hamano @ 2009-11-20 10:59 UTC (permalink / raw)
To: Jeenu V; +Cc: Junio C Hamano, git
Jeenu V <jeenuv@gmail.com> writes:
> On Fri, Nov 20, 2009 at 3:56 PM, Junio C Hamano <gitster@pobox.com> wrote:
>> [...]
>> It could be that you have a tag and a branch that are both named a.b.c,
>> though.
>
> Hm, right. But I'm getting this from an existing local repo of mine. I
> can't see any tags; 'git tag -l' is empty. Is there any more info that
> I can provide?
man git-for-each-ref?
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Ambiguous ref names
2009-11-20 10:59 ` Junio C Hamano
@ 2009-11-20 11:55 ` Jeenu V
2009-12-11 8:03 ` Jeenu V
0 siblings, 1 reply; 6+ messages in thread
From: Jeenu V @ 2009-11-20 11:55 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
On Fri, Nov 20, 2009 at 4:29 PM, Junio C Hamano <gitster@pobox.com> wrote:
> Jeenu V <jeenuv@gmail.com> writes:
>
>> On Fri, Nov 20, 2009 at 3:56 PM, Junio C Hamano <gitster@pobox.com> wrote:
>>> [...]
>>> It could be that you have a tag and a branch that are both named a.b.c,
>>> though.
>>
>> Hm, right. But I'm getting this from an existing local repo of mine. I
>> can't see any tags; 'git tag -l' is empty. Is there any more info that
>> I can provide?
>
> man git-for-each-ref?
It does list all refs that I know of, but I don't see any duplicate entries.
--
:J
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Ambiguous ref names
2009-11-20 11:55 ` Jeenu V
@ 2009-12-11 8:03 ` Jeenu V
0 siblings, 0 replies; 6+ messages in thread
From: Jeenu V @ 2009-12-11 8:03 UTC (permalink / raw)
To: git
On Fri, Nov 20, 2009 at 5:25 PM, Jeenu V <jeenuv@gmail.com> wrote:
>
> On Fri, Nov 20, 2009 at 4:29 PM, Junio C Hamano <gitster@pobox.com> wrote:
> > Jeenu V <jeenuv@gmail.com> writes:
> >
> >> On Fri, Nov 20, 2009 at 3:56 PM, Junio C Hamano <gitster@pobox.com> wrote:
> >>> [...]
> >>> It could be that you have a tag and a branch that are both named a.b.c,
> >>> though.
> >>
> >> Hm, right. But I'm getting this from an existing local repo of mine. I
> >> can't see any tags; 'git tag -l' is empty. Is there any more info that
> >> I can provide?
> >
> > man git-for-each-ref?
>
> It does list all refs that I know of, but I don't see any duplicate entries.
Ah, I think I get what happened here: I had used git update-ref, which
turned out to be used wrongly. My intention was to update a.b.c to a
new ref, but I used it 'git update-ref XXXXXX', rather than 'git
update-ref refs/heads/a.b.c XXXXXX'. The wrong usage created
.git/a.b.c and I guess this was causing the warning.
--
:J
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2009-12-11 8:03 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-20 10:18 Ambiguous ref names Jeenu V
2009-11-20 10:26 ` Junio C Hamano
2009-11-20 10:48 ` Jeenu V
2009-11-20 10:59 ` Junio C Hamano
2009-11-20 11:55 ` Jeenu V
2009-12-11 8:03 ` Jeenu V
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox