aboutsummaryrefslogtreecommitdiffstats
path: root/git-cvsimport-script
diff options
context:
space:
mode:
authorSven Verdoolaege <skimo@kotnet.org>2005-07-11 16:57:49 +0200
committerLinus Torvalds <torvalds@g5.osdl.org>2005-07-11 10:26:07 -0700
commitc1c774e7965ba08061c3fc7bc57aebc7eeb6b40f (patch)
tree82386ad21d8079330bf8fc46c27aee8e33040e52 /git-cvsimport-script
parent9c1fa70aaa03f48fb172f9a96d57148f144bc3a9 (diff)
downloadgit-c1c774e7965ba08061c3fc7bc57aebc7eeb6b40f.tar.gz
[PATCH] git-cvsimport-script: add "import only" option
git-cvsimport-script: add "import only" option which tells the script not to perform a checkout after importing. This ensures that the working directory and cache remain untouched and will not create them if they do not exist. Acked-by: Matthias Urlichs <smurf@smurf.noris.de> Signed-off-by: Sven Verdoolaege <skimo@kotnet.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'git-cvsimport-script')
-rwxr-xr-xgit-cvsimport-script18
1 files changed, 11 insertions, 7 deletions
diff --git a/git-cvsimport-script b/git-cvsimport-script
index 666de6f09a..0ed12ff34b 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_d,$opt_p,$opt_C,$opt_z);
+our($opt_h,$opt_o,$opt_v,$opt_d,$opt_p,$opt_C,$opt_z,$opt_i);
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 ]
- [ CVS_module ]
+ [ -i ] [ CVS_module ]
END
exit(1);
}
-getopts("hvo:d:p:C:z:") or usage();
+getopts("hivo:d:p:C:z:") or usage();
usage if $opt_h;
@ARGV <= 1 or usage();
@@ -723,8 +723,10 @@ if($orig_branch) {
print "DONE\n" if $opt_v;
system("cp","$git_dir/refs/heads/$opt_o","$git_dir/refs/heads/master")
if $forward_master;
- system('git-read-tree', '-m', '-u', 'CVS2GIT_HEAD', 'HEAD');
- die "read-tree failed: $?\n" if $?;
+ unless ($opt_i) {
+ system('git-read-tree', '-m', '-u', 'CVS2GIT_HEAD', 'HEAD');
+ die "read-tree failed: $?\n" if $?;
+ }
} else {
$orig_branch = "master";
print "DONE; creating $orig_branch branch\n" if $opt_v;
@@ -732,7 +734,9 @@ if($orig_branch) {
unless -f "$git_dir/refs/heads/master";
unlink("$git_dir/HEAD");
symlink("refs/heads/$orig_branch","$git_dir/HEAD");
- system('git checkout');
- die "checkout failed: $?\n" if $?;
+ unless ($opt_i) {
+ system('git checkout');
+ die "checkout failed: $?\n" if $?;
+ }
}
unlink("$git_dir/CVS2GIT_HEAD");