bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bug#286938: diff: could support comparison among remote files (fwd)


From: Bob Proulx
Subject: Re: Bug#286938: diff: could support comparison among remote files (fwd)
Date: Sun, 9 Jan 2005 12:23:21 -0700
User-agent: Mutt/1.5.6+20040907i

Santiago Vila wrote:
> Received this from the Debian bug system:
> From: Patricio Rojo <address@hidden>
> Date: Wed, 22 Dec 2004 21:46:30 -0500
> Subject: Bug#286938: diff: could support comparison among remote files
> 
> Package: diff
> Severity: wishlist
> 
> It will be nice to be able to compare through a remote shell with a 
> sintax typical to ssh or rsync, something like
> 
>              diff file.txt mycomputer.mynet.com:/tmp/file.txt

Please do not bloat diff (and by implication, cmp, cat, grep, sed,
awk, etc., etc.) with these features.  Where would it stop?  By
argument of the absurd would you also wishlist a fully graphical IDE
into diff to be able to see and merge differences too?

Please no.

> to avoid using
>              ssh mycomp.mynet.com cat /tmp/file.txt | diff file.txt -

That does not seem particularly bad to me.  There are alternatives.

If you really wanted to shorten your typing you should create a script
to save you the keystrokes.  Something like this perhaps?  Untested.

#!/bin/sh
# usage: sshdiff file file
trap 'rm -f $TMPFILE1 $TMPFILE2' EXIT
F1="$1"
case $1 in
    *:*)
        TMPFILE1=$(mktemp -t sshdiff.XXXXXX) || exit 1
        scp -q $1 $TMPFILE1 || exit 1
        F1=$TMPFILE1
        ;;
esac
F2="$2"
case $2 in
    *:*)
        TMPFILE2=$(mktemp -t sshdiff.XXXXXX) || exit 1
        scp -q $2 $TMPFILE2 || exit 1
        F2=$TMPFILE2
        ;;
esac
diff $F1 $F2

Bob




reply via email to

[Prev in Thread] Current Thread [Next in Thread]