Re: [PATCH] Copying Symlinks



On 17 August 2012 06:47, Jeff Oliver <kaiserfro gmail com> wrote:
> A friend of mine was attempting to use Meld for diffing and merging
> directories that contained a mixture of files and links.  It ends up being a
> bit unintuitive as to what you end up seeing when you look at a directory
> diff with links.
>
> 1) There is no indication that a file is really a link.

Yeah, this is a real problem. It wouldn't be hard to display
something; it's just that we don't currently have any additional
columns or cellrenderers in the directory comparison to show extra
detail. More of a decide-on-the-UI problem than anything else.

> 2) A link may end up being different if the dereferenced files are
> different.  This can happen 2 ways.  First the links are the same but the
> files they point to are different in each window or if the links are
> different and the files are different.

IIRC, there's no direct comparison of symlinks going on in Meld. We
have some extra handling for following directory symlinks, and file
symlinks are just treated as files (except when copying). Symlinks
should only ever show as different when the files they point to are
actually different.

...if that's not what you're seeing, please do file a bug.

> If the files end up being the same,
> but the links are different, I think you end up seeing a little star in the
> icon.

The star indicates recency, nothing else. The file with the star has
the most recent mtime of all the files/directories in that row.

> 3) Attempting to copy a link in either direction fails with an error dialog
> indicating that you cannot copy the file.

That... shouldn't happen. If you're just copying a link across, it
should definitely work. Looking at misc.copy2(), it seems like we
don't handle the case where you're copying a symlink over another
file. Is that the problem you're seeing?

> I made a quick and probably dirty patch to allow my friend to use meld for
> links.  All this patch attempts to address is last item, at least making it
> usable in copying links from dir to dir.
>
> There is no extensive testing of the patch, but I'd like to have someone
> have a look at it.

So the idea behind the patch seems okay to me, but we do already try
to handle symlinks in misc.copy2(). Before making any changes to this
(symlinks have been a pain point in the past) I'd like to be certain
what's not working.

cheers,
Kai


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]