public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Additional odd behavior after my upgrade to the latest CYGWIN64 version
@ 2024-03-16 21:49 Michael Goldshteyn
  2024-03-18  9:11 ` Andrey Repin
  2024-03-18 10:32 ` Corinna Vinschen
  0 siblings, 2 replies; 3+ messages in thread
From: Michael Goldshteyn @ 2024-03-16 21:49 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 1338 bytes --]

Cygwin handles (filename) case insensitivity in a very weird way at the
Windows command prompt:
------------------------------
c:\Users\Michael>set CYGWIN=

c:\Users\Michael>printf "%q " 'a' 'A' "a" "A" a A
a A a A a A

REM OK, so far so good, but, now:
c:\Users\Michael>set CYGWIN=glob:ignorecase

C:\Users\Michael>printf "%q " 'a' 'A' "a" "A" a A
a a a a a A

REM So, if I don't put a command line arg into any sort of quotes, it gets
lower-cased for cygwin apps (from the Windows command line).
REM I should also add that there is no file named 'a' or 'A' in the current
working directory.

REM This behavior, of course, doesn't happen in Cygwin bash:
------------------------------
C:\Users\Michael>bash
Michael@lambda /cygdrive/c/Users/Michael
$ echo "$CYGWIN"
glob:ignorecase
Michael@lambda /cygdrive/c/Users/Michael
$ printf "%q " 'a' 'A' "a" "A" a A
a A a A a A
$ # Output looks correct, quoted or not
------------------------------
The unsolicited conversion of case for quoted string is very odd, to say
the least. If you remove the glob:ignorecase from the CYGWIN env var
definition, use of filenames on Windows with Cygwin tools becomes
completely case sensitive, which is very undesirable when compared to the
fact that other Windows tools do not care about file case (i.e., case
insensitive, but preserving, as MS puts it).

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

* Re: Additional odd behavior after my upgrade to the latest CYGWIN64 version
  2024-03-16 21:49 Additional odd behavior after my upgrade to the latest CYGWIN64 version Michael Goldshteyn
@ 2024-03-18  9:11 ` Andrey Repin
  2024-03-18 10:32 ` Corinna Vinschen
  1 sibling, 0 replies; 3+ messages in thread
From: Andrey Repin @ 2024-03-18  9:11 UTC (permalink / raw)
  To: Michael Goldshteyn, cygwin

Greetings, Michael Goldshteyn!

> Cygwin handles (filename) case insensitivity in a very weird way at the
> Windows command prompt:
> ------------------------------
> c:\Users\Michael>set CYGWIN=

> c:\Users\Michael>printf "%q " 'a' 'A' "a" "A" a A
> a A a A a A

> REM OK, so far so good, but, now:
> c:\Users\Michael>set CYGWIN=glob:ignorecase

> C:\Users\Michael>printf "%q " 'a' 'A' "a" "A" a A
> a a a a a A

Oh, so THAT's what causing my git diff to disappear!

>> [C:\]$ set cyg
>> CYGWIN=wincmdln winsymlinks:native glob:ignorecase
>> CYGWIN_DIR=C:\Programs\Cygwin
>> CYGWIN_MIRROR=https://ftp-stud.hs-esslingen.de/pub/Mirrors/sources.redhat.com/cygwin
>>
>> [C:\]$ mintty -- git diff --minimal "--diff-filter=MAD" --find-renames=70 --irreversible-delete HEAD --

>> # The actual executed command is:
>> git diff --minimal --diff-filter=mad --find-renames=70 --irreversible-delete HEAD --

I don't think that's how it is supposed to work.


-- 
With best regards,
Andrey Repin
Monday, March 18, 2024 12:06:56

Sorry for my terrible english...


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

* Re: Additional odd behavior after my upgrade to the latest CYGWIN64 version
  2024-03-16 21:49 Additional odd behavior after my upgrade to the latest CYGWIN64 version Michael Goldshteyn
  2024-03-18  9:11 ` Andrey Repin
@ 2024-03-18 10:32 ` Corinna Vinschen
  1 sibling, 0 replies; 3+ messages in thread
From: Corinna Vinschen @ 2024-03-18 10:32 UTC (permalink / raw)
  To: Michael Goldshteyn; +Cc: cygwin

On Mar 16 16:49, Michael Goldshteyn via Cygwin wrote:
> Cygwin handles (filename) case insensitivity in a very weird way at the
> Windows command prompt:
> ------------------------------
> c:\Users\Michael>set CYGWIN=
> 
> c:\Users\Michael>printf "%q " 'a' 'A' "a" "A" a A
> a A a A a A
> 
> REM OK, so far so good, but, now:
> c:\Users\Michael>set CYGWIN=glob:ignorecase
> 
> C:\Users\Michael>printf "%q " 'a' 'A' "a" "A" a A
> a a a a a A
> 
> REM So, if I don't put a command line arg into any sort of quotes, it gets
> lower-cased for cygwin apps (from the Windows command line).
> REM I should also add that there is no file named 'a' or 'A' in the current
> working directory.
> 
> REM This behavior, of course, doesn't happen in Cygwin bash:
> ------------------------------
> C:\Users\Michael>bash
> Michael@lambda /cygdrive/c/Users/Michael
> $ echo "$CYGWIN"
> glob:ignorecase
> Michael@lambda /cygdrive/c/Users/Michael
> $ printf "%q " 'a' 'A' "a" "A" a A
> a A a A a A
> $ # Output looks correct, quoted or not
> ------------------------------
> The unsolicited conversion of case for quoted string is very odd, to say
> the least. If you remove the glob:ignorecase from the CYGWIN env var
> definition, use of filenames on Windows with Cygwin tools becomes
> completely case sensitive, which is very undesirable when compared to the
> fact that other Windows tools do not care about file case (i.e., case
> insensitive, but preserving, as MS puts it).

This was an ill-advised optimization attempt in glob.  I revert the
patch and pushed the change(*), so this will be fixed in Cygwin 3.5.2.

For the time being, you can also test this by installing the just
building Cygwin test release 3.6.0-0.85.g89afbb8d8af2, which should
be available in an hour or two.


Thanks,
Corinna


(*) https://cygwin.com/cgit/newlib-cygwin/commit/?id=70375b2205

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

end of thread, other threads:[~2024-03-18 10:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-16 21:49 Additional odd behavior after my upgrade to the latest CYGWIN64 version Michael Goldshteyn
2024-03-18  9:11 ` Andrey Repin
2024-03-18 10:32 ` Corinna Vinschen

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