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

Re: [PATCH 00/14] Add submodule test harness

From
Jens Lehmann <jens.lehmann@web.de>
Date
Jul 12, 2014, 18:23 UTC
Message-ID
<53C17D16.80106@web.de>
In-Reply-To
<xmqqsim96ine.fsf@gitster.dls.corp.google.com>
Am 10.07.2014 22:52, schrieb Junio C Hamano:
Show 27 quoted lines
> Junio C Hamano <gitster@pobox.com> writes:
> 
>> Jens Lehmann <Jens.Lehmann@web.de> writes:
>>
>>> I agree, but this case is special. The test asserts that nobody
>>> added, modified or removed *anything* inside the .git directory.
>>> The reason for problem we are seeing here is that I have to
>>> remove the core.worktree setting when moving the git directory
>>> from .git/modules into the submodule work tree.
>>
>> Hmph.  Comparing the files with core.worktree removed sounds like a
>> workaround that knows too much about the implementation detail of
>> what is being tested.  I am just wondering if core.worktree will
>> stay forever be the only thing that is special, or there may come
>> other things (perhaps as a fallout of integrating things like Duy's
>> multiple-worktree stuff).
>>
>> But perhaps we cannot do better than this.
> 
> One thing we should be able to do (and must do) better is to
> validate that core.worktree in the relocated config file actually
> points at the right place.  Unsetting before comparing may let us
> compare the relocated one in .git/modules/$1/config with the one
> that is embedded in the working tree (hence no .git/config), but the
> way your "how about this?" patch does, we wouldn't catch a possible
> breakage to the relocation code to point core.worktree to a bogus
> location, I'm afraid.
Indeed.
> Perhaps squashing this to 7e8e5af9 instead?
Yes please, this is much better than my first attempt.
Show 39 quoted lines
>  t/lib-submodule-update.sh | 19 ++++++++++++-------
>  1 file changed, 12 insertions(+), 7 deletions(-)
> 
> diff --git a/t/lib-submodule-update.sh b/t/lib-submodule-update.sh
> index e441b98..fc1da84 100755
> --- a/t/lib-submodule-update.sh
> +++ b/t/lib-submodule-update.sh
> @@ -110,18 +110,23 @@ replace_gitfile_with_git_dir () {
>  }
>  
>  # Test that the .git directory in the submodule is unchanged (except for the
> -# core.worktree setting, which we temporarily restore). Call this function
> -# before test_submodule_content as the latter might write the index file
> -# leading to false positive index differences.
> +# core.worktree setting, which appears only in $GIT_DIR/modules/$1/config).
> +# Call this function before test_submodule_content as the latter might
> +# write the index file leading to false positive index differences.
>  test_git_directory_is_unchanged () {
>  	(
> -		cd "$1" &&
> -		git config core.worktree "../../../$1"
> +		cd ".git/modules/$1" &&
> +		# does core.worktree point at the right place?
> +		test "$(git config core.worktree)" = "../../../$1" &&
> +		# remove it temporarily before comparing, as
> +		# "$1/.git/config" lacks it...
> +		git config --unset core.worktree
>  	) &&
>  	diff -r ".git/modules/$1" "$1/.git" &&
>  	(
> -		cd "$1" &&
> -		GIT_WORK_TREE=. git config --unset core.worktree
> +		# ... and then restore.
> +		cd ".git/modules/$1" &&
> +		git config core.worktree "../../../$1"
>  	)
>  }
>  
> 
Previous: Junio C HamanoNext: Junio C Hamano
Message 54 of 65 in “Add submodule test harness”
  1. 00/14 Add submodule test harnessJens Lehmann, Jun 15, 2014
  2. 01/14 test-lib: add test_dir_is_empty()Jens Lehmann, Jun 15, 2014
  3. Junio C HamanoJun 16, 2014
  4. Jens LehmannJun 17, 2014
  5. 01/14 test-lib: add test_dir_is_empty()Jens Lehmann, Jun 19, 2014
  6. 02/14 submodules: Add the lib-submodule-update.sh test libraryJens Lehmann, Jun 15, 2014
  7. Junio C HamanoJun 16, 2014
  8. Jens LehmannJun 17, 2014
  9. Junio C HamanoJun 17, 2014
  10. Jens LehmannJun 17, 2014
  11. Junio C HamanoJun 17, 2014
  12. 02/14 submodules: Add the lib-submodule-update.sh test libraryJens Lehmann, Jun 19, 2014
  13. Junio C HamanoJun 20, 2014
  14. 02/14 submodules: Add the lib-submodule-update.sh test libraryJens Lehmann, Jul 1, 2014
  15. 03/14 checkout: call the new submodule update test frameworkJens Lehmann, Jun 15, 2014
  16. 04/14 apply: add t4137 for submodule updatesJens Lehmann, Jun 15, 2014
  17. 05/14 read-tree: add t1013 for submodule updatesJens Lehmann, Jun 15, 2014
  18. 06/14 reset: add t7112 for submodule updatesJens Lehmann, Jun 15, 2014
  19. 07/14 bisect: add t6041 for submodule updatesJens Lehmann, Jun 15, 2014
  20. 07/14 bisect: add t6041 for submodule updatesJens Lehmann, Jun 19, 2014
  21. 08/14 merge: add t7613 for submodule updatesJens Lehmann, Jun 15, 2014
  22. 09/14 rebase: add t3426 for submodule updatesJens Lehmann, Jun 15, 2014
  23. Eric SunshineJun 16, 2014
  24. Jens LehmannJun 17, 2014
  25. 09/14 rebase: add t3426 for submodule updatesJens Lehmann, Jun 19, 2014
  26. 10/14 pull: add t5572 for submodule updatesJens Lehmann, Jun 15, 2014
  27. 11/14 cherry-pick: add t3512 for submodule updatesJens Lehmann, Jun 15, 2014
  28. 12/14 am: add t4255 for submodule updatesJens Lehmann, Jun 15, 2014
  29. 13/14 stash: add t3906 for submodule updatesJens Lehmann, Jun 15, 2014
  30. 13/14 stash: add t3906 for submodule updatesJens Lehmann, Jun 19, 2014
  31. 14/14 revert: add t3513 for submodule updatesJens Lehmann, Jun 15, 2014
  32. 14/14 revert: add t3513 for submodule updatesJens Lehmann, Jun 19, 2014
  33. Torsten BögershausenJul 2, 2014
  34. Jens LehmannJul 2, 2014
  35. Torsten BögershausenJul 3, 2014
  36. Jens LehmannJul 3, 2014
  37. Junio C HamanoJul 7, 2014
  38. Torsten BögershausenJul 7, 2014
  39. Jens LehmannJul 8, 2014
  40. Ramsay JonesJul 8, 2014
  41. Ramsay JonesJul 8, 2014
  42. No fchmod() under msygit - Was: Re: [PATCH 00/14] Add submodule test harnessTorsten Bögershausen, Jul 9, 2014
  43. Eric WongJul 9, 2014
  44. Erik Faye-LundJul 14, 2014
  45. Nico WilliamsJul 14, 2014
  46. Nico WilliamsJul 14, 2014
  47. Karsten BleesJul 14, 2014
  48. Junio C HamanoJul 14, 2014
  49. Torsten BögershausenJul 9, 2014
  50. Junio C HamanoJul 9, 2014
  51. Jens LehmannJul 9, 2014
  52. Junio C HamanoJul 9, 2014
  53. Junio C HamanoJul 10, 2014
  54. Jens LehmannJul 12, 2014
  55. Junio C HamanoJul 14, 2014
  56. Jens LehmannJul 14, 2014
  57. Junio C HamanoJul 14, 2014
  58. Johannes SixtJul 9, 2014
  59. Junio C HamanoJul 9, 2014
  60. Eric WongJul 9, 2014
  61. Junio C HamanoJul 9, 2014
  62. No fchmd. was: Re: [PATCH 00/14] Add submodule test harnessTorsten Bögershausen, Jul 10, 2014
  63. Junio C HamanoJul 10, 2014
  64. Torsten BögershausenJul 10, 2014
  65. Junio C HamanoJul 10, 2014

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.