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

sb/submodule-move-nested breaks t7411 under GIT_FSMONITOR_TEST

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
May 25, 2018, 12:28 UTC
Message-ID
<87lgc77wc7.fsf@evledraar.gmail.com>
In-Reply-To
<xmqqvabm6csb.fsf@gitster-ct.c.googlers.com>
On Thu, May 17 2018, Junio C Hamano wrote:
Show 12 quoted lines
> * sb/submodule-move-nested (2018-03-29) 6 commits
>   (merged to 'next' on 2018-04-25 at 86b177433a)
>  + submodule: fixup nested submodules after moving the submodule
>  + submodule-config: remove submodule_from_cache
>  + submodule-config: add repository argument to submodule_from_{name, path}
>  + submodule-config: allow submodule_free to handle arbitrary repositories
>  + grep: remove "repo" arg from non-supporting funcs
>  + submodule.h: drop declaration of connect_work_tree_and_git_dir
>
>  Moving a submodule that itself has submodule in it with "git mv"
>  forgot to make necessary adjustment to the nested sub-submodules;
>  now the codepath learned to recurse into the submodules.

I didn't spot this earlier because I don't test this a lot, but I've bisected the following breakage down to da62f786d2 ("submodule: fixup nested submodules after moving the submodule", 2018-03-28) (and manually confirmed by reverting). On Linux both Debian & CentOS I get tests 3 and 4 failing with:

     GIT_FSMONITOR_TEST=$PWD/t7519/fsmonitor-all ./t7411-submodule-config.sh
-v -x output follows:
expecting success: 
	mkdir submodule &&
	(cd submodule &&
		git init &&
		echo a >a &&
		git add . &&
		git commit -ma
	) &&
	mkdir super &&
	(cd super &&
		git init &&
		git submodule add ../submodule &&
		git submodule add ../submodule a &&
		git commit -m "add as submodule and as a" &&
		git mv a b &&
		git commit -m "move a to b"
	)
+ mkdir submodule
+ cd submodule
+ git init
Initialized empty Git repository in /home/avar/g/git/t/trash directory.t7411-submodule-config/submodule/.git/
+ echo a
+ git add .
+ git commit -ma
[master (root-commit) 27e9f0e] a
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 a
+ mkdir super
+ cd super
+ git init
Initialized empty Git repository in /home/avar/g/git/t/trash directory.t7411-submodule-config/super/.git/
+ git submodule add ../submodule
Cloning into '/home/avar/g/git/t/trash directory.t7411-submodule-config/super/submodule'...
done.
+ git submodule add ../submodule a
Cloning into '/home/avar/g/git/t/trash directory.t7411-submodule-config/super/a'...
done.
+ git commit -m add as submodule and as a
[master (root-commit) 5a1dac1] add as submodule and as a
 Author: A U Thor <author@example.com>
 3 files changed, 8 insertions(+)
 create mode 100644 .gitmodules
 create mode 160000 a
 create mode 160000 submodule
+ git mv a b
+ git commit -m move a to b
[master ab1e9c7] move a to b
 Author: A U Thor <author@example.com>
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename a => b (100%)
ok 1 - submodule config cache setup
expecting success: 
	test_when_finished "rm -rf repo" &&
	test_create_repo repo &&
	cat >repo/.gitmodules <<-\EOF &&
	[submodule "s"]
		path
		ignore
	EOF
	(
		cd repo &&
		test_must_fail test-submodule-config "" s 2>actual &&
		test_i18ngrep "bad config" actual
	)
+ test_when_finished rm -rf repo
+ test 0 = 0
+ test_cleanup={ rm -rf repo
		} && (exit "$eval_ret"); eval_ret=$?; :
+ test_create_repo repo
+ test 1 = 1
+ repo=repo
+ mkdir -p repo
+ cd repo
+ /home/avar/g/git/t/../git-init --template=/home/avar/g/git/t/../templates/blt/
Initialized empty Git repository in /home/avar/g/git/t/trash directory.t7411-submodule-config/repo/.git/
+ mv .git/hooks .git/hooks-disabled
+ cat
+ cd repo
+ test_must_fail test-submodule-config  s
+ test_i18ngrep bad config actual
+ test -n 
+ test x! = xbad config
+ grep bad config actual
fatal: bad config line 2 in file /home/avar/g/git/t/trash directory.t7411-submodule-config/repo/.gitmodules
+ rm -rf repo
+ exit 0
+ eval_ret=0
+ :
ok 2 - configuration parsing with error
expecting success: 
	(cd super &&
		test-submodule-config \
			HEAD^ a \
			HEAD b \
			HEAD^ submodule \
			HEAD submodule \
				>actual &&
		test_cmp expect actual
	)
+ cd super
+ test-submodule-config HEAD^ a HEAD b HEAD^ submodule HEAD submodule
warning: ab1e9c76c1e6a15df51b20e75552ec5ad00708ac:.gitmodules, multiple configurations found for 'submodule.submodule.path'. Skipping second one!
warning: ab1e9c76c1e6a15df51b20e75552ec5ad00708ac:.gitmodules, multiple configurations found for 'submodule.submodule.url'. Skipping second one!
warning: ab1e9c76c1e6a15df51b20e75552ec5ad00708ac:.gitmodules, multiple configurations found for 'submodule.a.path'. Skipping second one!
warning: ab1e9c76c1e6a15df51b20e75552ec5ad00708ac:.gitmodules, multiple configurations found for 'submodule.a.url'. Skipping second one!
Submodule not found.
Usage: /home/avar/g/git/t/helper/test-submodule-config [<commit> <submodulepath>] ...
error: last command exited with $?=1
not ok 3 - test parsing and lookup of submodule config by path
#	
#		(cd super &&
#			test-submodule-config \
#				HEAD^ a \
#				HEAD b \
#				HEAD^ submodule \
#				HEAD submodule \
#					>actual &&
#			test_cmp expect actual
#		)
#	
expecting success: 
	(cd super &&
		test-submodule-config --name \
			HEAD^ a \
			HEAD a \
			HEAD^ submodule \
			HEAD submodule \
				>actual &&
		test_cmp expect actual
	)
+ cd super
+ test-submodule-config --name HEAD^ a HEAD a HEAD^ submodule HEAD submodule
+ test_cmp expect actual
+ diff -u expect actual
--- expect	2018-05-25 12:28:30.000000000 +0000
+++ actual	2018-05-25 12:28:30.000000000 +0000
@@ -1,4 +1,4 @@
 Submodule name: 'a' for path 'a'
-Submodule name: 'a' for path 'b'
+Submodule name: 'a' for path 'a'
 Submodule name: 'submodule' for path 'submodule'
 Submodule name: 'submodule' for path 'submodule'
error: last command exited with $?=1
not ok 4 - test parsing and lookup of submodule config by name
#	
#		(cd super &&
#			test-submodule-config --name \
#				HEAD^ a \
#				HEAD a \
#				HEAD^ submodule \
#				HEAD submodule \
#					>actual &&
#			test_cmp expect actual
#		)
#	

expecting success: 
	(cd super &&
		cp .gitmodules .gitmodules.bak &&
		echo "	value = \"" >>.gitmodules &&
		git add .gitmodules &&
		mv .gitmodules.bak .gitmodules &&
		git commit -m "add error" &&
		test-submodule-config \
			HEAD b \
			HEAD submodule \
				>actual &&
		test_cmp expect_error actual
	)

+ cd super
+ cp .gitmodules .gitmodules.bak
+ echo 	value = "
+ git add .gitmodules
+ mv .gitmodules.bak .gitmodules
+ git commit -m add error
[master 7cb6f0e] add error
 Author: A U Thor <author@example.com>
 1 file changed, 2 insertions(+), 1 deletion(-)
+ test-submodule-config HEAD b HEAD submodule
error: bad config line 7 in submodule-blob 7cb6f0e38e67568f41da9828cc7d5eb1c753b7b4:.gitmodules
+ test_cmp expect_error actual
+ diff -u expect_error actual
ok 5 - error in one submodule config lets continue

expecting success: 
	(cd super &&
		sha1=$(git rev-parse HEAD) &&
		test-submodule-config \
			HEAD b \
			HEAD submodule \
				2>actual_err &&
		test_i18ngrep "submodule-blob $sha1:.gitmodules" actual_err >/dev/null
	)

+ cd super
+ git rev-parse HEAD
+ sha1=7cb6f0e38e67568f41da9828cc7d5eb1c753b7b4
+ test-submodule-config HEAD b HEAD submodule
Submodule name: 'a' for path 'b'
Submodule name: 'submodule' for path 'submodule'
+ test_i18ngrep submodule-blob 7cb6f0e38e67568f41da9828cc7d5eb1c753b7b4:.gitmodules actual_err
+ test -n 
+ test x! = xsubmodule-blob 7cb6f0e38e67568f41da9828cc7d5eb1c753b7b4:.gitmodules
+ grep submodule-blob 7cb6f0e38e67568f41da9828cc7d5eb1c753b7b4:.gitmodules actual_err
ok 6 - error message contains blob reference

expecting success: 
	(
		cd super &&
		git tag new_tag &&
		tree=$(git rev-parse HEAD^{tree}) &&
		commit=$(git rev-parse HEAD^{commit}) &&
		test-submodule-config $commit b >expect &&
		test-submodule-config $tree b >actual.1 &&
		test-submodule-config new_tag b >actual.2 &&
		test_cmp expect actual.1 &&
		test_cmp expect actual.2
	)

+ cd super
+ git tag new_tag
+ git rev-parse HEAD^{tree}
+ tree=934687743cd5ca685cfa8d3c77aaebb75ee12e1f
+ git rev-parse HEAD^{commit}
+ commit=7cb6f0e38e67568f41da9828cc7d5eb1c753b7b4
+ test-submodule-config 7cb6f0e38e67568f41da9828cc7d5eb1c753b7b4 b
error: bad config line 7 in submodule-blob 7cb6f0e38e67568f41da9828cc7d5eb1c753b7b4:.gitmodules
+ test-submodule-config 934687743cd5ca685cfa8d3c77aaebb75ee12e1f b
error: bad config line 7 in submodule-blob 934687743cd5ca685cfa8d3c77aaebb75ee12e1f:.gitmodules
+ test-submodule-config new_tag b
error: bad config line 7 in submodule-blob 7cb6f0e38e67568f41da9828cc7d5eb1c753b7b4:.gitmodules
+ test_cmp expect actual.1
+ diff -u expect actual.1
+ test_cmp expect actual.2
+ diff -u expect actual.2
ok 7 - using different treeishs works

expecting success: 
	(cd super &&
		git config -f .gitmodules \
			submodule.submodule.fetchrecursesubmodules blabla &&
		git add .gitmodules &&
		git config --unset -f .gitmodules \
			submodule.submodule.fetchrecursesubmodules &&
		git commit -m "add error in fetchrecursesubmodules" &&
		test-submodule-config \
			HEAD b \
			HEAD submodule \
				>actual &&
		test_cmp expect_error actual  &&
		git reset --hard HEAD^
	)

+ cd super
+ git config -f .gitmodules submodule.submodule.fetchrecursesubmodules blabla
+ git add .gitmodules
+ git config --unset -f .gitmodules submodule.submodule.fetchrecursesubmodules
+ git commit -m add error in fetchrecursesubmodules
[master 1fa1547] add error in fetchrecursesubmodules
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
+ test-submodule-config HEAD b HEAD submodule
+ test_cmp expect_error actual
+ diff -u expect_error actual
+ git reset --hard HEAD^
HEAD is now at 7cb6f0e add error
ok 8 - error in history in fetchrecursesubmodule lets continue

# failed 2 among 8 test(s)
1..8
Previous: Stefan BellerNext: Stefan Beller
Message 84 of 95 in “What's cooking in git.git (May 2018, #02; Thu, 17)”
  1. Junio C HamanoMay 17, 2018
  2. jk/branch-l-0-deprecation (was Re: What's cooking in git.git (May 2018, #02; Thu, 17))Kaartic Sivaraam, May 17, 2018
  3. Ævar Arnfjörð BjarmasonMay 17, 2018
  4. Kaartic SivaraamMay 17, 2018
  5. Ævar Arnfjörð BjarmasonMay 17, 2018
  6. Jeff KingMay 17, 2018
  7. jk/branch-l-0-deprecation (was Re: What's cooking in git.git (May 2018, #02; Thu, 17))Kaartic Sivaraam, May 24, 2018
  8. Jeff KingMay 24, 2018
  9. branch: issue "-l" deprecation warning after pager startsJeff King, May 24, 2018
  10. Junio C HamanoMay 25, 2018
  11. Jeff KingMay 25, 2018
  12. Junio C HamanoMay 25, 2018
  13. Junio C HamanoMay 25, 2018
  14. Jeff KingMay 25, 2018
  15. Junio C HamanoMay 26, 2018
  16. 0/3 usage: prefix all lines in `vreportf()`, not just the firstMartin Ågren, May 25, 2018
  17. 1/3 usage: extract `prefix_suffix_lines()` from `advise()`Martin Ågren, May 25, 2018
  18. Junio C HamanoMay 28, 2018
  19. Duy NguyenMay 28, 2018
  20. Jeff KingMay 29, 2018
  21. Jeff KingMay 29, 2018
  22. Junio C HamanoMay 30, 2018
  23. Junio C HamanoMay 30, 2018
  24. Martin ÅgrenMay 30, 2018
  25. Jeff KingMay 31, 2018
  26. 2/3 usage: prefix all lines in `vreportf()`, not just the firstMartin Ågren, May 25, 2018
  27. Junio C HamanoMay 28, 2018
  28. Duy NguyenMay 28, 2018
  29. Junio C HamanoMay 28, 2018
  30. Martin ÅgrenMay 29, 2018
  31. Junio C HamanoMay 29, 2018
  32. Martin ÅgrenMay 29, 2018
  33. Junio C HamanoMay 29, 2018
  34. Duy NguyenMay 29, 2018
  35. Martin ÅgrenMay 30, 2018
  36. Jeff KingMay 29, 2018
  37. Martin ÅgrenMay 30, 2018
  38. 3/3 usage: translate the "error: "-prefix and othersMartin Ågren, May 25, 2018
  39. Junio C HamanoMay 26, 2018
  40. Junio C HamanoMay 26, 2018
  41. Jeff KingMay 29, 2018
  42. Jeff KingMay 29, 2018
  43. Junio C HamanoMay 30, 2018
  44. Jeff KingMay 31, 2018
  45. Kaartic SivaraamMay 26, 2018
  46. Duy NguyenJun 2, 2018
  47. Jeff KingJun 2, 2018
  48. Kaartic SivaraamMay 26, 2018
  49. Jeff KingMay 29, 2018
  50. Junio C HamanoMay 30, 2018
  51. Jeff KingMay 31, 2018
  52. Junio C HamanoJun 1, 2018
  53. Kaartic.SivaraamMay 31, 2018
  54. Derrick StoleeMay 17, 2018
  55. Stefan BellerMay 17, 2018
  56. 0/2 Reroll 2 last commits of sb/object-store-replaceStefan Beller, May 17, 2018
  57. 1/2 object.c: free replace map in raw_object_store_clearStefan Beller, May 17, 2018
  58. 2/2 replace-object.c: remove the_repository from prepare_replace_objectStefan Beller, May 17, 2018
  59. merge-recursive: give notice when submodule commit gets fast-forwardedStefan Beller, May 17, 2018
  60. 0/1 rebased: inform about auto submodule ffLeif Middelschulte, May 18, 2018
  61. 0/1 rebased: inform about auto submodule ffLeif Middelschulte, May 18, 2018
  62. 1/1 Inform about fast-forwarding of submodules during mergeLeif Middelschulte, May 18, 2018
  63. Elijah NewrenMay 18, 2018
  64. Junio C HamanoMay 21, 2018
  65. 0/8 Reroll of sb/diff-color-move-moreStefan Beller, May 17, 2018
  66. 1/8 xdiff/xdiff.h: remove unused flagsStefan Beller, May 17, 2018
  67. 2/8 xdiff/xdiffi.c: remove unneeded function declarationsStefan Beller, May 17, 2018
  68. 4/8 diff.c: adjust hash function signature to match hashmap expectationStefan Beller, May 17, 2018
  69. 5/8 diff.c: add a blocks mode for moved code detectionStefan Beller, May 17, 2018
  70. 7/8 diff.c: add --color-moved-ignore-space-delta optionStefan Beller, May 17, 2018
  71. 8/8 diff: color-moved white space handling options imply color-movedStefan Beller, May 17, 2018
  72. 3/8 diff.c: do not pass diff options as keydata to hashmapStefan Beller, May 17, 2018
  73. 6/8 diff.c: decouple white space treatment from move detection algorithmStefan Beller, May 17, 2018
  74. Simon RuderichMay 18, 2018
  75. Stefan BellerMay 18, 2018
  76. Jonathan TanMay 17, 2018
  77. Jacob KellerJun 7, 2018
  78. Junio C HamanoMay 17, 2018
  79. Stefan BellerMay 17, 2018
  80. Junio C HamanoMay 17, 2018
  81. Stefan BellerMay 17, 2018
  82. brian m. carlsonMay 21, 2018
  83. Stefan BellerMay 21, 2018
  84. sb/submodule-move-nested breaks t7411 under GIT_FSMONITOR_TESTÆvar Arnfjörð Bjarmason, May 25, 2018
  85. Stefan BellerMay 25, 2018
  86. Stefan BellerMay 25, 2018
  87. Ævar Arnfjörð BjarmasonSep 6, 2018
  88. Stefan BellerSep 6, 2018
  89. Ben PeartSep 6, 2018
  90. Stefan BellerSep 6, 2018
  91. git-mv: allow submodules and fsmonitor to work togetherStefan Beller, Sep 6, 2018
  92. Ben PeartSep 10, 2018
  93. git-mv: allow submodules and fsmonitor to work togetherBen Peart, Sep 10, 2018
  94. Stefan BellerSep 10, 2018
  95. Ben PeartSep 10, 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.