{"thread":{"id":"48863","subject":"[PATCH v1] handle lower case drive letters on Windows","startedAt":"2018-07-11T17:54:44Z","lastAt":"2018-07-14T22:16:10Z","messageCount":15,"participants":["Ben Peart","Stefan Beller","Junio C Hamano","Johannes Schindelin"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"352282","messageId":"20180711175420.16940-1-benpeart@microsoft.com","threadId":"48863","inReplyTo":null,"subject":"[PATCH v1] handle lower case drive letters on Windows","fromName":"Ben Peart","fromEmail":"ben.peart@microsoft.com","sentAt":"2018-07-11T17:54:40Z","receivedAt":"2018-07-11T17:54:44Z","isPatch":true,"sender":{"key":"benpeart@microsoft.com","avatar":"https://avatars.githubusercontent.com/u/15252029?v=4"},"body":"Teach test-drop-caches to handle lower case drive letters on Windows.\n\nSigned-off-by: Ben Peart <Ben.Peart@microsoft.com>\n---\n\nNotes:\n    Base Ref: master\n    Web-Diff: https://github.com/benpeart/git/commit/55b815ee73\n    Checkout: git fetch https://github.com/benpeart/git drop-caches-v1 && git checkout 55b815ee73\n\n t/helper/test-drop-caches.c | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/helper/test-drop-caches.c b/t/helper/test-drop-caches.c\nindex d6bcfddf13..37047189c3 100644\n--- a/t/helper/test-drop-caches.c\n+++ b/t/helper/test-drop-caches.c\n@@ -16,7 +16,7 @@ static int cmd_sync(void)\n \tif ((0 == dwRet) || (dwRet > MAX_PATH))\n \t\treturn error(\"Error getting current directory\");\n \n-\tif ((Buffer[0] < 'A') || (Buffer[0] > 'Z'))\n+\tif ((toupper(Buffer[0]) < 'A') || (toupper(Buffer[0]) > 'Z'))\n \t\treturn error(\"Invalid drive letter '%c'\", Buffer[0]);\n \n \tszVolumeAccessPath[4] = Buffer[0];\n\nbase-commit: e3331758f12da22f4103eec7efe1b5304a9be5e9\n-- \n2.17.0.gvfs.1.123.g449c066\n\n"},{"id":"352283","messageId":"CAGZ79ka=HfzKprETBJ=+sdQsUZPXgHsgoqNWkbHprUGgLMggUA@mail.gmail.com","threadId":"48863","inReplyTo":"20180711175420.16940-1-benpeart@microsoft.com","subject":"Re: [PATCH v1] handle lower case drive letters on Windows","fromName":"Stefan Beller","fromEmail":"sbeller@google.com","sentAt":"2018-07-11T17:59:22Z","receivedAt":"2018-07-11T17:59:36Z","isPatch":true,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"On Wed, Jul 11, 2018 at 10:54 AM Ben Peart <Ben.Peart@microsoft.com> wrote:\n>\n> Teach test-drop-caches to handle lower case drive letters on Windows.\n\nAs someone not quite familiar with Windows (and using Git there),\nis this addressing a user visible issue, or a developer visible issue?\n(It looks to me as the latter as it touches test code). In which way\ndoes it improve the life of a developer?\n\nThanks,\nStefan\n"},{"id":"352288","messageId":"BL0PR2101MB1012D2CC0BEA20AB35CBE967F45A0@BL0PR2101MB1012.namprd21.prod.outlook.com","threadId":"48863","inReplyTo":"CAGZ79ka=HfzKprETBJ=+sdQsUZPXgHsgoqNWkbHprUGgLMggUA@mail.gmail.com","subject":"RE: [PATCH v1] handle lower case drive letters on Windows","fromName":"Ben Peart","fromEmail":"ben.peart@microsoft.com","sentAt":"2018-07-11T19:07:09Z","receivedAt":"2018-07-11T19:07:14Z","isPatch":true,"sender":{"key":"benpeart@microsoft.com","avatar":"https://avatars.githubusercontent.com/u/15252029?v=4"},"body":"> -----Original Message-----\n> From: Stefan Beller <sbeller@google.com>\n> Sent: Wednesday, July 11, 2018 1:59 PM\n> To: Ben Peart <Ben.Peart@microsoft.com>\n> Cc: git <git@vger.kernel.org>; Junio C Hamano <gitster@pobox.com>\n> Subject: Re: [PATCH v1] handle lower case drive letters on Windows\n> \n> On Wed, Jul 11, 2018 at 10:54 AM Ben Peart <Ben.Peart@microsoft.com>\n> wrote:\n> >\n> > Teach test-drop-caches to handle lower case drive letters on Windows.\n> \n> As someone not quite familiar with Windows (and using Git there),\n> is this addressing a user visible issue, or a developer visible issue?\n> (It looks to me as the latter as it touches test code). In which way\n> does it improve the life of a developer?\n> \n\nIt is a developer visible issue.  On Windows, file names (including drive\nletters) are case insensitive.  This patch improves the life of a Windows\ndeveloper by making drive letters case insensitive for the test-drop-caches\ntest application as well.  Without this patch \"test-drop-caches e\" will fail\nwith an error \"Invalid drive letter 'e'\" instead of succeeding as expected.\n\n> Thanks,\n> Stefan\n"},{"id":"352292","messageId":"xmqq36wp3549.fsf@gitster-ct.c.googlers.com","threadId":"48863","inReplyTo":"BL0PR2101MB1012D2CC0BEA20AB35CBE967F45A0@BL0PR2101MB1012.namprd21.prod.outlook.com","subject":"Re: [PATCH v1] handle lower case drive letters on Windows","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-07-11T20:11:02Z","receivedAt":"2018-07-11T20:11:06Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ben Peart <Ben.Peart@microsoft.com> writes:\n\n>> -----Original Message-----\n>> From: Stefan Beller <sbeller@google.com>\n>> Sent: Wednesday, July 11, 2018 1:59 PM\n>> To: Ben Peart <Ben.Peart@microsoft.com>\n>> Cc: git <git@vger.kernel.org>; Junio C Hamano <gitster@pobox.com>\n>> Subject: Re: [PATCH v1] handle lower case drive letters on Windows\n>> \n>> On Wed, Jul 11, 2018 at 10:54 AM Ben Peart <Ben.Peart@microsoft.com>\n>> wrote:\n>> >\n>> > Teach test-drop-caches to handle lower case drive letters on Windows.\n>> \n>> As someone not quite familiar with Windows (and using Git there),\n>> is this addressing a user visible issue, or a developer visible issue?\n>> (It looks to me as the latter as it touches test code). In which way\n>> does it improve the life of a developer?\n>> \n>\n> It is a developer visible issue.  On Windows, file names (including drive\n> letters) are case insensitive.  This patch improves the life of a Windows\n> developer by making drive letters case insensitive for the test-drop-caches\n> test application as well.  Without this patch \"test-drop-caches e\" will fail\n> with an error \"Invalid drive letter 'e'\" instead of succeeding as expected.\n\nI think one point of the original question was if it is common for a\ndeveloper to say \"test-drop-caches e\" from the command line, or the\nhelper is run solely by being written in some numbered test script\ndirectly under t/.  In the latter case, it would be reasonable to\nexpect and insist the scripts to use the more canonical form, even\nif the platform is case insensitive (assuming E: is more canonical\nthan e:, that is) no?\n\nIn any case, a larger point is that it would help other people who\nread the patch and \"git log\" output, if the answer you gave Stefan\nin the message I am responding to, and another one that you may give\nme in a response to this message, were in the proposed log message\nin the patch.\n\nThanks.\n"},{"id":"352303","messageId":"BL0PR2101MB101209F234BC164073DC650FF45A0@BL0PR2101MB1012.namprd21.prod.outlook.com","threadId":"48863","inReplyTo":"xmqq36wp3549.fsf@gitster-ct.c.googlers.com","subject":"RE: [PATCH v1] handle lower case drive letters on Windows","fromName":"Ben Peart","fromEmail":"ben.peart@microsoft.com","sentAt":"2018-07-11T21:30:13Z","receivedAt":"2018-07-11T21:30:18Z","isPatch":true,"sender":{"key":"benpeart@microsoft.com","avatar":"https://avatars.githubusercontent.com/u/15252029?v=4"},"body":"> -----Original Message-----\n> From: Junio C Hamano <jch2355@gmail.com> On Behalf Of Junio C Hamano\n> Sent: Wednesday, July 11, 2018 4:11 PM\n> To: Ben Peart <Ben.Peart@microsoft.com>\n> Cc: Stefan Beller <sbeller@google.com>; git <git@vger.kernel.org>\n> Subject: Re: [PATCH v1] handle lower case drive letters on Windows\n> \n> Ben Peart <Ben.Peart@microsoft.com> writes:\n> \n> >> -----Original Message-----\n> >> From: Stefan Beller <sbeller@google.com>\n> >> Sent: Wednesday, July 11, 2018 1:59 PM\n> >> To: Ben Peart <Ben.Peart@microsoft.com>\n> >> Cc: git <git@vger.kernel.org>; Junio C Hamano <gitster@pobox.com>\n> >> Subject: Re: [PATCH v1] handle lower case drive letters on Windows\n> >>\n> >> On Wed, Jul 11, 2018 at 10:54 AM Ben Peart <Ben.Peart@microsoft.com>\n> >> wrote:\n> >> >\n> >> > Teach test-drop-caches to handle lower case drive letters on Windows.\n> >>\n> >> As someone not quite familiar with Windows (and using Git there),\n> >> is this addressing a user visible issue, or a developer visible issue?\n> >> (It looks to me as the latter as it touches test code). In which way\n> >> does it improve the life of a developer?\n> >>\n> >\n> > It is a developer visible issue.  On Windows, file names (including drive\n> > letters) are case insensitive.  This patch improves the life of a Windows\n> > developer by making drive letters case insensitive for the test-drop-caches\n> > test application as well.  Without this patch \"test-drop-caches e\" will fail\n> > with an error \"Invalid drive letter 'e'\" instead of succeeding as expected.\n> \n> I think one point of the original question was if it is common for a\n> developer to say \"test-drop-caches e\" from the command line, or the\n> helper is run solely by being written in some numbered test script\n> directly under t/.  In the latter case, it would be reasonable to\n> expect and insist the scripts to use the more canonical form, even\n> if the platform is case insensitive (assuming E: is more canonical\n> than e:, that is) no?\n> \n> In any case, a larger point is that it would help other people who\n> read the patch and \"git log\" output, if the answer you gave Stefan\n> in the message I am responding to, and another one that you may give\n> me in a response to this message, were in the proposed log message\n> in the patch.\n> \n> Thanks.\n\nI apologize.  My memory had faded as to the scenario that caused the issue\nand my earlier response was incorrect.\n\nSome months ago I ran into a situation where GetCurrentDirectory returned a\nlower case drive letter which caused test-drop-caches to fail.  While most\ntools _do_ upper case the drive letter before calling SetCurrentDirectory,\nit isn't anything that is enforced so you _can_ get a lower case drive letter\nfrom GetCurrentDirectory and we should handle it properly.\n\nAt the time, I simply patched my local copy to properly handle that case and\nthe patch has been sitting in my \"todo\" backlog for a while now.\nI'll submit a V2 with a better commit message.\n"},{"id":"352305","messageId":"20180711214110.17396-1-benpeart@microsoft.com","threadId":"48863","inReplyTo":"20180711175420.16940-1-benpeart@microsoft.com","subject":"[PATCH v2] handle lower case drive letters on Windows","fromName":"Ben Peart","fromEmail":"ben.peart@microsoft.com","sentAt":"2018-07-11T21:41:26Z","receivedAt":"2018-07-11T21:41:31Z","isPatch":true,"sender":{"key":"benpeart@microsoft.com","avatar":"https://avatars.githubusercontent.com/u/15252029?v=4"},"body":"On Windows, if a tool calls SetCurrentDirectory with a lower case drive\nletter, the subsequent call to GetCurrentDirectory will return the same\nlower case drive letter. If that happens, test-drop-caches will error out as\nit does not correctly to handle lower case drive letters.\n\nSigned-off-by: Ben Peart <Ben.Peart@microsoft.com>\n---\n\nNotes:\n    Base Ref: master\n    Web-Diff: https://github.com/benpeart/git/commit/b497c111a7\n    Checkout: git fetch https://github.com/benpeart/git drop-caches-v2 && git checkout b497c111a7\n    \n    ### Interdiff (v1..v2):\n    \n    ### Patches\n\n t/helper/test-drop-caches.c | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/helper/test-drop-caches.c b/t/helper/test-drop-caches.c\nindex d6bcfddf13..37047189c3 100644\n--- a/t/helper/test-drop-caches.c\n+++ b/t/helper/test-drop-caches.c\n@@ -16,7 +16,7 @@ static int cmd_sync(void)\n \tif ((0 == dwRet) || (dwRet > MAX_PATH))\n \t\treturn error(\"Error getting current directory\");\n \n-\tif ((Buffer[0] < 'A') || (Buffer[0] > 'Z'))\n+\tif ((toupper(Buffer[0]) < 'A') || (toupper(Buffer[0]) > 'Z'))\n \t\treturn error(\"Invalid drive letter '%c'\", Buffer[0]);\n \n \tszVolumeAccessPath[4] = Buffer[0];\n\nbase-commit: e3331758f12da22f4103eec7efe1b5304a9be5e9\n-- \n2.17.0.gvfs.1.123.g449c066\n\n"},{"id":"352340","messageId":"nycvar.QRO.7.76.6.1807121556030.75@tvgsbejvaqbjf.bet","threadId":"48863","inReplyTo":"20180711175420.16940-1-benpeart@microsoft.com","subject":"Re: [PATCH v1] handle lower case drive letters on Windows","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2018-07-12T13:59:30Z","receivedAt":"2018-07-12T13:59:57Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Ben,\n\nOn Wed, 11 Jul 2018, Ben Peart wrote:\n\n> Teach test-drop-caches to handle lower case drive letters on Windows.\n\nMaybe mention that you can trigger this by using a lower case drive letter\nin Powershell (CMD normalizes your path, Powershell does not).\n\n> diff --git a/t/helper/test-drop-caches.c b/t/helper/test-drop-caches.c\n> index d6bcfddf13..37047189c3 100644\n> --- a/t/helper/test-drop-caches.c\n> +++ b/t/helper/test-drop-caches.c\n> @@ -16,7 +16,7 @@ static int cmd_sync(void)\n>  \tif ((0 == dwRet) || (dwRet > MAX_PATH))\n>  \t\treturn error(\"Error getting current directory\");\n>  \n> -\tif ((Buffer[0] < 'A') || (Buffer[0] > 'Z'))\n> +\tif ((toupper(Buffer[0]) < 'A') || (toupper(Buffer[0]) > 'Z'))\n>  \t\treturn error(\"Invalid drive letter '%c'\", Buffer[0]);\n\nThis is a rather incomplete test, as it does not even test for the colon\nafter the drive letter.\n\nBut I guess the more common case where this code path triggers the error\nis when your current directory is a UNC path to a file share (again, only\npossible in Powershell, CMD does not let you do that unless you play\nserious tricks).\n\nSo maybe a much better idea is to use our `has_dos_drive_prefix()`\nfunction:\n\n\tif (!has_dos_drive_prefix(Buffer))\n\t\treturn error(\"'%s': invalid drive letter\", Buffer);\n\nCiao,\nJohannes\n"},{"id":"352352","messageId":"20180712154419.18100-1-benpeart@microsoft.com","threadId":"48863","inReplyTo":"20180711175420.16940-1-benpeart@microsoft.com","subject":"[PATCH v3] handle lower case drive letters on Windows","fromName":"Ben Peart","fromEmail":"ben.peart@microsoft.com","sentAt":"2018-07-12T15:44:36Z","receivedAt":"2018-07-12T15:44:41Z","isPatch":true,"sender":{"key":"benpeart@microsoft.com","avatar":"https://avatars.githubusercontent.com/u/15252029?v=4"},"body":"On Windows, if a tool calls SetCurrentDirectory with a lower case drive\nletter, the subsequent call to GetCurrentDirectory will return the same\nlower case drive letter. Powershell, for example, does not normalize the\npath. If that happens, test-drop-caches will error out as it does not\ncorrectly to handle lower case drive letters.\n\nHelped-by: Johannes Schindelin <johannes.schindelin@gmx.de>\nSigned-off-by: Ben Peart <Ben.Peart@microsoft.com>\n---\n\nNotes:\n    Base Ref: master\n    Web-Diff: https://github.com/benpeart/git/commit/1ff8de1b6c\n    Checkout: git fetch https://github.com/benpeart/git drop-caches-v3 && git checkout 1ff8de1b6c\n    \n    ### Interdiff (v2..v3):\n    \n    diff --git a/t/helper/test-drop-caches.c b/t/helper/test-drop-caches.c\n    index 37047189c3..f65e301f9d 100644\n    --- a/t/helper/test-drop-caches.c\n    +++ b/t/helper/test-drop-caches.c\n    @@ -16,8 +16,8 @@ static int cmd_sync(void)\n     \tif ((0 == dwRet) || (dwRet > MAX_PATH))\n     \t\treturn error(\"Error getting current directory\");\n    \n    -\tif ((toupper(Buffer[0]) < 'A') || (toupper(Buffer[0]) > 'Z'))\n    -\t\treturn error(\"Invalid drive letter '%c'\", Buffer[0]);\n    +\tif (!has_dos_drive_prefix(Buffer))\n    +\t\treturn error(\"'%s': invalid drive letter\", Buffer);\n    \n     \tszVolumeAccessPath[4] = Buffer[0];\n     \thVolWrite = CreateFile(szVolumeAccessPath, GENERIC_READ | GENERIC_WRITE,\n    \n    ### Patches\n\n t/helper/test-drop-caches.c | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/t/helper/test-drop-caches.c b/t/helper/test-drop-caches.c\nindex d6bcfddf13..f65e301f9d 100644\n--- a/t/helper/test-drop-caches.c\n+++ b/t/helper/test-drop-caches.c\n@@ -16,8 +16,8 @@ static int cmd_sync(void)\n \tif ((0 == dwRet) || (dwRet > MAX_PATH))\n \t\treturn error(\"Error getting current directory\");\n \n-\tif ((Buffer[0] < 'A') || (Buffer[0] > 'Z'))\n-\t\treturn error(\"Invalid drive letter '%c'\", Buffer[0]);\n+\tif (!has_dos_drive_prefix(Buffer))\n+\t\treturn error(\"'%s': invalid drive letter\", Buffer);\n \n \tszVolumeAccessPath[4] = Buffer[0];\n \thVolWrite = CreateFile(szVolumeAccessPath, GENERIC_READ | GENERIC_WRITE,\n\nbase-commit: e3331758f12da22f4103eec7efe1b5304a9be5e9\n-- \n2.17.0.gvfs.1.123.g449c066\n\n"},{"id":"352364","messageId":"xmqqh8l4za50.fsf@gitster-ct.c.googlers.com","threadId":"48863","inReplyTo":"nycvar.QRO.7.76.6.1807121556030.75@tvgsbejvaqbjf.bet","subject":"Re: [PATCH v1] handle lower case drive letters on Windows","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-07-12T16:33:47Z","receivedAt":"2018-07-12T16:33:50Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> So maybe a much better idea is to use our `has_dos_drive_prefix()`\n> function:\n>\n> \tif (!has_dos_drive_prefix(Buffer))\n> \t\treturn error(\"'%s': invalid drive letter\", Buffer);\n\n\"'%s': path without valid drive prefix\", you mean?\n"},{"id":"352389","messageId":"xmqqr2k8w9n2.fsf@gitster-ct.c.googlers.com","threadId":"48863","inReplyTo":"20180712154419.18100-1-benpeart@microsoft.com","subject":"Re: [PATCH v3] handle lower case drive letters on Windows","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-07-12T19:12:49Z","receivedAt":"2018-07-12T19:12:53Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ben Peart <Ben.Peart@microsoft.com> writes:\n\n> On Windows, if a tool calls SetCurrentDirectory with a lower case drive\n> letter, the subsequent call to GetCurrentDirectory will return the same\n> lower case drive letter. Powershell, for example, does not normalize the\n> path. If that happens, test-drop-caches will error out as it does not\n> correctly to handle lower case drive letters.\n>\n> Helped-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n> Signed-off-by: Ben Peart <Ben.Peart@microsoft.com>\n> ---\n\nThanks.  Will replace, even though showing the whole Buffer (I am\nguessing it is the equivalent of result from getcwd(3) call) and\ncomplaining about drive \"letter\" feels a bit strange ;-)\n\n> Notes:\n>     Base Ref: master\n>     Web-Diff: https://github.com/benpeart/git/commit/1ff8de1b6c\n>     Checkout: git fetch https://github.com/benpeart/git drop-caches-v3 && git checkout 1ff8de1b6c\n>     \n>     ### Interdiff (v2..v3):\n>     \n>     diff --git a/t/helper/test-drop-caches.c b/t/helper/test-drop-caches.c\n>     index 37047189c3..f65e301f9d 100644\n>     --- a/t/helper/test-drop-caches.c\n>     +++ b/t/helper/test-drop-caches.c\n>     @@ -16,8 +16,8 @@ static int cmd_sync(void)\n>      \tif ((0 == dwRet) || (dwRet > MAX_PATH))\n>      \t\treturn error(\"Error getting current directory\");\n>     \n>     -\tif ((toupper(Buffer[0]) < 'A') || (toupper(Buffer[0]) > 'Z'))\n>     -\t\treturn error(\"Invalid drive letter '%c'\", Buffer[0]);\n>     +\tif (!has_dos_drive_prefix(Buffer))\n>     +\t\treturn error(\"'%s': invalid drive letter\", Buffer);\n>     \n>      \tszVolumeAccessPath[4] = Buffer[0];\n>      \thVolWrite = CreateFile(szVolumeAccessPath, GENERIC_READ | GENERIC_WRITE,\n>     \n>     ### Patches\n>\n>  t/helper/test-drop-caches.c | 4 ++--\n>  1 file changed, 2 insertions(+), 2 deletions(-)\n>\n> diff --git a/t/helper/test-drop-caches.c b/t/helper/test-drop-caches.c\n> index d6bcfddf13..f65e301f9d 100644\n> --- a/t/helper/test-drop-caches.c\n> +++ b/t/helper/test-drop-caches.c\n> @@ -16,8 +16,8 @@ static int cmd_sync(void)\n>  \tif ((0 == dwRet) || (dwRet > MAX_PATH))\n>  \t\treturn error(\"Error getting current directory\");\n>  \n> -\tif ((Buffer[0] < 'A') || (Buffer[0] > 'Z'))\n> -\t\treturn error(\"Invalid drive letter '%c'\", Buffer[0]);\n> +\tif (!has_dos_drive_prefix(Buffer))\n> +\t\treturn error(\"'%s': invalid drive letter\", Buffer);\n>  \n>  \tszVolumeAccessPath[4] = Buffer[0];\n>  \thVolWrite = CreateFile(szVolumeAccessPath, GENERIC_READ | GENERIC_WRITE,\n>\n> base-commit: e3331758f12da22f4103eec7efe1b5304a9be5e9\n"},{"id":"352390","messageId":"BL0PR2101MB1012EDB64112A8805A2C3D82F4590@BL0PR2101MB1012.namprd21.prod.outlook.com","threadId":"48863","inReplyTo":"xmqqr2k8w9n2.fsf@gitster-ct.c.googlers.com","subject":"RE: [PATCH v3] handle lower case drive letters on Windows","fromName":"Ben Peart","fromEmail":"ben.peart@microsoft.com","sentAt":"2018-07-12T19:23:23Z","receivedAt":"2018-07-12T19:23:27Z","isPatch":true,"sender":{"key":"benpeart@microsoft.com","avatar":"https://avatars.githubusercontent.com/u/15252029?v=4"},"body":"> -----Original Message-----\n> From: Junio C Hamano <jch2355@gmail.com> On Behalf Of Junio C Hamano\n> Sent: Thursday, July 12, 2018 3:13 PM\n> To: Ben Peart <Ben.Peart@microsoft.com>\n> Cc: git@vger.kernel.org; sbeller@google.com; johannes.schindelin@gmx.de\n> Subject: Re: [PATCH v3] handle lower case drive letters on Windows\n> \n> Ben Peart <Ben.Peart@microsoft.com> writes:\n> \n> > On Windows, if a tool calls SetCurrentDirectory with a lower case drive\n> > letter, the subsequent call to GetCurrentDirectory will return the same\n> > lower case drive letter. Powershell, for example, does not normalize the\n> > path. If that happens, test-drop-caches will error out as it does not\n> > correctly to handle lower case drive letters.\n> >\n> > Helped-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n> > Signed-off-by: Ben Peart <Ben.Peart@microsoft.com>\n> > ---\n> \n> Thanks.  Will replace, even though showing the whole Buffer (I am\n> guessing it is the equivalent of result from getcwd(3) call) and\n> complaining about drive \"letter\" feels a bit strange ;-)\n> \n\nThanks.  I thought it was strange as well until I realized you only see the\nerror message if there _isn't_ a valid drive letter so seeing the entire\npath makes sense as it will likely be something like \"\\\\server\\volume\\directory\"\n"},{"id":"352423","messageId":"xmqqmuuww7rq.fsf@gitster-ct.c.googlers.com","threadId":"48863","inReplyTo":"BL0PR2101MB1012EDB64112A8805A2C3D82F4590@BL0PR2101MB1012.namprd21.prod.outlook.com","subject":"Re: [PATCH v3] handle lower case drive letters on Windows","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-07-12T19:53:13Z","receivedAt":"2018-07-12T19:53:18Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ben Peart <Ben.Peart@microsoft.com> writes:\n\n>> -----Original Message-----\n>> From: Junio C Hamano <jch2355@gmail.com> On Behalf Of Junio C Hamano\n>> Sent: Thursday, July 12, 2018 3:13 PM\n>> To: Ben Peart <Ben.Peart@microsoft.com>\n>> Cc: git@vger.kernel.org; sbeller@google.com; johannes.schindelin@gmx.de\n>> Subject: Re: [PATCH v3] handle lower case drive letters on Windows\n>> \n>> Ben Peart <Ben.Peart@microsoft.com> writes:\n>> \n>> > On Windows, if a tool calls SetCurrentDirectory with a lower case drive\n>> > letter, the subsequent call to GetCurrentDirectory will return the same\n>> > lower case drive letter. Powershell, for example, does not normalize the\n>> > path. If that happens, test-drop-caches will error out as it does not\n>> > correctly to handle lower case drive letters.\n>> >\n>> > Helped-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n>> > Signed-off-by: Ben Peart <Ben.Peart@microsoft.com>\n>> > ---\n>> \n>> Thanks.  Will replace, even though showing the whole Buffer (I am\n>> guessing it is the equivalent of result from getcwd(3) call) and\n>> complaining about drive \"letter\" feels a bit strange ;-)\n>> \n>\n> Thanks.  I thought it was strange as well until I realized you only see the\n> error message if there _isn't_ a valid drive letter so seeing the entire\n> path makes sense as it will likely be something like \"\\\\server\\volume\\directory\"\n\nYup, that is why I thought Dscho meant to say something like\n\n\t\"'%s': path without valid drive prefix\"\n\nin my response ;-)\n\n"},{"id":"352427","messageId":"BL0PR2101MB10122C1A2F038B61470A6994F4590@BL0PR2101MB1012.namprd21.prod.outlook.com","threadId":"48863","inReplyTo":"xmqqmuuww7rq.fsf@gitster-ct.c.googlers.com","subject":"RE: [PATCH v3] handle lower case drive letters on Windows","fromName":"Ben Peart","fromEmail":"ben.peart@microsoft.com","sentAt":"2018-07-12T20:09:28Z","receivedAt":"2018-07-12T20:09:32Z","isPatch":true,"sender":{"key":"benpeart@microsoft.com","avatar":"https://avatars.githubusercontent.com/u/15252029?v=4"},"body":"> > Thanks.  I thought it was strange as well until I realized you only\n> > see the error message if there _isn't_ a valid drive letter so seeing\n> > the entire path makes sense as it will likely be something like\n> \"\\\\server\\volume\\directory\"\n> \n> Yup, that is why I thought Dscho meant to say something like\n> \n> \t\"'%s': path without valid drive prefix\"\n> \n> in my response ;-)\n\nI'm fine with that - want me to leave it alone, spin a V4 or have you tweak it?\n"},{"id":"352434","messageId":"xmqqva9kurba.fsf@gitster-ct.c.googlers.com","threadId":"48863","inReplyTo":"BL0PR2101MB10122C1A2F038B61470A6994F4590@BL0PR2101MB1012.namprd21.prod.outlook.com","subject":"Re: [PATCH v3] handle lower case drive letters on Windows","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-07-12T20:34:01Z","receivedAt":"2018-07-12T20:34:05Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ben Peart <Ben.Peart@microsoft.com> writes:\n\n>> > Thanks.  I thought it was strange as well until I realized you only\n>> > see the error message if there _isn't_ a valid drive letter so seeing\n>> > the entire path makes sense as it will likely be something like\n>> \"\\\\server\\volume\\directory\"\n>> \n>> Yup, that is why I thought Dscho meant to say something like\n>> \n>> \t\"'%s': path without valid drive prefix\"\n>> \n>> in my response ;-)\n>\n> I'm fine with that - want me to leave it alone, spin a V4 or have you tweak it?\n\nThat's \"helped-by Dscho\" patch, so I'd leave it to him by queuing v3\novernight and wait to deal with the final decision by the weekend\n;-) That way, I do not have to make a decision on anything Windows\nrelated.\n"},{"id":"352574","messageId":"nycvar.QRO.7.76.6.1807150015350.75@tvgsbejvaqbjf.bet","threadId":"48863","inReplyTo":"xmqqva9kurba.fsf@gitster-ct.c.googlers.com","subject":"Re: [PATCH v3] handle lower case drive letters on Windows","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2018-07-14T22:15:59Z","receivedAt":"2018-07-14T22:16:10Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Junio,\n\nOn Thu, 12 Jul 2018, Junio C Hamano wrote:\n\n> Ben Peart <Ben.Peart@microsoft.com> writes:\n> \n> >> > Thanks.  I thought it was strange as well until I realized you only\n> >> > see the error message if there _isn't_ a valid drive letter so seeing\n> >> > the entire path makes sense as it will likely be something like\n> >> \"\\\\server\\volume\\directory\"\n> >> \n> >> Yup, that is why I thought Dscho meant to say something like\n> >> \n> >> \t\"'%s': path without valid drive prefix\"\n> >> \n> >> in my response ;-)\n> >\n> > I'm fine with that - want me to leave it alone, spin a V4 or have you tweak it?\n> \n> That's \"helped-by Dscho\" patch, so I'd leave it to him by queuing v3\n> overnight and wait to deal with the final decision by the weekend\n> ;-) That way, I do not have to make a decision on anything Windows\n> related.\n\nThe tweaked error message is fine by me.\n\nCiao,\nDscho\n"}]}