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

git add --all does not respect submodule.<name>.ignore

From
MSMichael Scott-Nelson <mscottnelson@gmail.com>
Date
Jan 30, 2018, 20:25 UTC
Message-ID
<CAMZgS+GT8pSx8rDy1KmzFV3LObA_bAkw25LMz5Oodb88QOXY5A@mail.gmail.com>

Giving a submodule "ignore=all" or "ignore=dirty" in .gitmodule successfully removes that module from `git status` queries. However, these same diffs are automatically added by git-add, eg `git add .` or `git add --all` adds the submodules that we want ignored. This seems inconsistent and confusing.

Workflow reason: We want to be able to have supers and subs checked-out, make changes to both, but only update the SHA-1 pointer from super to sub when explicitly forced to do so, eg `git add -f subName`. This workflow prevents continuous merge conflicts from clashing SHA-1 pointers while still allowing `git add --all`, allowing a sort of middle ground between submodules and an untracked library.

Teaching git-add about submodule.ignore and/or teaching .gitignore about submodules would be awesome.

Also experimented with `git update-index --assume-unchanged subName`,
but I believe that it does not get committed and besides also does not
seem to have a way to `git add -f`.
---
Note: currently on git version 2.14.1, but looking through the
changelogs, did not see any changes since then that would enable this
workflow.
-Michael Scott-Nelson
Next: Stefan Beller
Message 1 of 3 in “git add --all does not respect submodule.<name>.ignore”
  1. Michael Scott-NelsonJan 30, 2018
  2. Stefan BellerJan 30, 2018
  3. Jacob KellerJan 30, 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.