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

Re: Git Interactive Rebase - Bug in error message ?

From
MTMatthieu Tourne <matthieu.tourne@gmail.com>
Date
Jun 8, 2010, 00:06 UTC
Message-ID
<AANLkTinaUiHz8gRi5JF3n45aNCoPqiNxwExIga-cyYnw@mail.gmail.com>
In-Reply-To
<AANLkTikIKILZaGC9WZ45ZUC-lxeYIb3Mrf38qwlS2bVr@mail.gmail.com>
Hi,

I tried to perform an interactive rebase of several commits in my tree. In one of my commits I had performed a git rm --cached, on several files. The resulting message was :

error: Untracked working tree file 'foo' would be overwritten by merge. shift: 1: can't shift that many

I eventually removed the file from the fs, and the rebase worked. The fact that the rebase is not working is probably not a bug, but the last line looks like an sh bug.

I can reproduce this with git 1.7.1, and also git HEAD (1.7.1.245.g7c42e)
this can be reproduced with :

$ mkdir dirA $ echo "A" > dirA/A $ git commit -a -m 'first commit'

$ mkdir dirB $ echo "B" > dirB/B $ git commit -a -m 'creating dirB'

$ mkdir dirC $ echo "C" > dirC/C $ git rm -r --cached dirA $ git commit -a -m 'creating dirC, removing dirA'

$ git rebase --interactive HEAD~2 (then swapping the two commits)

pick creating dirC, removing dirA pick creating dirB

error: Untracked working tree file 'dirA/A' would be overwritten by merge. shift: 1: can't shift that many

Thank you,
Matthieu.
-- 
Matthieu Tourne
Next: Ian Ward Comfort
Message 1 of 2 in “Re: Git Interactive Rebase - Bug in error message ?”
  1. Matthieu TourneJun 8, 2010
  2. rebase -i: Abort cleanly if new base cannot be checked outIan Ward Comfort, Jun 8, 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.