On Wed, 12 Feb 2025, Corinna Vinschen wrote:

> Hi Jeremy,
>
> your patch is basically fine, and I was about to push it, when I
> realized that I don't quite understand this:
>
> What exactly is de-duplicated here?
>
> I have a drive mounted under C:\drvmount.
> I create an additional mount entry:
>
>   $ mount C:/drvmount /home/corinna/drv
>
> If I call mount, I see two mount entries, both pointing to the
> /home/corinna/drv dir:
>
>   $ mount | grep drvmount
>   C:/drvmount on /home/corinna/drv type ntfs (binary,user)
>   C:/drvmount on /home/corinna/drv type ntfs (binary,posix=0,noumount,auto)
>
> The first is the explicit mount, the second is the cygdrive entry.
> If I disable the above de-dup code, the result is the same.

It was *supposed* to not return the second one.  Maybe I broke it when
trying to break out of the loop early...  I will test this scenario and
see why it doesn't work as expected.

> However, either way, both point to the explicit mount point.
> Wouldn't it be helpful to see /cygdrive/c/drvmount?
>
>   C:/drvmount on /home/corinna/drv type ntfs (binary,user)
>   C:/drvmount on /cygdrive/c/drvmount type ntfs (binary,posix=0,noumount,auto)

The existing code masked off of available_drives if it saw an explicit
mount entry to the root of that drive letter.  I assumed it was desired
not to show a cygdrive mount entry in that case.  If it is, maybe it could
use cygdrive_posix_path instead of conv_to_posix_path?  I'm kind of
concerned that it could get confusing though... consider:

drive mounted under C:\drvmount
mount C: /something
mount would show
 C: on /something
 C: on /cygdrive/c
 C:/drvmount on /cygdrive/c/drvmount

and say nothing about /something/drvmount.  Of course, the existing
behavior I was trying to replicate is to say nothing about /cygdrive/c...

Reply via email to