{"thread":{"id":"21683","subject":"Ambiguous ref names","startedAt":"2009-11-20T10:18:44Z","lastAt":"2009-12-11T08:03:09Z","messageCount":6,"participants":["Jeenu V","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"127994","messageId":"5195c8760911200218v5b75d690hbaaf00b44c8df6af@mail.gmail.com","threadId":"21683","inReplyTo":null,"subject":"Ambiguous ref names","fromName":"Jeenu V","fromEmail":"jeenuv@gmail.com","sentAt":"2009-11-20T10:18:44Z","receivedAt":"2009-11-20T10:18:44Z","isPatch":false,"sender":{"key":"jeenuv@gmail.com","avatar":"https://gravatar.com/avatar/0fae51e727209ba442f53fbab775dec62add0884f7a1bf1eb9fee94fb876f2b0?d=mp&s=160"},"body":"Hi,\n\nI'm re-posting this from the git-users Google Groups:\n\nIf I've two branches a.b.c and a.b.c.d, why does 'git checkout'\ncomplains about ambiguous ref names? For example, if I'm in a.b.c.d,\n\n896 $ git checkout a.b.c\nwarning: refname 'a.b.c' is ambiguous.\nSwitched to branch \"a.b.c\"\n\nIs this some kind of a side effect of commit abbreviation? If so is\nthis kind of branch naming considered unsafe? Is there a way to make\ngit accept ref names verbatim, even if there's potential operation\nthat'd fail because of ambiguity?\n\n-- \n:J\n"},{"id":"127995","messageId":"7vzl6h3319.fsf@alter.siamese.dyndns.org","threadId":"21683","inReplyTo":"5195c8760911200218v5b75d690hbaaf00b44c8df6af@mail.gmail.com","subject":"Re: Ambiguous ref names","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-11-20T10:26:42Z","receivedAt":"2009-11-20T10:26:42Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeenu V <jeenuv@gmail.com> writes:\n\n> If I've two branches a.b.c and a.b.c.d, why does 'git checkout'\n> complains about ambiguous ref names?\n\nBecause it doesn't???\n\n    : demo; git init\n    Initialized empty Git repository in /var/tmp/gomi/twelve/.git/\n    : demo/master; >f\n    : demo/master; git add f\n    : demo/master; git commit -a -m 'initial'\n    [master (root-commit) cb1d5f2] initial\n     0 files changed, 0 insertions(+), 0 deletions(-)\n     create mode 100644 f\n    : demo/master; git branch a.b.c\n    : demo/master; git branch a.b.c.d\n    : demo/master; git checkout a.b.c\n    Switched to branch 'a.b.c'\n\nIt could be that you have a tag and a branch that are both named a.b.c,\nthough.\n"},{"id":"127999","messageId":"5195c8760911200248v1f3d6b56q78987edfceae5541@mail.gmail.com","threadId":"21683","inReplyTo":"7vzl6h3319.fsf@alter.siamese.dyndns.org","subject":"Re: Ambiguous ref names","fromName":"Jeenu V","fromEmail":"jeenuv@gmail.com","sentAt":"2009-11-20T10:48:55Z","receivedAt":"2009-11-20T10:48:55Z","isPatch":false,"sender":{"key":"jeenuv@gmail.com","avatar":"https://gravatar.com/avatar/0fae51e727209ba442f53fbab775dec62add0884f7a1bf1eb9fee94fb876f2b0?d=mp&s=160"},"body":"On Fri, Nov 20, 2009 at 3:56 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> [...]\n> It could be that you have a tag and a branch that are both named a.b.c,\n> though.\n\nHm, right. But I'm getting this from an existing local repo of mine. I\ncan't see any tags; 'git tag -l' is empty. Is there any more info that\nI can provide?\n\nFWIW, I'm running Git under Cygwin.\n-- \n:J\n"},{"id":"128001","messageId":"7vpr7dzckl.fsf@alter.siamese.dyndns.org","threadId":"21683","inReplyTo":"5195c8760911200248v1f3d6b56q78987edfceae5541@mail.gmail.com","subject":"Re: Ambiguous ref names","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-11-20T10:59:38Z","receivedAt":"2009-11-20T10:59:38Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeenu V <jeenuv@gmail.com> writes:\n\n> On Fri, Nov 20, 2009 at 3:56 PM, Junio C Hamano <gitster@pobox.com> wrote:\n>> [...]\n>> It could be that you have a tag and a branch that are both named a.b.c,\n>> though.\n>\n> Hm, right. But I'm getting this from an existing local repo of mine. I\n> can't see any tags; 'git tag -l' is empty. Is there any more info that\n> I can provide?\n\nman git-for-each-ref?\n"},{"id":"128010","messageId":"5195c8760911200355x1aff9781l848f974c9f09f416@mail.gmail.com","threadId":"21683","inReplyTo":"7vpr7dzckl.fsf@alter.siamese.dyndns.org","subject":"Re: Ambiguous ref names","fromName":"Jeenu V","fromEmail":"jeenuv@gmail.com","sentAt":"2009-11-20T11:55:45Z","receivedAt":"2009-11-20T11:55:45Z","isPatch":false,"sender":{"key":"jeenuv@gmail.com","avatar":"https://gravatar.com/avatar/0fae51e727209ba442f53fbab775dec62add0884f7a1bf1eb9fee94fb876f2b0?d=mp&s=160"},"body":"On Fri, Nov 20, 2009 at 4:29 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> Jeenu V <jeenuv@gmail.com> writes:\n>\n>> On Fri, Nov 20, 2009 at 3:56 PM, Junio C Hamano <gitster@pobox.com> wrote:\n>>> [...]\n>>> It could be that you have a tag and a branch that are both named a.b.c,\n>>> though.\n>>\n>> Hm, right. But I'm getting this from an existing local repo of mine. I\n>> can't see any tags; 'git tag -l' is empty. Is there any more info that\n>> I can provide?\n>\n> man git-for-each-ref?\n\nIt does list all refs that I know of, but I don't see any duplicate entries.\n-- \n:J\n"},{"id":"129736","messageId":"5195c8760912110003u6deabf7ey44b1f2dd448ce7fe@mail.gmail.com","threadId":"21683","inReplyTo":"5195c8760911200355x1aff9781l848f974c9f09f416@mail.gmail.com","subject":"Re: Ambiguous ref names","fromName":"Jeenu V","fromEmail":"jeenuv@gmail.com","sentAt":"2009-12-11T08:03:09Z","receivedAt":"2009-12-11T08:03:09Z","isPatch":false,"sender":{"key":"jeenuv@gmail.com","avatar":"https://gravatar.com/avatar/0fae51e727209ba442f53fbab775dec62add0884f7a1bf1eb9fee94fb876f2b0?d=mp&s=160"},"body":"On Fri, Nov 20, 2009 at 5:25 PM, Jeenu V <jeenuv@gmail.com> wrote:\n>\n> On Fri, Nov 20, 2009 at 4:29 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> > Jeenu V <jeenuv@gmail.com> writes:\n> >\n> >> On Fri, Nov 20, 2009 at 3:56 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> >>> [...]\n> >>> It could be that you have a tag and a branch that are both named a.b.c,\n> >>> though.\n> >>\n> >> Hm, right. But I'm getting this from an existing local repo of mine. I\n> >> can't see any tags; 'git tag -l' is empty. Is there any more info that\n> >> I can provide?\n> >\n> > man git-for-each-ref?\n>\n> It does list all refs that I know of, but I don't see any duplicate entries.\n\nAh, I think I get what happened here: I had used git update-ref, which\nturned out to be used wrongly. My intention was to update a.b.c to a\nnew ref, but I used it 'git update-ref XXXXXX', rather than 'git\nupdate-ref refs/heads/a.b.c XXXXXX'. The wrong usage created\n.git/a.b.c and I guess this was causing the warning.\n\n--\n:J\n"}]}