TMSU icon indicating copy to clipboard operation
TMSU copied to clipboard

the same file under two different paths (with symlinks) is not recognized as one

Open rfourquet opened this issue 5 years ago • 4 comments

An option to change that would very useful. For example:

$ mkdir test; ln -s test test2; cd test2/; touch file; tmsu tag file atag; tmsu tags file
atag
$ cd -P . ; tmsu tags file # called from ~/test/, nothing printed
$ 

If this is intended behavior, it would be great to have an option to get paths normalized in the database, so that tags do not depend on the specific path used at tag creation time or at query time.

rfourquet avatar Oct 24 '18 16:10 rfourquet

Hi, thanks for the suggestion.

I made the tag command follow symlinks already, I guess it would make sense for the other commands to do so too (gap). I'll take a look.

oniony avatar Nov 08 '18 11:11 oniony

The tag subcommand doesn't fully handle symlinked directories. In my test case, $HOME/Downloads is a symlink to "/mnt/d/Users/user/Downloads". Opening $HOME/Downloads and tagging a file gives a different result depending on whether it is tagged with absolute or relative path. (tmsu files will list them with relative or absolute path, depending on how they were tagged. I assume if tag used path/link resolution logic like realpath, tmsu files would list both paths in the same format.)

lefth avatar Jan 12 '21 09:01 lefth

This might be a duplicate of #168 (or vice-versa, but there is more discussion there than here).

ipkiss42 avatar Jan 12 '21 12:01 ipkiss42

What I brought up has a really easy fix. In fact I fixed it locally. Let me clean it up and make a PR tomorrow.

lefth avatar Jan 12 '21 15:01 lefth