From: Thomas Glanzmann Date: Fri, 20 May 2005 21:16:34 GMT Subject: Re: gitweb wishlist Message-ID: <20050520211634.GA20003@cip.informatik.uni-erlangen.de> In-Reply-To: <428E4D8C.3020606@zytor.com> Hello, I imported the mutt-cvs for the 1.5 branch into GIT using the following script. But it is a hack. I also think that I will use something like that to build a CVS->GIT vendortracking. cvsps -x -z 10 -b HEAD -g -p ../../patches/ And using the attached script to import the patches in GIT. It works quiet well. See also msgid: 1115080139.21105.18.camel@localhost.localdomain there are the scripts which he used to convert the CVS to GIT for HPA. My scripts are based on his work. Thomas #!/usr/bin/perl use strict; use warnings; use File::Temp qw/ tempfile tempdir /; # --------------------- # PatchSet 1 # Date: 2002/07/23 07:41:30 # Author: hpa # Branch: HEAD # Tag: (none) # Log: # Initial revision # # Members: # klibc.cvsroot/snprintf.c:INITIAL->1.1 # klibc.cvsroot/vsnprintf.c:INITIAL->1.1 # klibc.cvsroot/klibc/Makefile:INITIAL->1.1 # klibc.cvsroot/klibc/snprintf.c:INITIAL->1.1 # klibc.cvsroot/klibc/vsnprintf.c:INITIAL->1.1 # # --- /dev/null 2005-04-30 18:00:24.840397008 +0200 # +++ klibc/klibc.cvsroot/snprintf.c 2005-05-02 19:57:42.879913000 +0200 # @@ -0,0 +1,19 @@ # +/* my $patch = $ARGV[0]; my %committer = ( brendan => [ 'Brendan Cully', 'brendan@kublai.com' ], me => [ 'Michael Elkins', 'me@sigpipe.org' ], roessler => [ 'Thomas Roessler', 'roessler@does-not-exist.org' ] ); my @log = (); $ENV{GIT_AUTHOR_EMAIL} = ""; $ENV{GIT_COMMITTER_EMAIL} = ""; open (my $fd, $patch); while (my $line = <$fd>) { if ($line =~ m/^Date: (.*)/) { $ENV{GIT_AUTHOR_DATE} = $1; } elsif ($line =~ m/^Author: (.*)/) { if (defined($committer{$1})) { $ENV{GIT_COMMITTER_NAME} = @{$committer{$1}}[0]; $ENV{GIT_COMMITTER_EMAIL} = @{$committer{$1}}[1]; $ENV{GIT_AUTHOR_NAME} = @{$committer{$1}}[0]; $ENV{GIT_AUTHOR_EMAIL} = @{$committer{$1}}[1]; } else { $ENV{GIT_COMMITTER_NAME} = $1; $ENV{GIT_AUTHOR_NAME} = $1; } } elsif ($line =~ m/^Log:/) { while (my $line = <$fd>) { if ($line =~ m/^Members: $/) { pop(@log); last; } elsif ($line =~ /^From: (.+) <([^>]+@[^>]+)>$/) { $ENV{GIT_AUTHOR_NAME} = $1; $ENV{GIT_AUTHOR_EMAIL} = $2; } push @log, $line; } } } close($fd); my ($fh, $logfile) = tempfile(CLEANUP => 1); print $fh @log; system("git patch $patch < $logfile"); close($fh);