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

[1.8.0] Handle submodule config options consistently in diff plumbing

From
Jens Lehmann <jens.lehmann@web.de>
Date
Feb 1, 2011, 21:41 UTC
Message-ID
<4D487DF7.8060109@web.de>
In-Reply-To
<7vwrll57ha.fsf@alter.siamese.dyndns.org>
Proposal:

Handle the submodule options "diff.ignoreSubmodules" and "submodule.<name>.ignore" consistently in diff plumbing.

I see two basic ways to change the behavior of the plumbing diff commands:

a) Let them use the "diff.ignoreSubmodules" configuration too.
b) Don't let them use the "submodule.<name>.ignore" entries either.
   But if we go that way, we might have to revert the default of
   recursing into populated submodules too, as it might cause
   unexpected behavior when all configuration options introduced
   to control that recursion are just ignored unless explicitly
   told otherwise.
History:

When the submodule recursion for the diff commands was introduced, all diff commands - including plumbing - learned to recurse into submodules by default. This was done to mark submodules with uncommitted changes as dirty so no user could accidentally forget to commit his changes there before pushing in the superproject.

Some time after that "--ignore-submodules" learned some values to achieve more control over what conditions mark a submodule dirty. Then the "submodule.<name>.ignore" option was added to .git/config and the .gitmodules file to to be able to specify these values for one or more submodules. In a later commit the "diff.ignoreSubmodules" option was added, but the plumbing diff commands weren't taught to use that config option.

Risks:
a) Those scripts which depend on the plumbing commands to ignore
   the setting from "diff.ignoreSubmodules" will break.
b) All scripts written or changed since 1.7.0 which depend on the
   current behavior to recurse into submodules and use the
   "submodule.<name>.ignore" entries will be broken.

Me thinks the risks are much smaller when doing a), as people who learned to use the recursive behavior since 1.7.0 will see that changed under their feet when we do b) and I expect much more code to rely on the recursion than on the "diff.ignoreSubmodules" setting. And doing a) would fix a real life problem too, see [1].

Migration plan:
a) During the 1.7.x series a new "noconfig" value is added for the
   "--ignore-submodules" command line option for people who don't
   want user configuration to interfere with the recursion, e.g. in
   scripts (turning off the recursion is already implemented, just
   use the "--ignore-submodules" option). And then starting with
   1.8.0 "diff.ignoreSubmodules" will be used by diff plumbing.
b) During the 1.7.x series a new value for "--ignore-submodules"
   called "porcelain" is added which enables recursion and also
   tells diff plumbing use all configuration settings. Then all
   relevant call sites (like git gui, gitk and PS1 from completion
   and others) are changed to use this option. Changing the default
   behavior to ignore "submodule.<name>.ignore" and to not recurse
   anymore will be done in the 1.8.0 release.

Personally I'm in favor of solution a), but lets hear what other people say.

[1] http://thread.gmane.org/gmane.comp.version-control.git/164166/focus=164172
Previous: Junio C HamanoNext: Jakub Narebski
Message 102 of 126 in “What's cooking in git.git (Jan 2011, #06; Sun, 30)”
  1. Junio C HamanoJan 31, 2011
  2. Sverre RabbelierJan 31, 2011
  3. Sverre RabbelierFeb 8, 2011
  4. Junio C HamanoFeb 8, 2011
  5. Planning for 1.7.5 and 1.8.0Junio C Hamano, Jan 31, 2011
  6. [1.8.0] default "git merge" without argument to "git merge @{u}"Junio C Hamano, Jan 31, 2011
  7. Jeff KingJan 31, 2011
  8. Junio C HamanoJan 31, 2011
  9. Felipe ContrerasJan 31, 2011
  10. [1.8.0] (v2) default "git merge" without argument to "git merge @{u}"Junio C Hamano, Jan 31, 2011
  11. Jeff KingJan 31, 2011
  12. Thomas AdamFeb 1, 2011
  13. Scott ChaconFeb 1, 2011
  14. moving to a git-backed wikiJeff King, Feb 1, 2011
  15. Jay SoffianFeb 1, 2011
  16. J.H.Feb 1, 2011
  17. Vincent HanquezFeb 2, 2011
  18. Felipe ContrerasFeb 2, 2011
  19. Jakub NarebskiFeb 2, 2011
  20. J.H.Feb 3, 2011
  21. Jeff KingFeb 3, 2011
  22. Sverre RabbelierFeb 3, 2011
  23. Jeff KingFeb 4, 2011
  24. Felipe ContrerasFeb 3, 2011
  25. Jeff KingFeb 4, 2011
  26. Felipe ContrerasFeb 4, 2011
  27. Joey HessFeb 4, 2011
  28. david@lang.hmFeb 5, 2011
  29. Thomas HochsteinFeb 4, 2011
  30. Add support for merging from upstream by default.Jared Hance, Feb 4, 2011
  31. [1.8.0] Unify "pathspec" semanticsJunio C Hamano, Jan 31, 2011
  32. Nguyen Thai Ngoc DuyFeb 1, 2011
  33. [1.8.0] reorganize the mess that the source tree has becomeNicolas Pitre, Jan 31, 2011
  34. Junio C HamanoJan 31, 2011
  35. Matthieu MoyJan 31, 2011
  36. Nicolas PitreJan 31, 2011
  37. Nicolas PitreJan 31, 2011
  38. Jeff KingJan 31, 2011
  39. Nicolas PitreJan 31, 2011
  40. Junio C HamanoJan 31, 2011
  41. João P. SampaioJan 31, 2011
  42. Nicolas PitreJan 31, 2011
  43. Jeff KingJan 31, 2011
  44. Nicolas PitreFeb 1, 2011
  45. Jeff KingFeb 1, 2011
  46. Nicolas PitreFeb 1, 2011
  47. Thomas RastFeb 1, 2011
  48. Jonathan NiederFeb 1, 2011
  49. Jonathan NiederFeb 1, 2011
  50. Nicolas PitreFeb 1, 2011
  51. Nguyen Thai Ngoc DuyFeb 1, 2011
  52. Junio C HamanoFeb 1, 2011
  53. Erik Faye-LundFeb 1, 2011
  54. Jeff KingFeb 1, 2011
  55. Sverre RabbelierFeb 1, 2011
  56. Jeff KingFeb 1, 2011
  57. Jay SoffianFeb 1, 2011
  58. Andreas EricssonFeb 1, 2011
  59. Jakub NarebskiJan 31, 2011
  60. Nicolas PitreJan 31, 2011
  61. Alex BudovskiFeb 1, 2011
  62. Nicolas PitreFeb 1, 2011
  63. Jakub NarebskiFeb 1, 2011
  64. Junio C HamanoFeb 1, 2011
  65. Sam VilainFeb 2, 2011
  66. [1.8.0] split largest remaining scripts, gitk and gitwebJakub Narebski, Feb 1, 2011
  67. Junio C HamanoFeb 1, 2011
  68. Jakub NarebskiFeb 1, 2011
  69. Martin von ZweigbergkFeb 5, 2011
  70. [1.8.0] make two-argument fetch update remote branchesThomas Rast, Jan 31, 2011
  71. Matthieu MoyJan 31, 2011
  72. Junio C HamanoJan 31, 2011
  73. Eugene SajineJan 31, 2011
  74. Junio C HamanoJan 31, 2011
  75. Eugene SajineJan 31, 2011
  76. Junio C HamanoFeb 1, 2011
  77. Jeff KingJan 31, 2011
  78. Jay SoffianFeb 1, 2011
  79. Nguyen Thai Ngoc DuyFeb 1, 2011
  80. Junio C HamanoFeb 1, 2011
  81. A Large Angry SCMFeb 1, 2011
  82. Thomas RastFeb 1, 2011
  83. A Large Angry SCMFeb 1, 2011
  84. [1.8.0] forbid full fetchspecs in git-pullThomas Rast, Jan 31, 2011
  85. Junio C HamanoJan 31, 2011
  86. Dmitry PotapovJan 31, 2011
  87. Thomas RastFeb 1, 2011
  88. Dmitry PotapovFeb 1, 2011
  89. Nguyen Thai Ngoc DuyFeb 1, 2011
  90. Nicolas PitreFeb 1, 2011
  91. [1.8.0] Tag namespacesMarc Branchaud, Feb 1, 2011
  92. Nguyen Thai Ngoc DuyFeb 1, 2011
  93. [1.8.0] Remove deprecated commandsRené Scharfe, Feb 1, 2011
  94. Junio C HamanoFeb 1, 2011
  95. Jonathan NiederFeb 2, 2011
  96. René ScharfeFeb 10, 2011
  97. Jonathan NiederFeb 10, 2011
  98. Junio C HamanoFeb 10, 2011
  99. René ScharfeFeb 12, 2011
  100. Jonathan NiederFeb 12, 2011
  101. Junio C HamanoFeb 13, 2011
  102. [1.8.0] Handle submodule config options consistently in diff plumbingJens Lehmann, Feb 1, 2011
  103. [1.8.0] Tracking empty directoriesJakub Narebski, Feb 2, 2011
  104. Jay SoffianFeb 2, 2011
  105. David AguilarFeb 2, 2011
  106. Jakub NarebskiFeb 2, 2011
  107. Wesley J. LandakerFeb 3, 2011
  108. Jonathan NiederFeb 3, 2011
  109. Matthieu MoyFeb 3, 2011
  110. Pete HarlanFeb 5, 2011
  111. Thomas KochFeb 5, 2011
  112. Sverre RabbelierFeb 5, 2011
  113. Jared HanceFeb 5, 2011
  114. Junio C HamanoFeb 6, 2011
  115. Sverre RabbelierFeb 6, 2011
  116. Nguyen Thai Ngoc DuyFeb 6, 2011
  117. [1.8.0] git-stash invocation changesThomas Rast, Feb 2, 2011
  118. Shawn PearceFeb 2, 2011
  119. Matthieu MoyFeb 2, 2011
  120. Thomas RastFeb 2, 2011
  121. Pat NotzFeb 9, 2011
  122. [1.8.0] Don't copy "submodule.<name>.update" to .git/config on submodule initJens Lehmann, Feb 23, 2011
  123. Junio C HamanoFeb 23, 2011
  124. Jens LehmannFeb 23, 2011
  125. Junio C HamanoFeb 24, 2011
  126. Jens LehmannFeb 24, 2011

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.