Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: cvsvimdiff zshism



Chris Johnson <cjohnson@xxxxxxxxxx> writes:

> I've just started using cvs to manage some code, and sometimes I want to
> compare my working copy of a file to some version in the repository.
> cvs diff offers a facility to do this, but I really prefer vim's diff
> capabilities.  With vim, you can do side by side comparison of files,
> changes are highlighted, and so on.
> 
> So, in order to make cvs diff work with vimdiff, I wrote the following
> function that exploits zsh's tmp file substitution mechanism.  It's not
> very robust, 'cuz I don't know all the ways to break it yet.  But here's
> a start:

Why not simply:

  cvsvimdiff() {
     if [[ $# -ne 2 ]] then
        print Usage: $0 old_version file >& 2
        return 1
     fi

     vimdiff $2 =(cvs -Q up -r $1 -p $2)
  }

Patching is unnecessary when you can extract the old version
directly...

Phil.



Messages sorted by: Reverse Date, Date, Thread, Author