{"thread":{"id":"30807","subject":"[PATCH js/submodule-relative] t7400: avoid path mangling issues","startedAt":"2012-06-14T12:10:27Z","lastAt":"2012-06-14T13:11:45Z","messageCount":2,"participants":["Johannes Sixt","Jon Seymour"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"193647","messageId":"4FD9D4B3.9060805@viscovery.net","threadId":"30807","inReplyTo":null,"subject":"[PATCH js/submodule-relative] t7400: avoid path mangling issues","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2012-06-14T12:10:27Z","receivedAt":"2012-06-14T12:10:27Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"From: Johannes Sixt <j6t@kdbg.org>\n\nA recently introduced test uses an absolute path. But when run on Windows\nusing the MSYS bash, such a path is mangled into a Windows style path when\nit is passed to 'git config'. The subsequent 'test' then compares the\nmangled path to the unmangled version and reports a failure.\n\nA path beginning with two slashes denotes a network directory\n(//server/share path) and is not mangled. Use that trick to side-step the\nissue. Just in case that 'git submodule init' regresses in such a way that\nit accesses the URL, use a path name that is unlikely to exist on POSIX\nsystems, and that cannot be a server name on Windows.\n\nSigned-off-by: Johannes Sixt <j6t@kdbg.org>\n---\n Sorry, Jon, Junio, for the resend. Forgot to Cc the list.\n\n t/t7400-submodule-basic.sh | 11 ++++++++---\n 1 file changed, 8 insertions(+), 3 deletions(-)\n\ndiff --git a/t/t7400-submodule-basic.sh b/t/t7400-submodule-basic.sh\nindex a899e6d..c73bec9 100755\n--- a/t/t7400-submodule-basic.sh\n+++ b/t/t7400-submodule-basic.sh\n@@ -510,14 +510,19 @@ test_expect_success '../subrepo works with port-qualified URL - ssh://hostname:2\n \t)\n '\n \n-test_expect_success '../subrepo path works with local path - /foo/repo' '\n+# About the choice of the path in the next test:\n+# - double-slash side-steps path mangling issues on Windows\n+# - it is still an absolute local path\n+# - there cannot be a server with a blank in its name just in case the\n+#   path is used erroneously to access a //server/share style path\n+test_expect_success '../subrepo path works with local path - //somewhere else/repo' '\n \t(\n \t\tcd reltest &&\n \t\tcp pristine-.git-config .git/config &&\n \t\tcp pristine-.gitmodules .gitmodules &&\n-\t\tgit config remote.origin.url /foo/repo &&\n+\t\tgit config remote.origin.url \"//somewhere else/repo\" &&\n \t\tgit submodule init &&\n-\t\ttest \"$(git config submodule.sub.url)\" = /foo/subrepo\n+\t\ttest \"$(git config submodule.sub.url)\" = \"//somewhere else/subrepo\"\n \t)\n '\n \n-- \n1.7.11.rc3.1188.ga03e3fc\n"},{"id":"193651","messageId":"CAH3AnrpCJwXNBOL75mBkfF69RK_TVUsnPx7m8reShR2g75bAWQ@mail.gmail.com","threadId":"30807","inReplyTo":"4FD9D4B3.9060805@viscovery.net","subject":"Re: [PATCH js/submodule-relative] t7400: avoid path mangling issues","fromName":"Jon Seymour","fromEmail":"jon.seymour@gmail.com","sentAt":"2012-06-14T13:11:45Z","receivedAt":"2012-06-14T13:11:45Z","isPatch":true,"sender":{"key":"jon.seymour@gmail.com","avatar":"https://avatars.githubusercontent.com/u/207131?v=4"},"body":"On Thu, Jun 14, 2012 at 10:10 PM, Johannes Sixt <j.sixt@viscovery.net> wrote:\n> From: Johannes Sixt <j6t@kdbg.org>\n>\n> A recently introduced test uses an absolute path. But when run on Windows\n> using the MSYS bash, such a path is mangled into a Windows style path when\n> it is passed to 'git config'. The subsequent 'test' then compares the\n> mangled path to the unmangled version and reports a failure.\n>\n> A path beginning with two slashes denotes a network directory\n> (//server/share path) and is not mangled. Use that trick to side-step the\n> issue. Just in case that 'git submodule init' regresses in such a way that\n> it accesses the URL, use a path name that is unlikely to exist on POSIX\n> systems, and that cannot be a server name on Windows.\n>\n> Signed-off-by: Johannes Sixt <j6t@kdbg.org>\n> ---\n>  Sorry, Jon, Junio, for the resend. Forgot to Cc the list.\n>\n>  t/t7400-submodule-basic.sh | 11 ++++++++---\n>  1 file changed, 8 insertions(+), 3 deletions(-)\n>\n> diff --git a/t/t7400-submodule-basic.sh b/t/t7400-submodule-basic.sh\n> index a899e6d..c73bec9 100755\n> --- a/t/t7400-submodule-basic.sh\n> +++ b/t/t7400-submodule-basic.sh\n> @@ -510,14 +510,19 @@ test_expect_success '../subrepo works with port-qualified URL - ssh://hostname:2\n>        )\n>  '\n>\n> -test_expect_success '../subrepo path works with local path - /foo/repo' '\n> +# About the choice of the path in the next test:\n> +# - double-slash side-steps path mangling issues on Windows\n> +# - it is still an absolute local path\n> +# - there cannot be a server with a blank in its name just in case the\n> +#   path is used erroneously to access a //server/share style path\n> +test_expect_success '../subrepo path works with local path - //somewhere else/repo' '\n>        (\n>                cd reltest &&\n>                cp pristine-.git-config .git/config &&\n>                cp pristine-.gitmodules .gitmodules &&\n> -               git config remote.origin.url /foo/repo &&\n> +               git config remote.origin.url \"//somewhere else/repo\" &&\n>                git submodule init &&\n> -               test \"$(git config submodule.sub.url)\" = /foo/subrepo\n> +               test \"$(git config submodule.sub.url)\" = \"//somewhere else/subrepo\"\n>        )\n>  '\n>\n> --\n> 1.7.11.rc3.1188.ga03e3fc\n\nThank you for the report and the test case.\n\njon.\n"}]}