summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9c1fa70)
raw | patch | inline | side by side (parent: 9c1fa70)
author | Sven Verdoolaege <skimo@kotnet.org> | |
Mon, 11 Jul 2005 14:57:49 +0000 (16:57 +0200) | ||
committer | Linus Torvalds <torvalds@g5.osdl.org> | |
Mon, 11 Jul 2005 17:26:07 +0000 (10:26 -0700) |
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>
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>
Documentation/git-cvsimport-script.txt | patch | blob | history | |
git-cvsimport-script | patch | blob | history |
index 4eb0f432469797809a2c25171b53a17a5be5725a..05145e93830227ed4bc8079c8b473a6cc8f5c8e0 100644 (file)
--------
'git-cvsimport-script' [ -o <branch-for-HEAD> ] [ -h ] [ -v ]
[ -d <CVSROOT> ] [ -p <options-for-cvsps> ]
- [ -C <GIT_repository> ] [ <CVS_module> ]
+ [ -C <GIT_repository> ] [ -i ] [ <CVS_module> ]
DESCRIPTION
currently, only the :local:, :ext: and :pserver: access methods
are supported.
+-i::
+ Import-only: don't perform a checkout after importing. This option
+ ensures the working directory and cache remain untouched and will
+ not create them if they do not exist.
+
-o <branch-for-HEAD>::
The 'HEAD' branch from CVS is imported to the 'origin' branch within
the git repository, as 'HEAD' already has a special meaning for git.
diff --git a/git-cvsimport-script b/git-cvsimport-script
index 666de6f09a0c5bd526ec8c526cdfdec15432b580..0ed12ff34b61295d1824f891f2fae3bafc6a4bbe 100755 (executable)
--- a/git-cvsimport-script
+++ b/git-cvsimport-script
$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();
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;
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");