Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DirDiff should be able to exclude binary files without having to specify all expected filename patterns #15

Open
timblaktu opened this issue Oct 6, 2017 · 3 comments

Comments

@timblaktu
Copy link

First, thank you - DirDiff works great and is a huge help in my workflow!

I generally want to exclude binary files but it appears that DirDiffExcludes () only supports filename pattern matching. It'd be nice if it could also exclude based on file attributes like executable, so that you can ignore binary files without having to specify the filename patterns for all my expected executables.

Perhaps there's another way of excluding binary files I'm missing. I had hoped that I could just use DirDiffAddArgs for this, but apparently the diff command I'm using (diff (GNU diffutils) 3.3) doesn't have an innate ability to ignore binaries.

@will133
Copy link
Owner

will133 commented Oct 11, 2017 via email

@097115
Copy link

097115 commented Jul 27, 2019

I think I usually just exclude with file patterns.

May be it'd possible to make vim-dirdiff to respect .gitignore, for example? :)

@pcybulski
Copy link

Thank you for DirDiff plugin without it my work would be much harder.

I do a lot of merges on git repositories by comparing two directories and could not find a method to exclude .git directory. I wrote a simple script that before launching DirDiff it moves .git directories to temporary location, then starts DirDiff, onece edition of files is finished then .git directories are moved back to previous location.

I will paste the script below together with alias because I do not know if I can add it to this repository. Please remove it if you will fill that it is not appropriate in here.

#!/bin/bash

if [ "$#" -ne 2 ]; then
echo "You must provide two arguments with different directory names to compare"
else

    tempDir="/tmp/DirDiff"
    mkdir -p ${tempDir}


    mkdir ${tempDir}/$1
    mkdir ${tempDir}/$2

    mv ${1}/.git ${tempDir}/$1
    mv ${2}/.git ${tempDir}/$2


    vim -c "DirDiff $1 $2"

    mv  ${tempDir}/$1/.git   ${1}/ && rmdir ${tempDir}/$1
    mv  ${tempDir}/$2/.git   ${2}/ && rmdir ${tempDir}/$2

fi

And the alias
grep vd /etc/bash.bashrc
alias vd='/usr/local/bin/DirDiff.sh'

Once again thank you for the great tool.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants