[PATCH 1/5] cvsimport: sync usage lines with existing options

Previous thread: [PATCH] Make builtin-branch.c handle the git config file by Lars Hjemli on Friday, April 6, 2007 - 5:13 am. (1 message)

Next thread: [PATCH 5/5] cvsimport: Improve formating consistency by Frank Lichtenheld on Friday, April 6, 2007 - 2:52 pm. (1 message)
From: Frank Lichtenheld
Date: Friday, April 6, 2007 - 2:52 pm

I played around with git-cvsimport the last days a bit and stumbled
upon a few inconsistencies in the documentation. This patch
series tries to fix them.

 Documentation/git-cvsimport.txt |   79 ++++++++++++++++++++--------------------
 git-cvsimport.perl              |   17 ++++----
 2 files changed, 50 insertions(+), 46 deletions(-)


-

From: Frank Lichtenheld
Date: Friday, April 6, 2007 - 2:52 pm

Sync both the usage lines in the code and the asciidoc
documentation with the real list of options. While
all options seems to be documented in the asciidoc
document, not all of them were listed in the usage line.

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.de>
---
 Documentation/git-cvsimport.txt |    8 +++++---
 git-cvsimport.perl              |    5 +++--
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/Documentation/git-cvsimport.txt b/Documentation/git-cvsimport.txt
index 0d59c06..8374d90 100644
--- a/Documentation/git-cvsimport.txt
+++ b/Documentation/git-cvsimport.txt
@@ -9,9 +9,11 @@ git-cvsimport - Salvage your data out of another SCM people love to hate
 SYNOPSIS
 --------
 [verse]
-'git-cvsimport' [-o <branch-for-HEAD>] [-h] [-v] [-d <CVSROOT>] [-s <subst>]
-	      [-p <options-for-cvsps>] [-C <git_repository>] [-i] [-P <file>]
-	      [-m] [-M regex] [<CVS_module>]
+'git-cvsimport' [-o <branch-for-HEAD>] [-h] [-v] [-d <CVSROOT>]
+	      [-A <author-conv-file>] [-p <options-for-cvsps>] [-P <file>]
+	      [-C <git_repository>] [-z <fuzz>] [-i] [-k] [-u] [-s <subst>]
+	      [-a] [-m] [-M <regex>] [-S <regex>] [-L <commitlimit>]
+	      [<CVS_module>]
 
 
 DESCRIPTION
diff --git a/git-cvsimport.perl b/git-cvsimport.perl
index 1a1ba7b..d3fbcbc 100755
--- a/git-cvsimport.perl
+++ b/git-cvsimport.perl
@@ -36,8 +36,9 @@ sub usage() {
 	print STDERR <<END;
 Usage: ${\basename $0}     # fetch/update GIT from CVS
        [-o branch-for-HEAD] [-h] [-v] [-d CVSROOT] [-A author-conv-file]
-       [-p opts-for-cvsps] [-C GIT_repository] [-z fuzz] [-i] [-k] [-u]
-       [-s subst] [-a] [-m] [-M regex] [-S regex] [CVS_module]
+       [-p opts-for-cvsps] [-P file] [-C GIT_repository] [-z fuzz] [-i] [-k]
+       [-u] [-s subst] [-a] [-m] [-M regex] [-S regex] [-L commitlimit]
+       [CVS_module]
 END
 	exit(1);
 }
-- 
1.5.1

-

From: Frank Lichtenheld
Date: Friday, April 6, 2007 - 2:52 pm

Document the fact that git-cvsimport tries to find out CVSROOT from
CVS/Root and $ENV{CVSROOT} and CVS_module from CVS/Repository.

Also use ` ` syntax for all filenames for consistency.

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.de>
---
 Documentation/git-cvsimport.txt |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/Documentation/git-cvsimport.txt b/Documentation/git-cvsimport.txt
index 8374d90..6a0821a 100644
--- a/Documentation/git-cvsimport.txt
+++ b/Documentation/git-cvsimport.txt
@@ -35,7 +35,9 @@ OPTIONS
 -d <CVSROOT>::
 	The root of the CVS archive. May be local (a simple path) or remote;
 	currently, only the :local:, :ext: and :pserver: access methods 
-	are supported.
+	are supported. If not given, git-cvsimport will try to read it
+	from `CVS/Root`. If no such file exists, it checks for the
+	`CVSROOT` environment variable.
 
 -C <target-dir>::
         The git repository to import to.  If the directory doesn't
@@ -87,6 +89,8 @@ If you need to pass multiple options, separate them with a comma.
 
 <CVS_module>::
 	The CVS module you want to import. Relative to <CVSROOT>.
+	If not given, git-cvsimport tries to read it from
+	`CVS/Repository`.
 
 -h::
 	Print a short usage message and exit.
@@ -124,7 +128,7 @@ git-cvsimport will make it appear as those authors had
 their GIT_AUTHOR_NAME and GIT_AUTHOR_EMAIL set properly
 all along.
 +
-For convenience, this data is saved to $GIT_DIR/cvs-authors
+For convenience, this data is saved to `$GIT_DIR/cvs-authors`
 each time the -A option is provided and read from that same
 file each time git-cvsimport is run.
 +
-- 
1.5.1

-

From: Frank Lichtenheld
Date: Friday, April 6, 2007 - 2:52 pm

Actually tell the user what he did wrong in case of usage errors
instead of only printing the general usage information.

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.de>
---
 git-cvsimport.perl |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/git-cvsimport.perl b/git-cvsimport.perl
index d3fbcbc..ac74bc5 100755
--- a/git-cvsimport.perl
+++ b/git-cvsimport.perl
@@ -32,7 +32,9 @@ $ENV{'TZ'}="UTC";
 our ($opt_h,$opt_o,$opt_v,$opt_k,$opt_u,$opt_d,$opt_p,$opt_C,$opt_z,$opt_i,$opt_P, $opt_s,$opt_m,$opt_M,$opt_A,$opt_S,$opt_L, $opt_a);
 my (%conv_author_name, %conv_author_email);
 
-sub usage() {
+sub usage(;$) {
+	my $msg = shift;
+	print(STDERR "Error: $msg\n") if $msg;
 	print STDERR <<END;
 Usage: ${\basename $0}     # fetch/update GIT from CVS
        [-o branch-for-HEAD] [-h] [-v] [-d CVSROOT] [-A author-conv-file]
@@ -117,7 +119,7 @@ read_repo_config($opts);
 getopts($opts) or usage();
 usage if $opt_h;
 
-@ARGV <= 1 or usage();
+@ARGV <= 1 or usage("You can't specify more than one CVS module");
 
 if ($opt_d) {
 	$ENV{"CVSROOT"} = $opt_d;
@@ -130,7 +132,7 @@ if ($opt_d) {
 } elsif ($ENV{"CVSROOT"}) {
 	$opt_d = $ENV{"CVSROOT"};
 } else {
-	die "CVSROOT needs to be set";
+	usage("CVSROOT needs to be set");
 }
 $opt_o ||= "origin";
 $opt_s ||= "-";
@@ -149,7 +151,7 @@ if ($#ARGV == 0) {
 	chomp $cvs_tree;
 	close $f;
 } else {
-	usage();
+	usage("CVS module has to be specified");
 }
 
 our @mergerx = ();
-- 
1.5.1

-

From: Frank Lichtenheld
Date: Friday, April 6, 2007 - 2:52 pm

The current order the options are documented in makes no sense
at all to me. Reorder them so that similar options are grouped
together and also order them somehwhat by importance.

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.de>
---
 Documentation/git-cvsimport.txt |   54 +++++++++++++++++++-------------------
 1 files changed, 27 insertions(+), 27 deletions(-)

diff --git a/Documentation/git-cvsimport.txt b/Documentation/git-cvsimport.txt
index 6a0821a..a5276f7 100644
--- a/Documentation/git-cvsimport.txt
+++ b/Documentation/git-cvsimport.txt
@@ -32,6 +32,9 @@ any CVS branches, yourself.
 
 OPTIONS
 -------
+-v::
+	Verbosity: let 'cvsimport' report what it is doing.
+
 -d <CVSROOT>::
 	The root of the CVS archive. May be local (a simple path) or remote;
 	currently, only the :local:, :ext: and :pserver: access methods 
@@ -39,10 +42,23 @@ OPTIONS
 	from `CVS/Root`. If no such file exists, it checks for the
 	`CVSROOT` environment variable.
 
+<CVS_module>::
+	The CVS module you want to import. Relative to <CVSROOT>.
+	If not given, git-cvsimport tries to read it from
+	`CVS/Repository`.
+
 -C <target-dir>::
         The git repository to import to.  If the directory doesn't
         exist, it will be created.  Default is the current directory.
 
+-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.
+	Use this option if you want to import into a different branch.
++
+Use '-o master' for continuing an import that was initially done by
+the old cvs2git tool.
+
 -i::
 	Import-only: don't perform a checkout after importing.  This option
 	ensures the working directory and index remain untouched and will
@@ -56,13 +72,8 @@ OPTIONS
 -u::
 	Convert underscores in tag and branch names to dots.
 
--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 ...
Previous thread: [PATCH] Make builtin-branch.c handle the git config file by Lars Hjemli on Friday, April 6, 2007 - 5:13 am. (1 message)

Next thread: [PATCH 5/5] cvsimport: Improve formating consistency by Frank Lichtenheld on Friday, April 6, 2007 - 2:52 pm. (1 message)