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

Re: Regression[2.14.3->2.15]: Interactive rebase fails if submodule is modified

From
Orgad Shaneh <orgads@gmail.com>
Date
Nov 6, 2017, 20:36 UTC
Message-ID
<CAGHpTBJ9QpEeumzZuO2DeNS-6a6oL2Vn0WNZrm1nt0qFcLfJyw@mail.gmail.com>
In-Reply-To
<20171106183702.GA131418@google.com>
On Mon, Nov 6, 2017 at 8:37 PM, Brandon Williams <bmwill@google.com> wrote:
Show 23 quoted lines
> After reading your bug report and the fact that you weren't able to
> reproduce it outside of your project I think i figured out what is
> happening.  Before ff6f1f564c the gitmodules file wasn't being loaded
> unless a codepath explicitly wanted to work with submodules.  Now they
> are being lazy-loaded so if you call into the submodule config subsystem
> it'll work without having to have initialized it before.  I suspect
> that the submodule which is causing the failure has a
> "submodule.<name>.ignore" entry in the .gitmodules file or somewhere in
> your repositories config (I actually suspect the latter based on the
> code path).
>
> When rebase calls into the diff machinery to see if there are unstaged
> changes it explicitly requests that submodule's be ignored, but this
> desired gets overridden by your repository's config, clearing the
> ignored flag and making rebase actually pay attention to the fact that
> the submodule has changes in it.
>
> I don't have a patch available to for you to test just yet (but I'll
> have some time later today to write one up) but could you verify that
> (1) you have an ignore entry for the submodule in question in your
> config and (2) removing it from your config avoids the failure?  If
> that's the case then we would be able to put together a reproducible
> recipe for this failure.

You're right. Thanks for the info. I have ignore = dirty, and removing it from the config solves the problem indeed.

The following script reproduces the bug (it's the same as before, only added git config):

rm -rf super sub mkdir sub; cd sub; git init git commit --allow-empty -m 'Initial commit' mkdir ../super; cd ../super git init git submodule add ../sub git config submodule.sub.ignore dirty touch foo; git add foo sub git commit -m 'Initial commit' touch a; git add a; git commit -m 'a' touch b; git add b; git commit -m 'b' cd sub; git commit --allow-empty -m 'New commit'; cd .. git rebase -i HEAD^^

- Orgad
Previous: Brandon Williams
Message 9 of 9 in “Regression[2.14.3->2.15]: Interactive rebase fails if submodule is modified”
  1. Orgad ShanehNov 2, 2017
  2. Stefan BellerNov 2, 2017
  3. Orgad ShanehNov 2, 2017
  4. Johannes SchindelinNov 3, 2017
  5. Johannes SchindelinNov 3, 2017
  6. Orgad ShanehNov 4, 2017
  7. Orgad ShanehNov 5, 2017
  8. Brandon WilliamsNov 6, 2017
  9. Orgad ShanehNov 6, 2017

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.