Thread (6 messages) flat view 6 messages, 2 authors, 2016-06-15

Re: git does the wrong thing with ambiguous names

From: Alex Riesen <hidden>
Date: 2016-06-15 22:43:14

Brandon Casey, Thu, Jun 07, 2007 00:13:48 +0200:
When a branch and tag have the same name, a git-checkout using that name 
succeeds (exits zero without complaining), switches to the _branch_, but 
updates the working directory contents to that specified by the _tag_. 
git-status show modified files.
Bad. To reproduce:

mkdir a && cd a && git init && :> a && git add . && git commit -m1 &&
:>b && git add . && git commit -m2 && git tag master HEAD^ &&
find .git/refs/ && gco -b new && gco master && git status

Looks like the ambiguity issue was brought up last year, and git is now 
*supposed* to warn when it encounters an ambiguous name. I agree with 
Petr, it should fail violently, preferably as Josef Weidendorfer 
suggests also printing out the ambiguous matches so the user can cut and 
paste.
That'd be failing friendly :) Very good idea
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help