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

[PATCH 1/2] checkout: Add test for diff.ignoreSubmodules

From
Jens Lehmann <jens.lehmann@web.de>
Date
Aug 28, 2010, 14:49 UTC
Message-ID
<4C7921F5.1050701@web.de>
In-Reply-To
<4C7921BD.7030600@web.de>
While at it, document that checkout uses this flag too in the Documentation.
Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
---
 Documentation/config.txt      |    3 ++-
 t/t2013-checkout-submodule.sh |    7 +++++++
 2 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/Documentation/config.txt b/Documentation/config.txt
index 0510ac7..cda6721 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -829,7 +829,8 @@ diff.renames::
 diff.ignoreSubmodules::
 	Sets the default value of --ignore-submodules. Note that this
 	affects only 'git diff' Porcelain, and not lower level 'diff'
-	commands such as 'git diff-files'.
+	commands such as 'git diff-files'. 'git checkout' also honors
+	this setting when reporting uncommitted changes.

 diff.suppressBlankEmpty::
 	A boolean to inhibit the standard behavior of printing a space
diff --git a/t/t2013-checkout-submodule.sh b/t/t2013-checkout-submodule.sh
index fda3f0a..3beb0b3 100755
--- a/t/t2013-checkout-submodule.sh
+++ b/t/t2013-checkout-submodule.sh
@@ -39,4 +39,11 @@ test_expect_success '"checkout <submodule>" updates the index only' '
 	git diff-files --quiet
 '

+test_expect_success '"checkout <submodule>" honors diff.ignoreSubmodules' '
+	git config diff.ignoreSubmodules dirty &&
+	echo x> submodule/untracked &&
+	git checkout HEAD >actual 2>&1 &&
+	! test -s actual
+'
+
 test_done
-- 
1.7.2.2.515.g13860
Previous: Jens LehmannNext: Jens Lehmann
Message 6 of 7 in “checkout: respect diff.ignoreSubmodules setting”
  1. checkout: respect diff.ignoreSubmodules settingJohannes Schindelin, Aug 25, 2010
  2. Jens LehmannAug 25, 2010
  3. Junio C HamanoAug 25, 2010
  4. Jens LehmannAug 25, 2010
  5. 0/2 checkout: diff.ignoreSubmodules: Add test and honor per submodule settings tooJens Lehmann, Aug 28, 2010
  6. 1/2 checkout: Add test for diff.ignoreSubmodulesJens Lehmann, Aug 28, 2010
  7. 2/2 checkout: Use submodule.*.ignore settings from .git/config and .gitmodulesJens Lehmann, Aug 28, 2010

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.