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

Re: Confusing behavior with ignored submodules and `git commit -a`

From
Michael Forney <mforney@mforney.org>
Date
Nov 15, 2018, 06:05 UTC
Message-ID
<CAGw6cBth+j+vAjhrQutxBXAkuJrBfHKG4GdCu1jpvAAXOwudEA@mail.gmail.com>
In-Reply-To
<CAGw6cBvJSswpvrMwKU9b+ANEHO4tWjWVhLL54nUyod2NoHJe1w@mail.gmail.com>
+bmwill
On 2018-11-14, Michael Forney <mforney@mforney.org> wrote:
Show 9 quoted lines
> On 2018-10-25, Stefan Beller <sbeller@google.com> wrote:
>> I guess reverting that commit is not a good idea now, as
>> I would expect something to break.
>>
>> Maybe looking through the series 614ea03a71
>> (Merge branch 'bw/submodule-config-cleanup', 2017-08-26)
>> to understand why it happened in the context would be a good start.
>
> Thanks, that's a good idea. I'll take a look through that series.

Interesting. If I build git from master after reverting 55568086, I do indeed observe the issue it claims to fix (unable to add ignored submodules). However, if I build from 9ef23f91fc (the immediate parent of 55568086), I do not see the issue.

Investigating this further, it seems that 55568086 addresses an issue that does not appear until later on in the series in ff6f1f564c (submodule-config: lazy-load a repository's .gitmodules file). Perhaps this was a result of reordering commits during a rebase. In other words, I get correct behavior until 55568086, and in 55568086..ff6f1f564c^ if I revert 55568086.

Looking at ff6f1f564c, I don't really see anything that might be related to git-add, git-reset, or git-diff, so I'm guessing that this only worked before because the submodule config wasn't getting loaded during `git add` or `git reset`. Now that the config is loaded automatically, submodule.<name>.ignore started taking effect where it shouldn't.

Unfortunately, this doesn't really get me much closer to finding a fix.
Previous: Michael ForneyNext: Stefan Beller
Message 5 of 12 in “Confusing behavior with ignored submodules and `git commit -a`”
  1. Michael ForneyMar 17, 2018
  2. Michael ForneyOct 25, 2018
  3. Stefan BellerOct 25, 2018
  4. Michael ForneyNov 15, 2018
  5. Michael ForneyNov 15, 2018
  6. Stefan BellerNov 15, 2018
  7. Michael ForneyNov 15, 2018
  8. Michael ForneyNov 15, 2018
  9. Stefan BellerNov 15, 2018
  10. Michael ForneyNov 16, 2018
  11. Stefan BellerNov 27, 2018
  12. Stefan BellerNov 15, 2018

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.