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

Branch merge bug

From
Ramkumar Ramachandra <artagnon@gmail.com>
Date
Jan 19, 2010, 07:22 UTC
Message-ID
<f3271551001182322p86a02d8p8b9ceb49e930d333@mail.gmail.com>

A friend showed me this reduced test case. It seems to work fine with bzr and hg. Is this a git bug?

>: git --version
git version 1.6.3.1
>: git init
Initialized empty Git repository in /Users/lut4rp/Code/tester/.git/
>: echo asdjhaskd >fil
>: git add fil
>: git cm 'initial commit'
[master (root-commit) 9983161] initial commit
 1 files changed, 1 insertions(+), 0 deletions(-)
 create mode 100644 fil
>: git branch new
>: git branch
* master
  new
>: git mv fil fila
>: git status

# On branch master # Changes to be committed: # (use "git reset HEAD <file>..." to unstage) # # renamed: fil -> fila #

>: git cm 'renamed to fila'
[master 9de0953] renamed to fila
 1 files changed, 0 insertions(+), 0 deletions(-)
 rename fil => fila (100%)
>: git co new
Switched to branch 'new'
>: git rm fil
rm 'fil'
>: echo asjhdajkhsdkajhs >fila
>: git add fila
>: git cm 'renamed, heavily modified'
[new 5914271] renamed, heavily modified
 2 files changed, 2 insertions(+), 1 deletions(-)
 delete mode 100644 fil
 create mode 100644 fila
>: git co master
Switched to branch 'master'
>: git merge new

CONFLICT (rename/delete): Rename fil->fila in HEAD and deleted in new Automatic merge failed; fix conflicts and then commit the result.

>: cat fila

asdjhaskd #### Still the master branch's content, `merge` apparently did nothing.

>: git show :2:fila
asdjhaskd
>: git show :3:fila

fatal: ambiguous argument ':3:fila': unknown revision or path not in the working tree. Use '--' to separate paths from revisions

>: git show new:fila

asjhdajkhsdkajhs ajksh askjdhaksdh kajshdk asd

Next: Michael J Gruber
Message 1 of 5 in “Branch merge bug”
  1. Ramkumar RamachandraJan 19, 2010
  2. Michael J GruberJan 19, 2010
  3. Andreas KreyJan 19, 2010
  4. Ramkumar RamachandraJan 19, 2010
  5. Michael J GruberJan 19, 2010

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.