git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Heiko Voigt <hvoigt@hvoigt.net>
To: Stefan Beller <sbeller@google.com>
Cc: gitster@pobox.com, Jens.Lehmann@web.de, bmwill@google.com,
	git@vger.kernel.org, jrnieder@gmail.com
Subject: Re: [PATCH 1/2] t5526: check for name/path collision in submodule fetch
Date: Mon, 23 Oct 2017 16:16:44 +0200	[thread overview]
Message-ID: <20171023141644.GC85043@book.hvoigt.net> (raw)
In-Reply-To: <20171019181109.27792-1-sbeller@google.com>

On Thu, Oct 19, 2017 at 11:11:08AM -0700, Stefan Beller wrote:
> 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

  parent reply	other threads:[~2017-10-23 14:16 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-16 13:56 [PATCH v4 0/3] implement fetching of moved submodules Heiko Voigt
2017-10-16 13:57 ` [PATCH v4 1/3] fetch: add test to make sure we stay backwards compatible Heiko Voigt
2017-10-17 17:56   ` Stefan Beller
2017-10-16 13:58 ` [PATCH v4 2/3] implement fetching of moved submodules Heiko Voigt
2017-10-17 17:47   ` Stefan Beller
2017-10-18  0:03     ` Junio C Hamano
2017-10-18 17:56       ` Stefan Beller
2017-10-19  0:35         ` Junio C Hamano
2017-10-19 18:11           ` [PATCH 1/2] t5526: check for name/path collision in submodule fetch Stefan Beller
2017-10-19 18:11             ` [PATCH 2/2] fetch, push: keep separate lists of submodules and gitlinks Stefan Beller
2017-10-23 14:12               ` Heiko Voigt
2017-10-23 18:05                 ` Stefan Beller
2017-10-24  0:54                 ` Junio C Hamano
2017-10-23 14:16             ` Heiko Voigt [this message]
2017-10-23 17:58               ` [PATCH 1/2] t5526: check for name/path collision in submodule fetch Stefan Beller
2017-10-19 23:34           ` [PATCH v4 2/3] implement fetching of moved submodules Stefan Beller
2017-10-16 13:59 ` [PATCH v4 3/3] submodule: simplify decision tree whether to or not to fetch Heiko Voigt
2017-10-17 18:22   ` Stefan Beller
2017-10-18  0:03     ` Junio C Hamano
2017-10-18 18:03   ` Brandon Williams
2017-10-19  0:36     ` Junio C Hamano
2017-10-19 15:38       ` Heiko Voigt
2017-10-19 19:16         ` Brandon Williams
2017-10-17  1:49 ` [PATCH v4 0/3] implement fetching of moved submodules Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171023141644.GC85043@book.hvoigt.net \
    --to=hvoigt@hvoigt.net \
    --cc=Jens.Lehmann@web.de \
    --cc=bmwill@google.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jrnieder@gmail.com \
    --cc=sbeller@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).