Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schindelin <Johannes.Schindelin@gmx.de>2005-08-17 13:19:20 +0400
committerJunio C Hamano <junkio@cox.net>2005-08-17 23:13:12 +0400
commitfbfd60d65142848299513dfa6b477d0f5299cc15 (patch)
treeede2321852443a61f5383a350475e088e4d8fe26 /git-cvsimport-script
parent35cc4bcd10862db190df9685b7ad221f2a25404f (diff)
[PATCH] Also handle CVS branches with a '/' in their name
I track a CVS project which has a branch with a '/' in the branch name. Since git wants the branch name to be a file name at the same time, substitute that character to a '-' by default (override with "-s <subst>"). This should work well, despite the fact that a division and a difference are completely different :-) Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'git-cvsimport-script')
-rwxr-xr-xgit-cvsimport-script8
1 files changed, 5 insertions, 3 deletions
diff --git a/git-cvsimport-script b/git-cvsimport-script
index a6a6f0db39..2f39af33d9 100755
--- a/git-cvsimport-script
+++ b/git-cvsimport-script
@@ -28,19 +28,19 @@ use POSIX qw(strftime dup2);
$SIG{'PIPE'}="IGNORE";
$ENV{'TZ'}="UTC";
-our($opt_h,$opt_o,$opt_v,$opt_k,$opt_d,$opt_p,$opt_C,$opt_z,$opt_i);
+our($opt_h,$opt_o,$opt_v,$opt_k,$opt_d,$opt_p,$opt_C,$opt_z,$opt_i,$opt_s);
sub usage() {
print STDERR <<END;
Usage: ${\basename $0} # fetch/update GIT from CVS
[ -o branch-for-HEAD ] [ -h ] [ -v ] [ -d CVSROOT ]
[ -p opts-for-cvsps ] [ -C GIT_repository ] [ -z fuzz ]
- [ -i ] [ -k ] [ CVS_module ]
+ [ -i ] [ -k ] [-s subst] [ CVS_module ]
END
exit(1);
}
-getopts("hivko:d:p:C:z:") or usage();
+getopts("hivko:d:p:C:z:s:") or usage();
usage if $opt_h;
@ARGV <= 1 or usage();
@@ -59,6 +59,7 @@ if($opt_d) {
die "CVSROOT needs to be set";
}
$opt_o ||= "origin";
+$opt_s ||= "-";
my $git_tree = $opt_C;
$git_tree ||= ".";
@@ -621,6 +622,7 @@ while(<CVS>) {
$state = 4;
} elsif($state == 4 and s/^Branch:\s+//) {
s/\s+$//;
+ s/[\/]/$opt_s/g;
$branch = $_;
$state = 5;
} elsif($state == 5 and s/^Ancestor branch:\s+//) {