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

Re: [PATCH 2/3] submodule tests: replace cloning from . by "$(pwd)"

From
Johannes Sixt <j6t@kdbg.org>
Date
Oct 22, 2016, 07:09 UTC
Message-ID
<c6c5ce05-3511-a992-e079-316f0ce90ecd@kdbg.org>
In-Reply-To
<20161021235939.20792-3-sbeller@google.com>
Am 22.10.2016 um 01:59 schrieb Stefan Beller:
Show 21 quoted lines
> When adding a submodule via "git submodule add <relative url>",
> the relative url applies to the superprojects remote. When the
> superproject was cloned via "git clone . super", the remote url
> is ending with '/.'.
>
> The logic to construct the relative urls is not smart enough to
> detect that the ending /. is referring to the directory itself
> but rather treats it like any other relative path, i.e.
>
>     path/to/dir/. + ../relative/path/to/submodule
>
> would result in
>
>     path/to/dir/relative/path/to/submodule
>
> and not omit the "dir" as you may expect.
>
> As in a later patch we'll normalize the remote url before the
> computation of relative urls takes place, we need to first get our
> test suite in a shape with normalized urls only, which is why we should
> refrain from cloning from '.'

But you are removing a valid use case from the tests. Aren't you sweeping something under the rug with this patch?

Show 21 quoted lines
>
> Signed-off-by: Stefan Beller <sbeller@google.com>
> ---
>  t/t7064-wtstatus-pv2.sh      | 9 ++++++---
>  t/t7403-submodule-sync.sh    | 3 ++-
>  t/t7406-submodule-update.sh  | 6 ++++--
>  t/t7407-submodule-foreach.sh | 3 ++-
>  t/t7506-status-submodule.sh  | 3 ++-
>  5 files changed, 16 insertions(+), 8 deletions(-)
>
> diff --git a/t/t7064-wtstatus-pv2.sh b/t/t7064-wtstatus-pv2.sh
> index 3012a4d..95514bb 100755
> --- a/t/t7064-wtstatus-pv2.sh
> +++ b/t/t7064-wtstatus-pv2.sh
> @@ -330,7 +330,8 @@ test_expect_success 'verify UU (edit-edit) conflict' '
>  test_expect_success 'verify upstream fields in branch header' '
>  	git checkout master &&
>  	test_when_finished "rm -rf sub_repo" &&
> -	git clone . sub_repo &&
> +	git clone "$(pwd)" sub_repo &&
> +	git -C sub_repo config --unset remote.origin.url &&

Why is it necessary to remove this configuration? Is it because when it is present, the submodule does not construct its own reference? And if so, should it not be sufficient to only remove the configuration (without changing 'git clone' command), but move this patch after the patch that fixes the /. treatment?

>  	(
>  		## Confirm local master tracks remote master.
>  		cd sub_repo &&
...
Previous: Stefan BellerNext: Junio C Hamano
Message 5 of 11 in “Fix submodule url issues”
  1. 0/3 Fix submodule url issuesStefan Beller, Oct 21, 2016
  2. 1/3 t7506: fix diff order arguments in test_cmpStefan Beller, Oct 21, 2016
  3. 3/3 submodule--helper: normalize funny urlsStefan Beller, Oct 21, 2016
  4. 2/3 submodule tests: replace cloning from . by "$(pwd)"Stefan Beller, Oct 21, 2016
  5. Johannes SixtOct 22, 2016
  6. Junio C HamanoOct 22, 2016
  7. Stefan BellerOct 22, 2016
  8. Johannes SixtOct 23, 2016
  9. Junio C HamanoOct 24, 2016
  10. Stefan BellerOct 24, 2016
  11. Johannes SixtOct 24, 2016

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.