{"thread":{"id":"30268","subject":"[RFC/PATCH] git-sh-setup.sh: Add an pwd() function for MinGW","startedAt":"2012-04-17T18:48:39Z","lastAt":"2012-04-18T18:23:48Z","messageCount":2,"participants":["Ramsay Jones","Johannes Sixt"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"189555","messageId":"4F8DBB07.5060506@ramsay1.demon.co.uk","threadId":"30268","inReplyTo":null,"subject":"[RFC/PATCH] git-sh-setup.sh: Add an pwd() function for MinGW","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsay1.demon.co.uk","sentAt":"2012-04-17T18:48:39Z","receivedAt":"2012-04-17T18:48:39Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"\nSigned-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>\n---\n\nHi Johannes,\n\nWhile working on fixing git-submodule.sh on cygwin, I attempted\nto run tests on MinGW to ensure that my patches don't cause a\nregression. (Indeed that is the *only* reason I have MinGW\ninstalled!)\n\nIn order to test the modified git-submodule.sh I used the following\ntests:\n\n    $ git grep -l -e 'git *submodule' -- t\n    t/t5526-fetch-submodules.sh\n    t/t6008-rev-list-submodule.sh\n    t/t7003-filter-branch.sh\n    t/t7400-submodule-basic.sh\n    t/t7401-submodule-summary.sh\n    t/t7403-submodule-sync.sh\n    t/t7405-submodule-merge.sh\n    t/t7406-submodule-update.sh\n    t/t7407-submodule-foreach.sh\n    t/t7408-submodule-reference.sh\n    t/t7506-status-submodule.sh\n    t/t7610-mergetool.sh\n    t/t9300-fast-import.sh\n    t/t9350-fast-export.sh\n\nOn MinGW, the following tests failed:\n\n    t5526-fetch-submodules.sh:  1, 2, 5, 8-13, 16, 18-19, 21, 23-24\n    t7400-submodule-basic.sh:   7\n    t7401-submodule-summary.sh: 16\n    t7405-submodule-merge.sh:   7-8\n    t7406-submodule-update.sh:  3, 24-25, 30-31\n    t7407-submodule-foreach.sh: 2, 5-10, 12-13\n    t9300-fast-import.sh:       62\n\nI noticed that 6 of those tests were failing due to CRLF line ending\nissues. For example, if you redirect the output of git-status to a\nfile, then you will find that the lines output by git-submodule have\nCRLF line endings, while the remainder of the file has LF only.\nSo, in order to ignore this (ie I don't have a patch to fix it!), if\nI run the tests something like this:\n\n    $ GIT_TEST_CMP='diff -ub' ./t7400-submodule-basic.sh\n\nthen these tests pass. The tests in question being:\n\n    t7400.7, t7401.16, t7405.{7,8}, t7406.3 and t7407.2\n\n[Note that I wanted to use --strip-trailing-cr but the version of diff\non MinGW was too old.]\n\nTest #62 in t9300-fast-import.sh is fixed by a separate patch (see email\n[PATCH] compat/mingw.h: Set S_ISUID to prevent a fast-import test failure).\n\nAll of the remaining test failures are fixed by this patch!\n\nThis is an RFC because I have only run the above tests. In fact the original\nversion of this patch was confined to git-submodule.sh (along with a uname\nconditional to restrict the definition to MinGW).\n\nHTH\n\nATB,\nRamsay Jones\n\n git-sh-setup.sh |    4 ++++\n 1 file changed, 4 insertions(+)\n\ndiff --git a/git-sh-setup.sh b/git-sh-setup.sh\nindex 5d8e4e6..7b3ae75 100644\n--- a/git-sh-setup.sh\n+++ b/git-sh-setup.sh\n@@ -248,6 +248,10 @@ case $(uname -s) in\n \tfind () {\n \t\t/usr/bin/find \"$@\"\n \t}\n+\t# git sees Windows-style pwd\n+\tpwd () {\n+\t\tbuiltin pwd -W\n+\t}\n \tis_absolute_path () {\n \t\tcase \"$1\" in\n \t\t[/\\\\]* | [A-Za-z]:*)\n-- \n1.7.10\n"},{"id":"189638","messageId":"4F8F06B4.5070609@kdbg.org","threadId":"30268","inReplyTo":"4F8DBB07.5060506@ramsay1.demon.co.uk","subject":"Re: [RFC/PATCH] git-sh-setup.sh: Add an pwd() function for MinGW","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2012-04-18T18:23:48Z","receivedAt":"2012-04-18T18:23:48Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 17.04.2012 20:48, schrieb Ramsay Jones:\n> \n> Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>\n> ---\n> \n> Hi Johannes,\n> \n> While working on fixing git-submodule.sh on cygwin, I attempted\n> to run tests on MinGW to ensure that my patches don't cause a\n> regression. (Indeed that is the *only* reason I have MinGW\n> installed!)\n> \n> In order to test the modified git-submodule.sh I used the following\n> tests:\n> \n>     $ git grep -l -e 'git *submodule' -- t\n>     t/t5526-fetch-submodules.sh\n>     t/t6008-rev-list-submodule.sh\n>     t/t7003-filter-branch.sh\n>     t/t7400-submodule-basic.sh\n>     t/t7401-submodule-summary.sh\n>     t/t7403-submodule-sync.sh\n>     t/t7405-submodule-merge.sh\n>     t/t7406-submodule-update.sh\n>     t/t7407-submodule-foreach.sh\n>     t/t7408-submodule-reference.sh\n>     t/t7506-status-submodule.sh\n>     t/t7610-mergetool.sh\n>     t/t9300-fast-import.sh\n>     t/t9350-fast-export.sh\n> \n> On MinGW, the following tests failed:\n> \n>     t5526-fetch-submodules.sh:  1, 2, 5, 8-13, 16, 18-19, 21, 23-24\n>     t7400-submodule-basic.sh:   7\n>     t7401-submodule-summary.sh: 16\n>     t7405-submodule-merge.sh:   7-8\n>     t7406-submodule-update.sh:  3, 24-25, 30-31\n>     t7407-submodule-foreach.sh: 2, 5-10, 12-13\n>     t9300-fast-import.sh:       62\n> \n> I noticed that 6 of those tests were failing due to CRLF line ending\n> issues. For example, if you redirect the output of git-status to a\n> file, then you will find that the lines output by git-submodule have\n> CRLF line endings, while the remainder of the file has LF only.\n> So, in order to ignore this (ie I don't have a patch to fix it!), if\n> I run the tests something like this:\n> \n>     $ GIT_TEST_CMP='diff -ub' ./t7400-submodule-basic.sh\n> \n> then these tests pass. The tests in question being:\n> \n>     t7400.7, t7401.16, t7405.{7,8}, t7406.3 and t7407.2\n> \n> [Note that I wanted to use --strip-trailing-cr but the version of diff\n> on MinGW was too old.]\n> \n> Test #62 in t9300-fast-import.sh is fixed by a separate patch (see email\n> [PATCH] compat/mingw.h: Set S_ISUID to prevent a fast-import test failure).\n> \n> All of the remaining test failures are fixed by this patch!\n> \n> This is an RFC because I have only run the above tests. In fact the original\n> version of this patch was confined to git-submodule.sh (along with a uname\n> conditional to restrict the definition to MinGW).\n> \n> HTH\n> \n> ATB,\n> Ramsay Jones\n> \n>  git-sh-setup.sh |    4 ++++\n>  1 file changed, 4 insertions(+)\n> \n> diff --git a/git-sh-setup.sh b/git-sh-setup.sh\n> index 5d8e4e6..7b3ae75 100644\n> --- a/git-sh-setup.sh\n> +++ b/git-sh-setup.sh\n> @@ -248,6 +248,10 @@ case $(uname -s) in\n>  \tfind () {\n>  \t\t/usr/bin/find \"$@\"\n>  \t}\n> +\t# git sees Windows-style pwd\n> +\tpwd () {\n> +\t\tbuiltin pwd -W\n> +\t}\n>  \tis_absolute_path () {\n>  \t\tcase \"$1\" in\n>  \t\t[/\\\\]* | [A-Za-z]:*)\n\nThe test suite passes with this patch. As I already said in a similar\ncontext on the msysgit mailing list[1], it looks like all occurrences of\n'pwd' in the scripted git commands are exercised, so I trust this does\nnot bring any regressions.\n\n-- Hannes\n\n[1]\nhttp://thread.gmane.org/gmane.comp.version-control.msysgit/14894/focus=14970\n"}]}