fourier / ztree

Directory tree comparison mode for Emacs
http://www.emacswiki.org/emacs/ZtreeDiff
GNU General Public License v3.0
239 stars 21 forks source link

Show file permission differences #50

Closed Ambrevar closed 6 years ago

Ambrevar commented 7 years ago

I got bitten hard today by an assumption I made, namely that ztree would show file permission differences.

It's an important feature for a file comparison tool, I would love to see this implemented.

fourier commented 6 years ago

Thanks for reporting. I'll take a look on how to get file permissions in GNU Emacs; command-line diff tool which I use to compare files doesn't know about file permissions. Out of curiosity, what is the use-case for this feature? I never ever needed anything like this in my professional carrier.

Ambrevar commented 6 years ago

Indeed, regular diff tools don't do it. The only tools I know which do this are rsync (e.g. rsync -nirv --perms --size-only DIR1/ DIR2) and Beyond Compare (proprietary).

Use case? Well, file attributes contribute to what defines the files, don't they? Otherwise they would not be there. tar can store them, rsync can sync them, git preserves them, etc.

More specifically: I was working on product with a huge number of files. I had 2 versions, 1 was working, the other one was crashing. I couldn't figure out why since both file trees were identical according to ztree. Until I found out that some executables had had their x flag taken away at some point...

fourier commented 6 years ago

Hi @Ambrevar , please try the recent version, it will show files with different modes (+x/-x etc) os differences. It doesn't show though what are the differences (yet).

fourier commented 6 years ago

Forgot to mention: you have to add (setq ztree-diff-consider-file-permissions t) to your config in order for this feature to be active.

Ambrevar commented 6 years ago

Nice! Thanks for that one! Waiting for more visual details then :D

Ambrevar commented 6 years ago

I just tested and it works like a charm!

fourier commented 6 years ago

Great. I'll close this issue for now then and open #57 as an enhancement.