git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH v1] handle lower case drive letters on Windows
@ 2018-07-11 17:54 Ben Peart
  2018-07-11 17:59 ` Stefan Beller
                   ` (3 more replies)
  0 siblings, 4 replies; 15+ messages in thread
From: Ben Peart @ 2018-07-11 17:54 UTC (permalink / raw)
  To: git@vger.kernel.org; +Cc: gitster@pobox.com, Ben Peart, Ben Peart

Teach test-drop-caches to handle lower case drive letters on Windows.

Signed-off-by: Ben Peart <Ben.Peart@microsoft.com>
---

Notes:
    Base Ref: master
    Web-Diff: https://github.com/benpeart/git/commit/55b815ee73
    Checkout: git fetch https://github.com/benpeart/git drop-caches-v1 && git checkout 55b815ee73

 t/helper/test-drop-caches.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/t/helper/test-drop-caches.c b/t/helper/test-drop-caches.c
index d6bcfddf13..37047189c3 100644
--- a/t/helper/test-drop-caches.c
+++ b/t/helper/test-drop-caches.c
@@ -16,7 +16,7 @@ static int cmd_sync(void)
 	if ((0 == dwRet) || (dwRet > MAX_PATH))
 		return error("Error getting current directory");
 
-	if ((Buffer[0] < 'A') || (Buffer[0] > 'Z'))
+	if ((toupper(Buffer[0]) < 'A') || (toupper(Buffer[0]) > 'Z'))
 		return error("Invalid drive letter '%c'", Buffer[0]);
 
 	szVolumeAccessPath[4] = Buffer[0];

base-commit: e3331758f12da22f4103eec7efe1b5304a9be5e9
-- 
2.17.0.gvfs.1.123.g449c066


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [PATCH v1] handle lower case drive letters on Windows
  2018-07-11 17:54 [PATCH v1] handle lower case drive letters on Windows Ben Peart
@ 2018-07-11 17:59 ` Stefan Beller
  2018-07-11 19:07   ` Ben Peart
  2018-07-11 21:41 ` [PATCH v2] " Ben Peart
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 15+ messages in thread
From: Stefan Beller @ 2018-07-11 17:59 UTC (permalink / raw)
  To: Ben Peart; +Cc: git, Junio C Hamano

On Wed, Jul 11, 2018 at 10:54 AM Ben Peart <Ben.Peart@microsoft.com> wrote:
>
> Teach test-drop-caches to handle lower case drive letters on Windows.

As someone not quite familiar with Windows (and using Git there),
is this addressing a user visible issue, or a developer visible issue?
(It looks to me as the latter as it touches test code). In which way
does it improve the life of a developer?

Thanks,
Stefan

^ permalink raw reply	[flat|nested] 15+ messages in thread

* RE: [PATCH v1] handle lower case drive letters on Windows
  2018-07-11 17:59 ` Stefan Beller
@ 2018-07-11 19:07   ` Ben Peart
  2018-07-11 20:11     ` Junio C Hamano
  0 siblings, 1 reply; 15+ messages in thread
From: Ben Peart @ 2018-07-11 19:07 UTC (permalink / raw)
  To: Stefan Beller; +Cc: git, Junio C Hamano

> -----Original Message-----
> From: Stefan Beller <sbeller@google.com>
> Sent: Wednesday, July 11, 2018 1:59 PM
> To: Ben Peart <Ben.Peart@microsoft.com>
> Cc: git <git@vger.kernel.org>; Junio C Hamano <gitster@pobox.com>
> Subject: Re: [PATCH v1] handle lower case drive letters on Windows
> 
> On Wed, Jul 11, 2018 at 10:54 AM Ben Peart <Ben.Peart@microsoft.com>
> wrote:
> >
> > Teach test-drop-caches to handle lower case drive letters on Windows.
> 
> As someone not quite familiar with Windows (and using Git there),
> is this addressing a user visible issue, or a developer visible issue?
> (It looks to me as the latter as it touches test code). In which way
> does it improve the life of a developer?
> 

It is a developer visible issue.  On Windows, file names (including drive
letters) are case insensitive.  This patch improves the life of a Windows
developer by making drive letters case insensitive for the test-drop-caches
test application as well.  Without this patch "test-drop-caches e" will fail
with an error "Invalid drive letter 'e'" instead of succeeding as expected.

> Thanks,
> Stefan

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v1] handle lower case drive letters on Windows
  2018-07-11 19:07   ` Ben Peart
@ 2018-07-11 20:11     ` Junio C Hamano
  2018-07-11 21:30       ` Ben Peart
  0 siblings, 1 reply; 15+ messages in thread
From: Junio C Hamano @ 2018-07-11 20:11 UTC (permalink / raw)
  To: Ben Peart; +Cc: Stefan Beller, git

Ben Peart <Ben.Peart@microsoft.com> writes:

>> -----Original Message-----
>> From: Stefan Beller <sbeller@google.com>
>> Sent: Wednesday, July 11, 2018 1:59 PM
>> To: Ben Peart <Ben.Peart@microsoft.com>
>> Cc: git <git@vger.kernel.org>; Junio C Hamano <gitster@pobox.com>
>> Subject: Re: [PATCH v1] handle lower case drive letters on Windows
>> 
>> On Wed, Jul 11, 2018 at 10:54 AM Ben Peart <Ben.Peart@microsoft.com>
>> wrote:
>> >
>> > Teach test-drop-caches to handle lower case drive letters on Windows.
>> 
>> As someone not quite familiar with Windows (and using Git there),
>> is this addressing a user visible issue, or a developer visible issue?
>> (It looks to me as the latter as it touches test code). In which way
>> does it improve the life of a developer?
>> 
>
> It is a developer visible issue.  On Windows, file names (including drive
> letters) are case insensitive.  This patch improves the life of a Windows
> developer by making drive letters case insensitive for the test-drop-caches
> test application as well.  Without this patch "test-drop-caches e" will fail
> with an error "Invalid drive letter 'e'" instead of succeeding as expected.

I think one point of the original question was if it is common for a
developer to say "test-drop-caches e" from the command line, or the
helper is run solely by being written in some numbered test script
directly under t/.  In the latter case, it would be reasonable to
expect and insist the scripts to use the more canonical form, even
if the platform is case insensitive (assuming E: is more canonical
than e:, that is) no?

In any case, a larger point is that it would help other people who
read the patch and "git log" output, if the answer you gave Stefan
in the message I am responding to, and another one that you may give
me in a response to this message, were in the proposed log message
in the patch.

Thanks.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* RE: [PATCH v1] handle lower case drive letters on Windows
  2018-07-11 20:11     ` Junio C Hamano
@ 2018-07-11 21:30       ` Ben Peart
  0 siblings, 0 replies; 15+ messages in thread
From: Ben Peart @ 2018-07-11 21:30 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Stefan Beller, git

> -----Original Message-----
> From: Junio C Hamano <jch2355@gmail.com> On Behalf Of Junio C Hamano
> Sent: Wednesday, July 11, 2018 4:11 PM
> To: Ben Peart <Ben.Peart@microsoft.com>
> Cc: Stefan Beller <sbeller@google.com>; git <git@vger.kernel.org>
> Subject: Re: [PATCH v1] handle lower case drive letters on Windows
> 
> Ben Peart <Ben.Peart@microsoft.com> writes:
> 
> >> -----Original Message-----
> >> From: Stefan Beller <sbeller@google.com>
> >> Sent: Wednesday, July 11, 2018 1:59 PM
> >> To: Ben Peart <Ben.Peart@microsoft.com>
> >> Cc: git <git@vger.kernel.org>; Junio C Hamano <gitster@pobox.com>
> >> Subject: Re: [PATCH v1] handle lower case drive letters on Windows
> >>
> >> On Wed, Jul 11, 2018 at 10:54 AM Ben Peart <Ben.Peart@microsoft.com>
> >> wrote:
> >> >
> >> > Teach test-drop-caches to handle lower case drive letters on Windows.
> >>
> >> As someone not quite familiar with Windows (and using Git there),
> >> is this addressing a user visible issue, or a developer visible issue?
> >> (It looks to me as the latter as it touches test code). In which way
> >> does it improve the life of a developer?
> >>
> >
> > It is a developer visible issue.  On Windows, file names (including drive
> > letters) are case insensitive.  This patch improves the life of a Windows
> > developer by making drive letters case insensitive for the test-drop-caches
> > test application as well.  Without this patch "test-drop-caches e" will fail
> > with an error "Invalid drive letter 'e'" instead of succeeding as expected.
> 
> I think one point of the original question was if it is common for a
> developer to say "test-drop-caches e" from the command line, or the
> helper is run solely by being written in some numbered test script
> directly under t/.  In the latter case, it would be reasonable to
> expect and insist the scripts to use the more canonical form, even
> if the platform is case insensitive (assuming E: is more canonical
> than e:, that is) no?
> 
> In any case, a larger point is that it would help other people who
> read the patch and "git log" output, if the answer you gave Stefan
> in the message I am responding to, and another one that you may give
> me in a response to this message, were in the proposed log message
> in the patch.
> 
> Thanks.

I apologize.  My memory had faded as to the scenario that caused the issue
and my earlier response was incorrect.

Some months ago I ran into a situation where GetCurrentDirectory returned a
lower case drive letter which caused test-drop-caches to fail.  While most
tools _do_ upper case the drive letter before calling SetCurrentDirectory,
it isn't anything that is enforced so you _can_ get a lower case drive letter
from GetCurrentDirectory and we should handle it properly.

At the time, I simply patched my local copy to properly handle that case and
the patch has been sitting in my "todo" backlog for a while now.
I'll submit a V2 with a better commit message.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH v2] handle lower case drive letters on Windows
  2018-07-11 17:54 [PATCH v1] handle lower case drive letters on Windows Ben Peart
  2018-07-11 17:59 ` Stefan Beller
@ 2018-07-11 21:41 ` Ben Peart
  2018-07-12 13:59 ` [PATCH v1] " Johannes Schindelin
  2018-07-12 15:44 ` [PATCH v3] " Ben Peart
  3 siblings, 0 replies; 15+ messages in thread
From: Ben Peart @ 2018-07-11 21:41 UTC (permalink / raw)
  To: Ben Peart
  Cc: git@vger.kernel.org, gitster@pobox.com, sbeller@google.com,
	Ben Peart, Ben Peart

On Windows, if a tool calls SetCurrentDirectory with a lower case drive
letter, the subsequent call to GetCurrentDirectory will return the same
lower case drive letter. If that happens, test-drop-caches will error out as
it does not correctly to handle lower case drive letters.

Signed-off-by: Ben Peart <Ben.Peart@microsoft.com>
---

Notes:
    Base Ref: master
    Web-Diff: https://github.com/benpeart/git/commit/b497c111a7
    Checkout: git fetch https://github.com/benpeart/git drop-caches-v2 && git checkout b497c111a7
    
    ### Interdiff (v1..v2):
    
    ### Patches

 t/helper/test-drop-caches.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/t/helper/test-drop-caches.c b/t/helper/test-drop-caches.c
index d6bcfddf13..37047189c3 100644
--- a/t/helper/test-drop-caches.c
+++ b/t/helper/test-drop-caches.c
@@ -16,7 +16,7 @@ static int cmd_sync(void)
 	if ((0 == dwRet) || (dwRet > MAX_PATH))
 		return error("Error getting current directory");
 
-	if ((Buffer[0] < 'A') || (Buffer[0] > 'Z'))
+	if ((toupper(Buffer[0]) < 'A') || (toupper(Buffer[0]) > 'Z'))
 		return error("Invalid drive letter '%c'", Buffer[0]);
 
 	szVolumeAccessPath[4] = Buffer[0];

base-commit: e3331758f12da22f4103eec7efe1b5304a9be5e9
-- 
2.17.0.gvfs.1.123.g449c066


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [PATCH v1] handle lower case drive letters on Windows
  2018-07-11 17:54 [PATCH v1] handle lower case drive letters on Windows Ben Peart
  2018-07-11 17:59 ` Stefan Beller
  2018-07-11 21:41 ` [PATCH v2] " Ben Peart
@ 2018-07-12 13:59 ` Johannes Schindelin
  2018-07-12 16:33   ` Junio C Hamano
  2018-07-12 15:44 ` [PATCH v3] " Ben Peart
  3 siblings, 1 reply; 15+ messages in thread
From: Johannes Schindelin @ 2018-07-12 13:59 UTC (permalink / raw)
  To: Ben Peart; +Cc: git@vger.kernel.org, gitster@pobox.com

Hi Ben,

On Wed, 11 Jul 2018, Ben Peart wrote:

> Teach test-drop-caches to handle lower case drive letters on Windows.

Maybe mention that you can trigger this by using a lower case drive letter
in Powershell (CMD normalizes your path, Powershell does not).

> diff --git a/t/helper/test-drop-caches.c b/t/helper/test-drop-caches.c
> index d6bcfddf13..37047189c3 100644
> --- a/t/helper/test-drop-caches.c
> +++ b/t/helper/test-drop-caches.c
> @@ -16,7 +16,7 @@ static int cmd_sync(void)
>  	if ((0 == dwRet) || (dwRet > MAX_PATH))
>  		return error("Error getting current directory");
>  
> -	if ((Buffer[0] < 'A') || (Buffer[0] > 'Z'))
> +	if ((toupper(Buffer[0]) < 'A') || (toupper(Buffer[0]) > 'Z'))
>  		return error("Invalid drive letter '%c'", Buffer[0]);

This is a rather incomplete test, as it does not even test for the colon
after the drive letter.

But I guess the more common case where this code path triggers the error
is when your current directory is a UNC path to a file share (again, only
possible in Powershell, CMD does not let you do that unless you play
serious tricks).

So maybe a much better idea is to use our `has_dos_drive_prefix()`
function:

	if (!has_dos_drive_prefix(Buffer))
		return error("'%s': invalid drive letter", Buffer);

Ciao,
Johannes

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH v3] handle lower case drive letters on Windows
  2018-07-11 17:54 [PATCH v1] handle lower case drive letters on Windows Ben Peart
                   ` (2 preceding siblings ...)
  2018-07-12 13:59 ` [PATCH v1] " Johannes Schindelin
@ 2018-07-12 15:44 ` Ben Peart
  2018-07-12 19:12   ` Junio C Hamano
  3 siblings, 1 reply; 15+ messages in thread
From: Ben Peart @ 2018-07-12 15:44 UTC (permalink / raw)
  To: git@vger.kernel.org, sbeller@google.com,
	johannes.schindelin@gmx.de
  Cc: gitster@pobox.com, Ben Peart, Ben Peart

On Windows, if a tool calls SetCurrentDirectory with a lower case drive
letter, the subsequent call to GetCurrentDirectory will return the same
lower case drive letter. Powershell, for example, does not normalize the
path. If that happens, test-drop-caches will error out as it does not
correctly to handle lower case drive letters.

Helped-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Ben Peart <Ben.Peart@microsoft.com>
---

Notes:
    Base Ref: master
    Web-Diff: https://github.com/benpeart/git/commit/1ff8de1b6c
    Checkout: git fetch https://github.com/benpeart/git drop-caches-v3 && git checkout 1ff8de1b6c
    
    ### Interdiff (v2..v3):
    
    diff --git a/t/helper/test-drop-caches.c b/t/helper/test-drop-caches.c
    index 37047189c3..f65e301f9d 100644
    --- a/t/helper/test-drop-caches.c
    +++ b/t/helper/test-drop-caches.c
    @@ -16,8 +16,8 @@ static int cmd_sync(void)
     	if ((0 == dwRet) || (dwRet > MAX_PATH))
     		return error("Error getting current directory");
    
    -	if ((toupper(Buffer[0]) < 'A') || (toupper(Buffer[0]) > 'Z'))
    -		return error("Invalid drive letter '%c'", Buffer[0]);
    +	if (!has_dos_drive_prefix(Buffer))
    +		return error("'%s': invalid drive letter", Buffer);
    
     	szVolumeAccessPath[4] = Buffer[0];
     	hVolWrite = CreateFile(szVolumeAccessPath, GENERIC_READ | GENERIC_WRITE,
    
    ### Patches

 t/helper/test-drop-caches.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/t/helper/test-drop-caches.c b/t/helper/test-drop-caches.c
index d6bcfddf13..f65e301f9d 100644
--- a/t/helper/test-drop-caches.c
+++ b/t/helper/test-drop-caches.c
@@ -16,8 +16,8 @@ static int cmd_sync(void)
 	if ((0 == dwRet) || (dwRet > MAX_PATH))
 		return error("Error getting current directory");
 
-	if ((Buffer[0] < 'A') || (Buffer[0] > 'Z'))
-		return error("Invalid drive letter '%c'", Buffer[0]);
+	if (!has_dos_drive_prefix(Buffer))
+		return error("'%s': invalid drive letter", Buffer);
 
 	szVolumeAccessPath[4] = Buffer[0];
 	hVolWrite = CreateFile(szVolumeAccessPath, GENERIC_READ | GENERIC_WRITE,

base-commit: e3331758f12da22f4103eec7efe1b5304a9be5e9
-- 
2.17.0.gvfs.1.123.g449c066


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [PATCH v1] handle lower case drive letters on Windows
  2018-07-12 13:59 ` [PATCH v1] " Johannes Schindelin
@ 2018-07-12 16:33   ` Junio C Hamano
  0 siblings, 0 replies; 15+ messages in thread
From: Junio C Hamano @ 2018-07-12 16:33 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: Ben Peart, git@vger.kernel.org

Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:

> So maybe a much better idea is to use our `has_dos_drive_prefix()`
> function:
>
> 	if (!has_dos_drive_prefix(Buffer))
> 		return error("'%s': invalid drive letter", Buffer);

"'%s': path without valid drive prefix", you mean?

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v3] handle lower case drive letters on Windows
  2018-07-12 15:44 ` [PATCH v3] " Ben Peart
@ 2018-07-12 19:12   ` Junio C Hamano
  2018-07-12 19:23     ` Ben Peart
  0 siblings, 1 reply; 15+ messages in thread
From: Junio C Hamano @ 2018-07-12 19:12 UTC (permalink / raw)
  To: Ben Peart
  Cc: git@vger.kernel.org, sbeller@google.com,
	johannes.schindelin@gmx.de

Ben Peart <Ben.Peart@microsoft.com> writes:

> On Windows, if a tool calls SetCurrentDirectory with a lower case drive
> letter, the subsequent call to GetCurrentDirectory will return the same
> lower case drive letter. Powershell, for example, does not normalize the
> path. If that happens, test-drop-caches will error out as it does not
> correctly to handle lower case drive letters.
>
> Helped-by: Johannes Schindelin <johannes.schindelin@gmx.de>
> Signed-off-by: Ben Peart <Ben.Peart@microsoft.com>
> ---

Thanks.  Will replace, even though showing the whole Buffer (I am
guessing it is the equivalent of result from getcwd(3) call) and
complaining about drive "letter" feels a bit strange ;-)

> Notes:
>     Base Ref: master
>     Web-Diff: https://github.com/benpeart/git/commit/1ff8de1b6c
>     Checkout: git fetch https://github.com/benpeart/git drop-caches-v3 && git checkout 1ff8de1b6c
>     
>     ### Interdiff (v2..v3):
>     
>     diff --git a/t/helper/test-drop-caches.c b/t/helper/test-drop-caches.c
>     index 37047189c3..f65e301f9d 100644
>     --- a/t/helper/test-drop-caches.c
>     +++ b/t/helper/test-drop-caches.c
>     @@ -16,8 +16,8 @@ static int cmd_sync(void)
>      	if ((0 == dwRet) || (dwRet > MAX_PATH))
>      		return error("Error getting current directory");
>     
>     -	if ((toupper(Buffer[0]) < 'A') || (toupper(Buffer[0]) > 'Z'))
>     -		return error("Invalid drive letter '%c'", Buffer[0]);
>     +	if (!has_dos_drive_prefix(Buffer))
>     +		return error("'%s': invalid drive letter", Buffer);
>     
>      	szVolumeAccessPath[4] = Buffer[0];
>      	hVolWrite = CreateFile(szVolumeAccessPath, GENERIC_READ | GENERIC_WRITE,
>     
>     ### Patches
>
>  t/helper/test-drop-caches.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/t/helper/test-drop-caches.c b/t/helper/test-drop-caches.c
> index d6bcfddf13..f65e301f9d 100644
> --- a/t/helper/test-drop-caches.c
> +++ b/t/helper/test-drop-caches.c
> @@ -16,8 +16,8 @@ static int cmd_sync(void)
>  	if ((0 == dwRet) || (dwRet > MAX_PATH))
>  		return error("Error getting current directory");
>  
> -	if ((Buffer[0] < 'A') || (Buffer[0] > 'Z'))
> -		return error("Invalid drive letter '%c'", Buffer[0]);
> +	if (!has_dos_drive_prefix(Buffer))
> +		return error("'%s': invalid drive letter", Buffer);
>  
>  	szVolumeAccessPath[4] = Buffer[0];
>  	hVolWrite = CreateFile(szVolumeAccessPath, GENERIC_READ | GENERIC_WRITE,
>
> base-commit: e3331758f12da22f4103eec7efe1b5304a9be5e9

^ permalink raw reply	[flat|nested] 15+ messages in thread

* RE: [PATCH v3] handle lower case drive letters on Windows
  2018-07-12 19:12   ` Junio C Hamano
@ 2018-07-12 19:23     ` Ben Peart
  2018-07-12 19:53       ` Junio C Hamano
  0 siblings, 1 reply; 15+ messages in thread
From: Ben Peart @ 2018-07-12 19:23 UTC (permalink / raw)
  To: Junio C Hamano
  Cc: git@vger.kernel.org, sbeller@google.com,
	johannes.schindelin@gmx.de

> -----Original Message-----
> From: Junio C Hamano <jch2355@gmail.com> On Behalf Of Junio C Hamano
> Sent: Thursday, July 12, 2018 3:13 PM
> To: Ben Peart <Ben.Peart@microsoft.com>
> Cc: git@vger.kernel.org; sbeller@google.com; johannes.schindelin@gmx.de
> Subject: Re: [PATCH v3] handle lower case drive letters on Windows
> 
> Ben Peart <Ben.Peart@microsoft.com> writes:
> 
> > On Windows, if a tool calls SetCurrentDirectory with a lower case drive
> > letter, the subsequent call to GetCurrentDirectory will return the same
> > lower case drive letter. Powershell, for example, does not normalize the
> > path. If that happens, test-drop-caches will error out as it does not
> > correctly to handle lower case drive letters.
> >
> > Helped-by: Johannes Schindelin <johannes.schindelin@gmx.de>
> > Signed-off-by: Ben Peart <Ben.Peart@microsoft.com>
> > ---
> 
> Thanks.  Will replace, even though showing the whole Buffer (I am
> guessing it is the equivalent of result from getcwd(3) call) and
> complaining about drive "letter" feels a bit strange ;-)
> 

Thanks.  I thought it was strange as well until I realized you only see the
error message if there _isn't_ a valid drive letter so seeing the entire
path makes sense as it will likely be something like "\\server\volume\directory"

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v3] handle lower case drive letters on Windows
  2018-07-12 19:23     ` Ben Peart
@ 2018-07-12 19:53       ` Junio C Hamano
  2018-07-12 20:09         ` Ben Peart
  0 siblings, 1 reply; 15+ messages in thread
From: Junio C Hamano @ 2018-07-12 19:53 UTC (permalink / raw)
  To: Ben Peart
  Cc: git@vger.kernel.org, sbeller@google.com,
	johannes.schindelin@gmx.de

Ben Peart <Ben.Peart@microsoft.com> writes:

>> -----Original Message-----
>> From: Junio C Hamano <jch2355@gmail.com> On Behalf Of Junio C Hamano
>> Sent: Thursday, July 12, 2018 3:13 PM
>> To: Ben Peart <Ben.Peart@microsoft.com>
>> Cc: git@vger.kernel.org; sbeller@google.com; johannes.schindelin@gmx.de
>> Subject: Re: [PATCH v3] handle lower case drive letters on Windows
>> 
>> Ben Peart <Ben.Peart@microsoft.com> writes:
>> 
>> > On Windows, if a tool calls SetCurrentDirectory with a lower case drive
>> > letter, the subsequent call to GetCurrentDirectory will return the same
>> > lower case drive letter. Powershell, for example, does not normalize the
>> > path. If that happens, test-drop-caches will error out as it does not
>> > correctly to handle lower case drive letters.
>> >
>> > Helped-by: Johannes Schindelin <johannes.schindelin@gmx.de>
>> > Signed-off-by: Ben Peart <Ben.Peart@microsoft.com>
>> > ---
>> 
>> Thanks.  Will replace, even though showing the whole Buffer (I am
>> guessing it is the equivalent of result from getcwd(3) call) and
>> complaining about drive "letter" feels a bit strange ;-)
>> 
>
> Thanks.  I thought it was strange as well until I realized you only see the
> error message if there _isn't_ a valid drive letter so seeing the entire
> path makes sense as it will likely be something like "\\server\volume\directory"

Yup, that is why I thought Dscho meant to say something like

	"'%s': path without valid drive prefix"

in my response ;-)


^ permalink raw reply	[flat|nested] 15+ messages in thread

* RE: [PATCH v3] handle lower case drive letters on Windows
  2018-07-12 19:53       ` Junio C Hamano
@ 2018-07-12 20:09         ` Ben Peart
  2018-07-12 20:34           ` Junio C Hamano
  0 siblings, 1 reply; 15+ messages in thread
From: Ben Peart @ 2018-07-12 20:09 UTC (permalink / raw)
  To: Junio C Hamano
  Cc: git@vger.kernel.org, sbeller@google.com,
	johannes.schindelin@gmx.de

> > Thanks.  I thought it was strange as well until I realized you only
> > see the error message if there _isn't_ a valid drive letter so seeing
> > the entire path makes sense as it will likely be something like
> "\\server\volume\directory"
> 
> Yup, that is why I thought Dscho meant to say something like
> 
> 	"'%s': path without valid drive prefix"
> 
> in my response ;-)

I'm fine with that - want me to leave it alone, spin a V4 or have you tweak it?

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v3] handle lower case drive letters on Windows
  2018-07-12 20:09         ` Ben Peart
@ 2018-07-12 20:34           ` Junio C Hamano
  2018-07-14 22:15             ` Johannes Schindelin
  0 siblings, 1 reply; 15+ messages in thread
From: Junio C Hamano @ 2018-07-12 20:34 UTC (permalink / raw)
  To: Ben Peart
  Cc: git@vger.kernel.org, sbeller@google.com,
	johannes.schindelin@gmx.de

Ben Peart <Ben.Peart@microsoft.com> writes:

>> > Thanks.  I thought it was strange as well until I realized you only
>> > see the error message if there _isn't_ a valid drive letter so seeing
>> > the entire path makes sense as it will likely be something like
>> "\\server\volume\directory"
>> 
>> Yup, that is why I thought Dscho meant to say something like
>> 
>> 	"'%s': path without valid drive prefix"
>> 
>> in my response ;-)
>
> I'm fine with that - want me to leave it alone, spin a V4 or have you tweak it?

That's "helped-by Dscho" patch, so I'd leave it to him by queuing v3
overnight and wait to deal with the final decision by the weekend
;-) That way, I do not have to make a decision on anything Windows
related.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v3] handle lower case drive letters on Windows
  2018-07-12 20:34           ` Junio C Hamano
@ 2018-07-14 22:15             ` Johannes Schindelin
  0 siblings, 0 replies; 15+ messages in thread
From: Johannes Schindelin @ 2018-07-14 22:15 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Ben Peart, git@vger.kernel.org, sbeller@google.com

Hi Junio,

On Thu, 12 Jul 2018, Junio C Hamano wrote:

> Ben Peart <Ben.Peart@microsoft.com> writes:
> 
> >> > Thanks.  I thought it was strange as well until I realized you only
> >> > see the error message if there _isn't_ a valid drive letter so seeing
> >> > the entire path makes sense as it will likely be something like
> >> "\\server\volume\directory"
> >> 
> >> Yup, that is why I thought Dscho meant to say something like
> >> 
> >> 	"'%s': path without valid drive prefix"
> >> 
> >> in my response ;-)
> >
> > I'm fine with that - want me to leave it alone, spin a V4 or have you tweak it?
> 
> That's "helped-by Dscho" patch, so I'd leave it to him by queuing v3
> overnight and wait to deal with the final decision by the weekend
> ;-) That way, I do not have to make a decision on anything Windows
> related.

The tweaked error message is fine by me.

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2018-07-14 22:16 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-11 17:54 [PATCH v1] handle lower case drive letters on Windows Ben Peart
2018-07-11 17:59 ` Stefan Beller
2018-07-11 19:07   ` Ben Peart
2018-07-11 20:11     ` Junio C Hamano
2018-07-11 21:30       ` Ben Peart
2018-07-11 21:41 ` [PATCH v2] " Ben Peart
2018-07-12 13:59 ` [PATCH v1] " Johannes Schindelin
2018-07-12 16:33   ` Junio C Hamano
2018-07-12 15:44 ` [PATCH v3] " Ben Peart
2018-07-12 19:12   ` Junio C Hamano
2018-07-12 19:23     ` Ben Peart
2018-07-12 19:53       ` Junio C Hamano
2018-07-12 20:09         ` Ben Peart
2018-07-12 20:34           ` Junio C Hamano
2018-07-14 22:15             ` Johannes Schindelin

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).