GNU bug report logs -
#51622
29.0.50; [PATCH] Abbreviate remote home directories in `abbreviate-file-name'
Previous Next
Reported by: Jim Porter <jporterbugs <at> gmail.com>
Date: Sat, 6 Nov 2021 03:45:02 UTC
Severity: wishlist
Tags: patch
Found in version 29.0.50
Fixed in version 29.1
Done: Michael Albinus <michael.albinus <at> gmx.de>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
On 11/7/2021 10:37 AM, Michael Albinus wrote:
> Jim Porter <jporterbugs <at> gmail.com> writes:
>
>> Thanks for the pointers. I've attached a new version of the patch,
>> along with updated benchmark results. When abbreviating Tramp files,
>> not only is this version faster than my previous patch, it's also 2-4x
>> faster(!) than Emacs trunk.
>
> Thanks, it looks very promising. According to the benchmarks I'm not
> surprised, because you use Tramp caches.
Hmm, actually it turns out that my patch was only this fast because I
forgot to check whether the host has case-sensitive file names or not.
Adding that check back in slows things down again. How I update my
previous patch will depend on whether we can make
`file-name-case-insensitive-p' fast for Tramp files, so I'll just focus
on this part for now and then follow up on the other parts of your
message after we've decided on what to do here.
Currently on case-sensitive hosts,
`tramp-handle-file-name-case-insensitive-p' performs its checks on the
connection every time this function is called. The beginning of tramp.el
says the following:
* `tramp-case-insensitive'
Whether the remote file system handles file names case insensitive.
Only a non-nil value counts, the default value nil means to
perform further checks on the remote host. See
`tramp-connection-properties' for a way to overwrite this.
I interpret this to mean that Tramp *intentionally* performs checks on
the host every time if the result is nil. Is there a reason this is
necessary? Are there any systems out there where the check would return
nil, but it's still case-insensitive in some cases? Even if there are, I
imagine that *most* of the time, this check is reliable, and it would be
nice if we could cache the result for case-sensitive hosts.
I've attached the beginnings of a patch to do this. What do you think?
If the general idea makes sense, I'll finish it up and file a separate
bug to track it. If Tramp needs to perform the checks every time for
some remote hosts, maybe the user could set `tramp-case-insensitive' to
`never-cache' for those connections?
> Thanks. I've kept that patch on hold for a while. During my illness, it
> got applied, and so you did the dirty task to rearrange everything. I've
> pushed it in your name to the master branch. Thanks.
I hope your health is doing better now. Thanks again for taking a look
at this patch (and merging the two smaller ones).
[tramp-cache-case-sensitive.patch (text/plain, attachment)]
This bug report was last modified 3 years and 186 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.