git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: ydirson@free.fr
To: git <git@vger.kernel.org>
Subject: [BUG] submodule move badly handled by git-rebase
Date: Tue, 7 Apr 2020 18:34:51 +0200 (CEST)	[thread overview]
Message-ID: <277700231.805340039.1586277291215.JavaMail.root@zimbra39-e7> (raw)
In-Reply-To: <702823257.805273759.1586276452976.JavaMail.root@zimbra39-e7>

[-- Attachment #1: Type: text/plain, Size: 1885 bytes --]

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)$ 

[-- Attachment #2: submodule-move.fexp --]
[-- Type: application/octet-stream, Size: 1034 bytes --]

blob
mark :1
data 4
foo

reset refs/heads/master
commit refs/heads/master
mark :2
author Yann Dirson <yann@blade-group.com> 1586276255 +0200
committer Yann Dirson <yann@blade-group.com> 1586276255 +0200
data 8
initial
M 100644 :1 README

blob
mark :3
data 93
[submodule "gitlab-oe"]
	path = gitlab-oe
	url = https://github.com/BladeGroup/gitlab-oe.git

commit refs/heads/master
mark :4
author Yann Dirson <yann@blade-group.com> 1586276297 +0200
committer Yann Dirson <yann@blade-group.com> 1586276297 +0200
data 14
add submodule
from :2
M 100644 :3 .gitmodules
M 160000 dd943dc6c97664d409feaaff3647c242dbb300df gitlab-oe

blob
mark :5
data 100
[submodule "gitlab-oe"]
	path = subdir/gitlab-oe
	url = https://github.com/BladeGroup/gitlab-oe.git

commit refs/heads/master
mark :6
author Yann Dirson <yann@blade-group.com> 1586276328 +0200
committer Yann Dirson <yann@blade-group.com> 1586276328 +0200
data 15
move submodule
from :4
M 100644 :5 .gitmodules
D gitlab-oe
M 160000 dd943dc6c97664d409feaaff3647c242dbb300df subdir/gitlab-oe


       reply	other threads:[~2020-04-07 16:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <702823257.805273759.1586276452976.JavaMail.root@zimbra39-e7>
2020-04-07 16:34 ` ydirson [this message]
2020-04-07 20:49   ` [BUG] submodule move badly handled by git-rebase Elijah Newren
2020-04-08  7:52     ` ydirson
2020-04-08 16:21       ` Elijah Newren
2020-04-08 16:23       ` ydirson
2020-04-08 16:33         ` Elijah Newren

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=277700231.805340039.1586277291215.JavaMail.root@zimbra39-e7 \
    --to=ydirson@free.fr \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).