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

Re: [PATCH 1/2] t5526: check for name/path collision in submodule fetch

From
Heiko Voigt <hvoigt@hvoigt.net>
Date
Oct 23, 2017, 14:16 UTC
Message-ID
<20171023141644.GC85043@book.hvoigt.net>
In-Reply-To
<20171019181109.27792-1-sbeller@google.com>
On Thu, Oct 19, 2017 at 11:11:08AM -0700, Stefan Beller wrote:
Show 52 quoted lines
> Signed-off-by: Stefan Beller <sbeller@google.com>
> ---
> 
> This is just to test the corner case we're discussing.
> Applies on top of origin/hv/fetch-moved-submodules-on-demand.
> 
> 
>  t/t5526-fetch-submodules.sh | 42 ++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 42 insertions(+)
> 
> diff --git a/t/t5526-fetch-submodules.sh b/t/t5526-fetch-submodules.sh
> index a552ad4ead..c82d519e06 100755
> --- a/t/t5526-fetch-submodules.sh
> +++ b/t/t5526-fetch-submodules.sh
> @@ -571,6 +571,7 @@ test_expect_success 'fetching submodule into a broken repository' '
>  '
>  
>  test_expect_success "fetch new commits when submodule got renamed" '
> +	test_when_finished "rm -rf downstream_rename" &&
>  	git clone . downstream_rename &&
>  	(
>  		cd downstream_rename &&
> @@ -605,4 +606,45 @@ test_expect_success "fetch new commits when submodule got renamed" '
>  	test_cmp expect actual
>  '
>  
> +test_expect_success "warn on submodule name/path clash, but new commits fetched in renamed" '
> +	test_when_finished "rm -rf downstream_rename" &&
> +	git clone . downstream_rename &&
> +	(
> +		cd downstream_rename &&
> +		git submodule update --init &&
> +# NEEDSWORK: we omitted --recursive for the submodule update here since
> +# that does not work. See test 7001 for mv "moving nested submodules"
> +# for details. Once that is fixed we should add the --recursive option
> +# here.
> +		git checkout -b rename &&
> +		git mv submodule submodule_renamed &&
> +		(
> +			cd submodule_renamed &&
> +			git checkout -b rename_sub &&
> +			echo a >a &&
> +			git add a &&
> +			git commit -ma &&
> +			git push origin rename_sub &&
> +			git rev-parse HEAD >../../expect
> +		) &&
> +		git add submodule_renamed &&
> +		git commit -m "update renamed submodule" &&
> +		# produce collision, note that we use no submodule command
> +		git clone ../submodule submodule &&
> +		git add submodule &&

A small note even though this is not meant for inclusion: This would break when I start working on teaching 'git add' to set default values in .gitmodules when available.

But I guess I will discover a few other places, when starting that, that will break in the tests anyway.

Cheers Heiko
Previous: Junio C HamanoNext: Stefan Beller
Message 21 of 24 in “implement fetching of moved submodules”
  1. 0/3 implement fetching of moved submodulesHeiko Voigt, Oct 16, 2017
  2. 1/3 fetch: add test to make sure we stay backwards compatibleHeiko Voigt, Oct 16, 2017
  3. Stefan BellerOct 17, 2017
  4. 3/3 submodule: simplify decision tree whether to or not to fetchHeiko Voigt, Oct 16, 2017
  5. Stefan BellerOct 17, 2017
  6. Junio C HamanoOct 18, 2017
  7. Brandon WilliamsOct 18, 2017
  8. Junio C HamanoOct 19, 2017
  9. Heiko VoigtOct 19, 2017
  10. Brandon WilliamsOct 19, 2017
  11. 2/3 implement fetching of moved submodulesHeiko Voigt, Oct 16, 2017
  12. Stefan BellerOct 17, 2017
  13. Junio C HamanoOct 18, 2017
  14. Stefan BellerOct 18, 2017
  15. Junio C HamanoOct 19, 2017
  16. 1/2 t5526: check for name/path collision in submodule fetchStefan Beller, Oct 19, 2017
  17. 2/2 fetch, push: keep separate lists of submodules and gitlinksStefan Beller, Oct 19, 2017
  18. Heiko VoigtOct 23, 2017
  19. Stefan BellerOct 23, 2017
  20. Junio C HamanoOct 24, 2017
  21. Heiko VoigtOct 23, 2017
  22. Stefan BellerOct 23, 2017
  23. Stefan BellerOct 19, 2017
  24. Junio C HamanoOct 17, 2017

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.