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

[BUG] submodule move badly handled by git-rebase

From
Yydirson@free.fr <ydirson@free.fr>
Date
Apr 7, 2020, 16:34 UTC
Message-ID
<277700231.805340039.1586277291215.JavaMail.root@zimbra39-e7>
In-Reply-To
<702823257.805273759.1586276452976.JavaMail.root@zimbra39-e7>
Hello all,

When rebasing commits involving move of a submodule, git-rebase fails to record in index the "add" part of the rename. This leaves the workdir dirty and the rebase gets stopped.

fast-export of a testcase is attached. To reproduce, just "git rebase -i", add a "break" before the move commit, use this to introduce some noise, and watch.

Best regards,
-- 
Yann


(master)$ git rebase -i HEAD^^
hint: Waiting for your editor to close the file... Waiting for Emacs...
Stopped at b0e1b00... add submodule

(master|REBASE 2/3)$ echo >>README 

(master|REBASE 2/3)$ git commit -a -m noise
[detached HEAD d67c886] noise
 1 file changed, 1 insertion(+)

(master|REBASE 2/3)$ git rebase --continue 
Adding as subdir/gitlab-oe~08e230f... move submodule instead
error: could not apply 08e230f... move submodule
Resolve all conflicts manually, mark them as resolved with
"git add/rm <conflicted_files>", then run "git rebase --continue".
You can instead skip this commit: run "git rebase --skip".
To abort and get back to the state before "git rebase", run "git rebase --abort".
Could not apply 08e230f... move submodule

(master|REBASE 3/3)$ git st
interactive rebase in progress; onto c21ef8e
Last commands done (3 commands done):
   break
   pick 08e230f move submodule
  (see more in file .git/rebase-merge/done)
No commands remaining.
You are currently rebasing branch 'master' on 'c21ef8e'.
  (fix conflicts and then run "git rebase --continue")
  (use "git rebase --skip" to skip this patch)
  (use "git rebase --abort" to check out the original branch)

Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
        modified:   .gitmodules
        deleted:    gitlab-oe

Unmerged paths:
  (use "git restore --staged <file>..." to unstage)
  (use "git add <file>..." to mark resolution)
        added by them:   subdir/gitlab-oe

(master|REBASE 3/3)$ 
Next: Elijah Newren
Message 1 of 6 in “[BUG] submodule move badly handled by git-rebase”
  1. ydirson@free.frApr 7, 2020
  2. Elijah NewrenApr 7, 2020
  3. ydirson@free.frApr 8, 2020
  4. Elijah NewrenApr 8, 2020
  5. ydirson@free.frApr 8, 2020
  6. Elijah NewrenApr 8, 2020

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.