cvs-utils
[Top][All Lists]
Advanced

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

new script


From: Tom Tromey
Subject: new script
Date: 03 Nov 2002 15:02:04 -0700

Today I wrote the appended script.  It is like cvsdiff but it makes
the diff from the top-most directory in the project.  I want to
encourage people to use this since it will make it easier for me to
apply diffs automatically from Gnus.  The first step is to get it into
cvs-utils.

Maybe there's already a script to do this?  There are two big
problems still: the cvs-utils/cvsutils split, and the lack of docs.

Tom


#!/bin/sh

# mkdiff file ...
# Make a diff from the top of this repository's tree.

test -f CVS/Root || {
   echo "Not in CVS-controlled directory" 1>&2
   exit 1
}

args=
while test $# -gt 0; do
   arg=$1
   case $arg in
    -*)
       args="$args $arg"
       shift
       ;;
    *)
       break
       ;;
   esac
done

here=`pwd`
loc=`cat CVS/Root`
dirname=

while test -d ../CVS && test `cat ../CVS/Root` = $loc; do
   cd ..
   next=`basename $here`
   here=`dirname $here`
   if test -z "$dirname"; then
      dirname=$next
   else
      dirname="$next/$dirname"
   fi
done

if test $# -eq 0; then
   # No arguments means `.'.
   args="$args $dirname"
else
   while test $# -gt 0; do
      arg=$1
      shift
      args="$args $dirname/$arg"
   done
fi

exec cvsdiff $args




reply via email to

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