#11 diffuse . /path/to/file misbehaves - no directory comparison

Moritz Barsnick

diffuse behaves differently depending on the order of arguments when passing a single file and a directory as arguments.

Assume you have a certain file "filename.txt" in your currentl directory ".", and one to compare with in a subdirectory "subdir".

Pure file comparison might be:
diffuse filename.txt subdir/filename.txt

This particular use case is as such:
diffuse . subdir/filename.txt
and this does not work. An error pops up stating 'Error processing argument ".". Directory not expected.' If you click away the error message, the file is compared against nothing.

On the other hand
diffuse subdir/filename.txt .
does work as expected.

Does diffuse not handle diffing directories at all, except with "-m"?
diffuse -m . subdir/locale.txt
diffuse -m . subdir/
(both without revision control) does exactly nothing and exits with return code 0.

And why does
diffuse subdir/filename.txt .
actually work?


  • Derrick Moser
    Derrick Moser

    Diffuse does not compare directories at all yet but this is planned. Eventually I would like Diffuse to recognise what type of comparison is being requested by checking whether the first argument specifies a file or a directory. This would let Diffuse be used in either mode without requiring the user to remember and type additional command line options.

    There was a feature request (which was implemented) a long time ago to allow users to abbreviate commands like "diffuse a/foo.txt b/foo.txt" to simply "diffuse a/foo.txt b/" like some other diff tools support. When Diffuse encounters directory arguments, it just appends the base name from the previous file argument. This is why Diffuse interprets "diffuse subdir/filename.txt ." like "diffuse subdir/filename.txt ./filename.txt".

    "diffuse -m" does something different. It asks the version control system which files have local modifications. If you are only interested in a subset of the files, you can specify the directories or individual files that interest you. In the most recent version of Diffuse, the "diffuse -c rev" command works the same way. I guess "diffuse -m" should really throw an error if the directory is not under version control.