Re: Passing a single directory or file to meld



On Tue, Mar 19, 2013 at 10:13 PM, Kai Willadsen <kai willadsen gmail com> wrote:
On 19 March 2013 23:31, Angel Ezquerra <angel ezquerra gmail com> wrote:
Hi,

currently if you pass a single directory to meld it tries to open it
in "version control mode". Personally I can see the value of that mode
but I do not use it myself. Instead what I often want to do (on
Windows) is to use the meld shortcut that Kai's installer creates on
the "Send to" context menu to start a diff between two directories or
files.

For example, if you want to compare two folders that happen to be on
the same location (i.e. on the same directory) you can just select the
two folders on Windows Explorer, right click, select "Send To / Meld"
and voila, meld opens and diffs the two directories. You can do the
same with two files which are on the same directory.

The problem comes when you try to compare two directories of files
that are on different locations on your hard drive. In that case you
cannot use the meld "send to" shortcut, because if you use it with the
first directory, meld will just try to open it in VCS mode!

If you try to do the same with a single file (rather than a directory)
it does not work either. In fact the file that you pass to meld seems
to be ignored, and meld just opens with the default "startup window"
that lets you choose the mode.

So I'd like to ask if there is some way around this. If not it would
be nice to be able to tell meld not to start in VCS mode, and just
take the input file or directory name that you pass to it and put it
on the left panel.

There's no way around this, and I'd rather not add more command line
options if we don't have to. I've seen this dealt with on Gnome +
Nautilus by having an extension that allows you to queue up items for
comparison. See for example:
    http://my.opera.com/bachkhois/blog/2011/07/19/compare-files-with-meld-from-within-nautilus

That is similar to what Araxis Merge does and it works very well. The
drawback is that, as you said, it requires to write an explorer
extension.

I have no idea what the limitations of the Windows 'Send To' command
or explorer extensions are. Would it be possible to have some kind of
similar queuing implementation there?

The nice thing about the "Send to" menu is its simplicity. You simply
add a shortcut to your executable in the "SendTo" directory (which is
in "%userprofile%\SendTo" in WindowsXP and in
"%APPDATA%\Microsoft\Windows\SendTo" in Windows 7) and the shortcut
appears in your Windows Explorer context menu.

When you right click on a file and select a SendTo entry it will
simply execute the program that the shortcut points to and pass the
name of the file as its only parameter. If you need more parameters
you can set them on the shortcut itself.

So with a SendTo shortcut you can only pass one or more files or
directories, and they must be on the same directory because you cannot
select files or directories from different directories using Windows
Explorer.

Either way, the problem is that giving Meld a single directory is
inherently ambiguous. You'd have to have "Send To -> Meld as folder
comparison" and "Send To -> Meld as VC comparison" entries, which
seems like overkill to me.

I think this is precisely a very good reason why I think melds needs
to let the user tell it what to do. Since the operation is ambiguous,
meld should not have to guess. Currently it always "guesses" that the
user wants to do a VC comparison, which is not useful if you do not
want to use the VC functionality of meld (as in my case).

Another use case for being able to open a diff with a single file is
when you want to compare a file with some text that you want to write
or perhaps when you want to compare a file with what you have on the
clipboard. Sometimes you may want to compare two parts of a file using
copy/paste, for example. This is something that I often do, and which
is easy to do with many diff tools (e.g. araxis, WinMerge) but is not
possible (or not easy) with meld.

So I think it would be great to have a way to tell meld to open "an
empty comparison" or to diff a single file with an "empty file" that
you may edit yourself (by typing, using copy paste, etc). It seems
that this would require an extra command line option, but in this case
it seems that there would be a good reason to do so.

What's the use-case distinction in Windows-land between opening
something and Send-To-ing something?

There is no difference as I explained above. You just execute the
program that  a shortcut points to, passing the file (or directory)
name(s) to it.

Cheers,

Angel


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