Tag Info

New answers tagged


Unfortunately the plain diff from GNU diffutils cannot handle changes such as b (remove empty files). makepatch might be useful for that situation. It's available as a package on Debian/Ubuntu.


You could also filter the buffer through diff using the %! syntax: :%! diff -au "%" - This will fill the buffer with the diff, rather than writing it to disk; you may want to set readonly so you don't clobber the original by accident (OTOH, that shouldn't be a serious problem because you have the file under version control, right?). Of course, it helps ...


It's possible to do this without a plugin using the w command, so the buffer contents can be used in a shell command: :w !diff -au "%" - > changes.patch (% is substituted with the path of the file being edited, - reads the buffer from stdin)


diff -qrN is about as fast as it gets to compare two directory trees. The -q option makes it quit early when files differ. Since you expect the files to be identical most of the time, it doesn't matter all that much: the comparison tool has to read and compare the whole files anyway. The only improvement you can make on diff is to avoid checking out from ...


Interesting problem. Using Git itself might be an easy solution. The following demonstrates the comparison between Redmine's Subversion repository https://svn.redmine.org/redmine and its GitHub mirror https://github.com/redmine/redmine for tag 3.0.3: $ git clone https://github.com/redmine/redmine $ cd redmine $ git checkout 3.0.3 $ find -mindepth 1 ...


The first issue is the control Z, in a standard setup, it suspends the job, leaving it in the background not running. You will notice this with exit, which will tell you you have stopped jobs. (other job control commands may also) What you wanted was Control D which when typed at a terminal sends an End of File. This is very different from dos and windows. ...


#!/bin/bash while : do echo Paste some input, then press Control-D: cat > /tmp/sortme ; diff <(sort /tmp/sortme) <(sort -u /tmp/sortme) done

Top 50 recent answers are included