Page 1 of 1

drag N Drop diff new version 2-28-2012

Posted: 05 Feb 2012, 22:05
by bigbass
it is very easy dragndrop one file into the input box
then dragndrop the second file you want to compare it to
thats it

it will auto make a diff and save it in $HOME
the diff result gets auto opened with your default text editor

I use this one a lot and thought to share
Joe


Image

Code: Select all

#!/bin/sh

# Joe Arose
# improved dnd diff 
# used with KDE  or desktops that add file:// to the name 

#------------------------------------------------
SEL=`Xdialog \
--title "diff tool" \
--separator "\n" --stdout \
--2inputsbox "dnd diff" 0 0 \
"this is the original file to diff" "$1" \
"this is the changed file to diff " "$2" `

# lets get the two values in 2 separate arrays
SEL_ARRARY=($SEL)

ORIGINAL_FILE=${SEL_ARRARY[0]}
CHANGED_FILE=${SEL_ARRARY[1]}

#------------------------------------------------


removed_prefix_file_one=`echo ${ORIGINAL_FILE#file://}`
removed_prefix_file_two=`echo ${CHANGED_FILE#file://}`


diff -pruN $removed_prefix_file_one $removed_prefix_file_two >$HOME/`basename $ORIGINAL_FILE`.patch

xdg-open $HOME/`basename $ORIGINAL_FILE`.patch


Re: drag N Drop diff new version 2-28-2012

Posted: 29 Feb 2012, 04:30
by bigbass
rewrite :D

diffs are the best way to keep up with changes
simple and sweet

Image

Re: drag N Drop diff new version 2-28-2012

Posted: 29 Feb 2012, 09:59
by Hamza
Are you sure the Drap n' Drop works on each DE ? even fluxbox or openbox ? :wink: