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

Re: git failing to create new branches, depending on the name

From
ASArtur Skawina <art.08.09@gmail.com>
Date
Aug 8, 2009, 17:33 UTC
Message-ID
<4A7DB6E1.3000302@gmail.com>
In-Reply-To
<200908081904.58186.trast@student.ethz.ch>
Thomas Rast wrote:
Show 11 quoted lines
> Artur Skawina wrote:
>> + git checkout -f -b branch-g90bc1a6 askern/release
>> fatal: git checkout: branch branch-g90bc1a6 already exists
> 
> This bisects to
> 
> commit 352eadc40024b141e1295693654ec20cc123844f
> Author: Daniel Barkalow <barkalow@iabervon.org>
> Date:   Sun Sep 21 14:36:06 2008 -0400
> 
>     Check early that a new branch is new and valid
> Not sure this is a bug though.  If we allow branch names that are

well, it didn't say it didn't like the name, and sent me looking for bugs in my scripts for quite a while, until i realized what's going on...

> ambiguous to rev-parse, what do they resolve to?  E.g., in the
> presence of only 'master', 'master-g01234567' is defined to be the
> same as 01234567.  What is it if you also have a *branch* called
> 'master-g01234567'?

I'd expect the branch namespace to take precedence, unless branches ending in -g01234567 are illegal, but that seems like an odd limitation.

Note that currently this works:
+ ( cd /tmp/build-tree/ && git checkout -f whatever/random-name-g90bc1a6 )
HEAD is now at 90bc1a6... Merge branch 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus
which doesn't seem right either.
artur
Previous: Thomas RastNext: Daniel Barkalow
Message 3 of 4 in “git failing to create new branches, depending on the name”
  1. Artur SkawinaAug 8, 2009
  2. Thomas RastAug 8, 2009
  3. Artur SkawinaAug 8, 2009
  4. Daniel BarkalowAug 8, 2009

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.