[p4] perforce vs. subversion

Arnt Gulbrandsen arnt at gulbrandsen.priv.no
Sat May 6 07:27:49 PDT 2006


Ken.Williams at thomson.com writes:
> I think one big one for a lot of people is to easily know what files 
> are "new" without actually adding them. You don't have to use a 
> CVS-style workflow to want that one.

Here's the one we use:

#!/bin/sh
# report all files in this directory and its subdirectories which aren't
# version-controlled and look as if they might be.
#
# if at least one .x file is version-controlled, this script assumes that
# all .x files should be.
TMP=/tmp/$$-unp4
p4 have ... | sed 's/^.* - //' > ${TMP}-a
EXT=`cat ${TMP}-a | sed 's/^.*[\.]//' | grep -v / | sort -u`
DIR=`cat ${TMP}-a | sed 's/\/[^\/]*$//' | sort -u`
echo find $DIR -maxdepth 1 -name \\\*.`echo $EXT | sed 's/ / -o -name 
\\\*./g'`| sh > ${TMP}-b
cat ${TMP}-{a,a,b} | sort | uniq -u | sed -e s_^${PWD}_._ -e s_^\./__
rm ${TMP}-{a,b}

Arnt


More information about the perforce-user mailing list