git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Stefan Beller <sbeller@google.com>
To: Johannes Sixt <j6t@kdbg.org>
Cc: "git@vger.kernel.org" <git@vger.kernel.org>,
	Junio C Hamano <gitster@pobox.com>,
	Jonathan Nieder <jrnieder@gmail.com>,
	Jens Lehmann <Jens.Lehmann@web.de>
Subject: Re: [PATCH 1/2] submodule: port resolve_relative_url from shell to C
Date: Wed, 2 Mar 2016 09:34:12 -0800	[thread overview]
Message-ID: <CAGZ79kZBXEnXdH1Zm0jg61Gianm6WesAgaf2WA57C63hwOafww@mail.gmail.com> (raw)
In-Reply-To: <56D7210D.8050708@kdbg.org>

On Wed, Mar 2, 2016 at 9:21 AM, Johannes Sixt <j6t@kdbg.org> wrote:
> Am 13.02.2016 um 00:39 schrieb Stefan Beller:
>> @@ -289,4 +296,39 @@ test_git_path GIT_COMMON_DIR=bar config                   bar/config
>>   test_git_path GIT_COMMON_DIR=bar packed-refs              bar/packed-refs
>>   test_git_path GIT_COMMON_DIR=bar shallow                  bar/shallow
>>
>> +test_submodule_relative_url "(null)" "../foo/bar" "../sub/a/b/c" "../foo/sub/a/b/c"
>> +test_submodule_relative_url "../../../" "../foo/bar" "../sub/a/b/c" "../../../../foo/sub/a/b/c"
>> +test_submodule_relative_url "(null)" "../foo/bar" "../submodule" "../foo/submodule"
>> +test_submodule_relative_url "../" "../foo/bar" "../submodule" "../../foo/submodule"
>> +test_submodule_relative_url "(null)" "../foo/submodule" "../submodule" "../foo/submodule"
>> +test_submodule_relative_url "../" "../foo/submodule" "../submodule" "../../foo/submodule"
>> +test_submodule_relative_url "(null)" "../foo" "../submodule" "../submodule"
>> +test_submodule_relative_url "../" "../foo" "../submodule" "../../submodule"
>> +test_submodule_relative_url "(null)" "./foo/bar" "../submodule" "foo/submodule"
>> +test_submodule_relative_url "../" "./foo/bar" "../submodule" "../foo/submodule"
>> +test_submodule_relative_url "(null)" "./foo" "../submodule" "submodule"
>> +test_submodule_relative_url "../" "./foo" "../submodule" "../submodule"
>> +test_submodule_relative_url "(null)" "//somewhere else/repo" "../subrepo" "//somewhere else/subrepo"
>> +test_submodule_relative_url "(null)" "/u//trash directory.t7406-submodule-update/subsuper_update_r" "../subsubsuper_update_r" "/u//trash directory.t7406-submodule-update/subsubsuper_update_r"
>> +test_submodule_relative_url "(null)" "/u//trash directory.t7406-submodule-update/super_update_r2" "../subsuper_update_r" "/u//trash directory.t7406-submodule-update/subsuper_update_r"
>> +test_submodule_relative_url "(null)" "/u/trash directory.t3600-rm/." "../." "/u/trash directory.t3600-rm/."
>> +test_submodule_relative_url "(null)" "/u/trash directory.t3600-rm" "./." "/u/trash directory.t3600-rm/."
>> +test_submodule_relative_url "(null)" "/u/trash directory.t7400-submodule-basic/addtest" "../repo" "/u/trash directory.t7400-submodule-basic/repo"
>> +test_submodule_relative_url "../" "/u/trash directory.t7400-submodule-basic/addtest" "../repo" "/u/trash directory.t7400-submodule-basic/repo"
>> +test_submodule_relative_url "(null)" "/u/trash directory.t7400-submodule-basic" "./å äö" "/u/trash directory.t7400-submodule-basic/å äö"
>> +test_submodule_relative_url "(null)" "/u/trash directory.t7403-submodule-sync/." "../submodule" "/u/trash directory.t7403-submodule-sync/submodule"
>> +test_submodule_relative_url "(null)" "/u/trash directory.t7407-submodule-foreach/submodule" "../submodule" "/u/trash directory.t7407-submodule-foreach/submodule"
>> +test_submodule_relative_url "(null)" "/u/trash directory.t7409-submodule-detached-worktree/home2/../remote" "../bundle1" "/u/trash directory.t7409-submodule-detached-worktree/home2/../bundle1"
>> +test_submodule_relative_url "(null)" "/u/trash directory.t7613-merge-submodule/submodule_update_repo" "./." "/u/trash directory.t7613-merge-submodule/submodule_update_repo/."
>
> The tests with absolute paths all fail on Windows. The reason is that
> git.exe sees mangled paths and 'git submodule--helper
> resolve-relative-url-test' produces mangled paths (that begins with a
> drive letter), whereas the test script expects POSIX paths. The pattern
> I currently use to fix this is
>
> test_submodule_relative_url "(null)" "$PWD/addtest" "../repo" "$(pwd)/repo"
>
> (In our test scripts, $PWD is a POSIX style path and $(pwd) is a
> Windows style path).
>
> With this change, the penultimate case above still fails because the
> 'home2/..' gets lost somewhere in the actual output, which I still have
> to debug.
>
> The two cases beginning with '/u//' cannot be tested on Windows.
> Are they important? Are the doubled slashes intentional?

The way I got the test cases is by inserting a debug printf into the
shell script
and then running the test suite (as that ought to work correct and
cover everything).

And the double slash is intentional, somewhere in the test suite we have a case
where that occurs. It may be a calling error?

Thanks for looking into this on the Windows side :)

Thanks,
Stefan

>
>> +test_submodule_relative_url "(null)" "file:///tmp/repo" "../subrepo" "file:///tmp/subrepo"
>> +test_submodule_relative_url "(null)" "foo/bar" "../submodule" "foo/submodule"
>> +test_submodule_relative_url "../" "foo/bar" "../submodule" "../foo/submodule"
>> +test_submodule_relative_url "(null)" "foo" "../submodule" "submodule"
>> +test_submodule_relative_url "../" "foo" "../submodule" "../submodule"
>> +test_submodule_relative_url "(null)" "helper:://hostname/repo" "../subrepo" "helper:://hostname/subrepo"
>> +test_submodule_relative_url "(null)" "ssh://hostname/repo" "../subrepo" "ssh://hostname/subrepo"
>> +test_submodule_relative_url "(null)" "ssh://hostname:22/repo" "../subrepo" "ssh://hostname:22/subrepo"
>> +test_submodule_relative_url "(null)" "user@host:path/to/repo" "../subrepo" "user@host:path/to/subrepo"
>> +test_submodule_relative_url "(null)" "user@host:repo" "../subrepo" "user@host:subrepo"
>> +
>>   test_done
>>
>

  reply	other threads:[~2016-03-02 17:34 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-12 23:39 [PATCH 0/2] Port `git submodule init` from shell to C Stefan Beller
2016-02-12 23:39 ` [PATCH 1/2] submodule: port resolve_relative_url " Stefan Beller
2016-02-18 20:23   ` Junio C Hamano
2016-02-27  8:28   ` Duy Nguyen
2016-03-02 17:21   ` Johannes Sixt
2016-03-02 17:34     ` Stefan Beller [this message]
2016-02-12 23:39 ` [PATCH 2/2] submodule: port init " Stefan Beller
2016-02-18 20:46   ` Junio C Hamano
2016-02-18 23:15     ` Junio C Hamano
  -- strict thread matches above, loose matches on Subject: below --
2016-04-16  0:50 [PATCH 0/2] Another reroll of sb/submodule-init Stefan Beller
2016-04-16  0:50 ` [PATCH 1/2] submodule: port resolve_relative_url from shell to C Stefan Beller
2016-04-14 18:18 [PATCH 0/2] Port `submodule init` " Stefan Beller
2016-04-14 18:18 ` [PATCH 1/2] submodule: port resolve_relative_url from shell " Stefan Beller
2016-04-14 19:35   ` Johannes Sixt
2016-04-14 19:37     ` Stefan Beller
2016-04-13  0:18 [PATCH 0/2] Port `git submodule init` " Stefan Beller
2016-04-13  0:18 ` [PATCH 1/2] submodule: port resolve_relative_url " Stefan Beller
2016-03-15  0:15 [PATCH 0/2] Port `git submodule init` " Stefan Beller
2016-03-15  0:15 ` [PATCH 1/2] submodule: port resolve_relative_url " Stefan Beller
2016-01-15 23:37 [PATCH 0/2] Port `git submodule init` " Stefan Beller
2016-01-15 23:37 ` [PATCH 1/2] submodule: Port resolve_relative_url " Stefan Beller

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=CAGZ79kZBXEnXdH1Zm0jg61Gianm6WesAgaf2WA57C63hwOafww@mail.gmail.com \
    --to=sbeller@google.com \
    --cc=Jens.Lehmann@web.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=j6t@kdbg.org \
    --cc=jrnieder@gmail.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).