[prev in list] [next in list] [prev in thread] [next in thread] 

List:       unison-users
Subject:    [unison-users] Honouring .cvsignore in unison
From:       Keith Wansbrough <keith.wansbrough () cl ! cam ! ac ! uk>
Date:       2004-04-15 16:04:33
Message-ID: E1BE9Lt-0002tF-00 () mta1 ! cl ! cam ! ac ! uk
[Download RAW message or body]

Hi... a while ago we talked about modifying unison to take .cvsignore 
files into account - recall a .cvsignore file is a whitespace-separated 
list of glob patterns of files that should be ignored by the CVS 
version control system.  It seems reasonable that these should not be 
synchronised, either - they tend to be large generated files.

While Unison hasn't been modified, I have written a small Perl script 
"cvs2unison" that others may find useful.  It translates a list of 
.cvsignore files into a unison configuration file that can be included 
in your profile.  Typical usage:

cd /root/of/unison/sync
find . -name .cvsignore | xargs cvs2unison > ~/.unison/foo.ignores

(replace "." with the path to your repository if you don't want to scan 
the entire tree).

Then put "include foo.ignores" in your profile (in ~/.unison/*.prf).

Obviously the file is not automatically updated; simply rerun as 
necessary.

Enjoy!

--KW 8-)



------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for your HP, Epson, Canon or Lexmark
Printer at MyInks.com.  Free s/h on orders $50 or more to the US & Canada.
http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/26EolB/TM
---------------------------------------------------------------------~->

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
     http://groups.yahoo.com/group/unison-users/

<*> To unsubscribe from this group, send an email to:
     unison-users-unsubscribe@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
     http://docs.yahoo.com/info/terms/
 

["cvs2unison" (text/plain)]

#!/usr/bin/perl -w
# convert .cvsignore files to an ignore include file for Unison.

# Keith Wansbrough <Keith.Wansbrough@cl.cam.ac.uk>, 2004-04-15.
# This code is in the public domain.  Do what you like with it.
# No warranty, express or implied.  Use at your own risk.

# expects to be run from the root of the sync, and to be passed the
# relative paths of all the .cvsignore files on the command line.
# Output can be written to a file, included in the .prf file with
# "include foo".

# typical command line:
#
# find . -name .cvsignore | xargs cvs2unison > ~/.unison/wap.ignores
#

use strict;
use File::Basename;

my $date = `date`; chomp $date;

print "# generated file; do not edit!\n";
print "# written by $0 on $date\n";

while (<>) {
    my $dir = File::Basename::dirname($ARGV); 
    $dir =~ s{^\./}{};
    foreach my $glob (grep($_ ne "",split)) {
        print "ignore = Path $dir/$glob\n";
    }
}
    



Keith Wansbrough <kw217@cl.cam.ac.uk>
http://www.cl.cam.ac.uk/users/kw217/
University of Cambridge Computer Laboratory.



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic