git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git does the wrong thing with ambiguous names

From
Alex Riesen <raa.lkml@gmail.com>
Date
Jun 6, 2007, 22:58 UTC
Message-ID
<20070606225826.GC3969@steel.home>
In-Reply-To
<4667319C.9070302@nrlssc.navy.mil>
Brandon Casey, Thu, Jun 07, 2007 00:13:48 +0200:
Show 5 quoted lines
> 
> 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

Show 6 quoted lines
> 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
Previous: Brandon CaseyNext: Alex Riesen
Message 2 of 6 in “git does the wrong thing with ambiguous names”
  1. Brandon CaseyJun 6, 2007
  2. Alex RiesenJun 6, 2007
  3. Alex RiesenJun 6, 2007
  4. Alex RiesenJun 7, 2007
  5. Brandon CaseyJun 7, 2007
  6. Brandon CaseyJun 7, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.