Christian Ohler <[EMAIL PROTECTED]> writes:

> Thanks for the explanation.  I investigated this in some more detail.
> It turns out that `dvc-tree-root' is not involved here; the real
> problem is that `dvc-find-tree-root-file-first' returns a directory
> name with no terminating slash.
>
> The function `dvc-uniquify-file-name' is a really big hammer that is
> almost never needed.  It would be preferable to remove it entirely
> since its existence seems to seduce people into using it even when
> it's overkill.  The function seems convenient at first but is usually
> not what you want because it has the undesirable side-effect of
> expanding symlinks in the file name.  Also, in situations like this,
> it is just a way to cover up a problem in a different part of the
> code.

I agree that this function is almost never needed, and its use should be
seriously reduced, and perhaps completely eliminated.  I often track
projects in paths that have symlinks, and it can be very annoying to
have the path change on me -- I'll end up visiting directories and files
twice.

If there is a case where we need to check if a directory is already
tracked in another buffer via a different symlink route, we ought to use
a (new) function like `dvc-paths-unique-p' for this purpose, rather than
using `dvc-uniquify-file-name' and `string='.

> In this case, a simple call to `file-name-as-directory' in the right
> place (in `dvc-find-tree-root-file-first') did the trick and prevents
> other related problems as well.  I replaced your fix with this one in
> my branch.

I pulled your changes into my branch as well.

-- 
       Michael Olson -- FSF Associate Member #652     |
 http://mwolson.org/ -- Jabber: mwolson_at_hcoop.net  |  /` |\ | | |
            Sysadmin -- Hobbies: Lisp, GP2X, HCoop    | |_] | \| |_|
Projects: Emacs, Muse, ERC, EMMS, ErBot, DVC, Planner |

Attachment: pgpLaAWzAtuDP.pgp
Description: PGP signature

_______________________________________________
Dvc-dev mailing list
[email protected]
https://mail.gna.org/listinfo/dvc-dev

Reply via email to