Bug 369094 - session file locations are stored with 'real' path, replacing any path symbolic links!
Summary: session file locations are stored with 'real' path, replacing any path symbol...
Status: RESOLVED INTENTIONAL
Alias: None
Product: kate
Classification: Applications
Component: application (show other bugs)
Version: unspecified
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
: 387365 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-09-20 02:39 UTC by JohnF
Modified: 2023-03-01 20:53 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description JohnF 2016-09-20 02:39:49 UTC
not needed.

Kate 'Recent files' keep the symbolic link references.

Reproducible: Always

Steps to Reproduce:
1. open file that is accessed through a symbolic link to a folder
2. save and close session
     close and reopen kate
3. open session

Actual Results:  
(can check session config file)
symbolic Link in path is replaced with the real path of the file.



Expected Results:  
I opened a file that is found through a link
That is what should be saved in the session not the path produced by following link.

Same as 'Recent files' - symbolic link should be still in the path.
Comment 1 Christoph Cullmann 2017-12-20 20:54:19 UTC
*** Bug 387365 has been marked as a duplicate of this bug. ***
Comment 2 Justin Zobel 2020-10-27 04:22:14 UTC
John can you please confirm if this still occurs on a recent version of Kate?
Comment 3 nfxjfg 2020-10-29 13:29:25 UTC
Still reproduces with kate 20.08.2.
The git project plugin is affected by a similar bug.
Comment 4 Justin Zobel 2020-10-29 22:03:49 UTC
Confirmed in comment 3.
Comment 5 Christoph Cullmann 2022-03-06 21:21:14 UTC
This is intentional, sorry.

We use close to everywhere the canonical path, already for file open.

I am sorry this is not good for your working pattern, but this is the only simple way to ensure we only open files once and are able to easily match stuff.

Naturally one could re-design this and try to keep the non-canonical path, but this seems out of scope for this little inconvenience.
Comment 6 nfxjfg 2022-03-08 09:35:41 UTC
> but this is the only simple way to ensure we only open files once and are able to easily match stuff.

Interestingly, it doesn't work though. Bind mounts (mount --bind) are not handled. If I open a file and open the same file in a bind mounted directory, the editor still treats them as different files, and gets confused. It even overwrites the changed file without any indication that something is wrong...

According to inotifywait, you still get events on both paths, and st_dev/st_ino can be used to uniquely identify a file on a system.
Comment 7 Christoph Cullmann 2022-03-08 09:48:02 UTC
(In reply to nfxjfg from comment #6)
> > but this is the only simple way to ensure we only open files once and are able to easily match stuff.
> 
> Interestingly, it doesn't work though. Bind mounts (mount --bind) are not
> handled. If I open a file and open the same file in a bind mounted
> directory, the editor still treats them as different files, and gets
> confused. It even overwrites the changed file without any indication that
> something is wrong...
> 
> According to inotifywait, you still get events on both paths, and
> st_dev/st_ino can be used to uniquely identify a file on a system.

Yeah, you can do all that, but we only identify documents by their URL.
Therefore we let Qt compute the canonical file path and be done.
Naturally there are X complex ways to still have non-unified paths.
But that is for me out of scope,.
Even the st_dev/st_ino is actually no good solution, as this isn't stable if you start to delete file that are open and create new ones.
Comment 8 nfxjfg 2022-03-08 10:11:01 UTC
> Naturally there are X complex ways to still have non-unified paths.
> But that is for me out of scope,.

A half-solution that doesn't solve the full problem (and which wouldn't be a problem to most users), but breaks the workflows of users who want to use symlinks...
Comment 9 Ganton 2023-03-01 20:53:27 UTC
(In reply to nfxjfg from comment #8)
> > Naturally there are X complex ways to still have non-unified paths.
> > But that is for me out of scope,.
> 
> A half-solution that doesn't solve the full problem (and which wouldn't be a
> problem to most users), but breaks the workflows of users who want to use
> symlinks...

That's unfortunately true...