summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 35cc4bc)
raw | patch | inline | side by side (parent: 35cc4bc)
author | Johannes Schindelin <Johannes.Schindelin@gmx.de> | |
Wed, 17 Aug 2005 09:19:20 +0000 (11:19 +0200) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Wed, 17 Aug 2005 19:13:12 +0000 (12:13 -0700) |
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>
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>
Documentation/git-cvsimport-script.txt | patch | blob | history | |
git-cvsimport-script | patch | blob | history |
index 61713d859cce24ec4a62f50abdcfb22829d432ca..ae46b2f0722387ce7cb4b30e5867b11c7bd0de72 100644 (file)
--------
'git-cvsimport-script' [ -o <branch-for-HEAD> ] [ -h ] [ -v ]
[ -d <CVSROOT> ] [ -p <options-for-cvsps> ]
- [ -C <GIT_repository> ] [ -i ] [ -k ] [ <CVS_module> ]
+ [ -C <GIT_repository> ] [ -i ] [ -k ]
+ [ -s <subst> ] [ <CVS_module> ]
DESCRIPTION
-z <fuzz>::
Pass the timestamp fuzz factor to cvsps.
+-s <subst>::
+ Substitute the character "/" in branch names with <subst>
+
OUTPUT
------
If '-v' is specified, the script reports what it is doing.
diff --git a/git-cvsimport-script b/git-cvsimport-script
index a6a6f0db3984c5d56d9ef1c79357ea95549f8985..2f39af33d9c5d0054268ba6a2d400368b518d5ba 100755 (executable)
--- a/git-cvsimport-script
+++ b/git-cvsimport-script
$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();
die "CVSROOT needs to be set";
}
$opt_o ||= "origin";
+$opt_s ||= "-";
my $git_tree = $opt_C;
$git_tree ||= ".";
$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+//) {