git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Interactive rebase with submodules
@ 2012-01-17 18:47 John Keeping
  2012-01-17 21:29 ` Jens Lehmann
  0 siblings, 1 reply; 5+ messages in thread
From: John Keeping @ 2012-01-17 18:47 UTC (permalink / raw)
  To: git

I've encountered a scenario where git rebase --interactive drops a 
commit which contains a modification to a submodule but no other changes.

This occurs when there is a conflict when applying the commit (for 
example if the submodule's history has been rewritten and you are 
rewriting the parent repository to match the new version of the submodule).

To clarify:

git rebase -i
# Edit a commit, switching submodule to an unrelated commit
git rebase --continue
# Conflict in submodule, checkout the correct submodule commit
git add path/to/submodule
# Only change in index is updated submodule
git rebase --continue
# No commit is created for the submodule change


This appears to be because the git-rebase--interactive script inspects 
whether there is anything to commit when `rebase --continue` is invoked 
by running:

     git diff-index --cached --quiet --ignore-submodules HEAD --

Is there a reason for the `--ignore-submodules` in this command? 
Removing that option results in the expected behaviour.


I can understand not updating submodules while running the rebase, but I 
expected that having resolved a conflict and added my change to the 
index it would be applied by `git rebase --continue`, as indeed it is if 
there happen to be other (non-submodule) changes in the same commit.


-- 
John

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-01-19 10:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-17 18:47 Interactive rebase with submodules John Keeping
2012-01-17 21:29 ` Jens Lehmann
2012-01-18 11:21   ` John Keeping
2012-01-18 20:38     ` Jens Lehmann
2012-01-19 10:48       ` John Keeping

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 NNTP newsgroup(s).