* [PATCH] git-cvsimport-script: add "import only" option
@ 2005-07-11 14:57 Sven Verdoolaege
0 siblings, 0 replies; only message in thread
From: Sven Verdoolaege @ 2005-07-11 14:57 UTC (permalink / raw
To: Linus Torvalds; +Cc: Matthias Urlichs, git
git-cvsimport-script: add "import only" option.
Acked-by: Matthias Urlichs <smurf@smurf.noris.de>
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
---
commit 1be6fbebb010083a083d8e2ee69fced7b6ae1261
tree a69017b2d10fd0a2655070d177f7cf59ab21882f
parent a3eb250f996bf5e12376ec88622c4ccaabf20ea8
author Sven Verdoolaege <skimo@kotnet.org> Mon, 11 Jul 2005 16:17:25 +0200
committer Sven Verdoolaege <skimo@kotnet.org> Mon, 11 Jul 2005 16:17:25 +0200
Documentation/git-cvsimport-script.txt | 7 ++++++-
git-cvsimport-script | 18 +++++++++++-------
2 files changed, 17 insertions(+), 8 deletions(-)
diff --git a/Documentation/git-cvsimport-script.txt b/Documentation/git-cvsimport-script.txt
--- a/Documentation/git-cvsimport-script.txt
+++ b/Documentation/git-cvsimport-script.txt
@@ -11,7 +11,7 @@ SYNOPSIS
--------
'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
@@ -29,6 +29,11 @@ OPTIONS
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
--- 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");
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2005-07-11 18:11 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-11 14:57 [PATCH] git-cvsimport-script: add "import only" option Sven Verdoolaege
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).