* [PATCH 0/5] cvsimport: Improve documentation @ 2007-04-06 21:52 Frank Lichtenheld 2007-04-06 21:52 ` [PATCH 1/5] cvsimport: sync usage lines with existing options Frank Lichtenheld 0 siblings, 1 reply; 6+ messages in thread From: Frank Lichtenheld @ 2007-04-06 21:52 UTC (permalink / raw) To: git; +Cc: Junio C Hamano 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(-) ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/5] cvsimport: sync usage lines with existing options 2007-04-06 21:52 [PATCH 0/5] cvsimport: Improve documentation Frank Lichtenheld @ 2007-04-06 21:52 ` Frank Lichtenheld 2007-04-06 21:52 ` [PATCH 2/5] cvsimport: Improve documentation of CVSROOT and CVS module determination Frank Lichtenheld 0 siblings, 1 reply; 6+ messages in thread From: Frank Lichtenheld @ 2007-04-06 21:52 UTC (permalink / raw) To: git; +Cc: Junio C Hamano, Frank Lichtenheld 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 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/5] cvsimport: Improve documentation of CVSROOT and CVS module determination 2007-04-06 21:52 ` [PATCH 1/5] cvsimport: sync usage lines with existing options Frank Lichtenheld @ 2007-04-06 21:52 ` Frank Lichtenheld 2007-04-06 21:52 ` [PATCH 3/5] cvsimport: Improve usage error reporting Frank Lichtenheld 0 siblings, 1 reply; 6+ messages in thread From: Frank Lichtenheld @ 2007-04-06 21:52 UTC (permalink / raw) To: git; +Cc: Junio C Hamano, Frank Lichtenheld 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 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 3/5] cvsimport: Improve usage error reporting 2007-04-06 21:52 ` [PATCH 2/5] cvsimport: Improve documentation of CVSROOT and CVS module determination Frank Lichtenheld @ 2007-04-06 21:52 ` Frank Lichtenheld 2007-04-06 21:52 ` [PATCH 4/5] cvsimport: Reorder options in documentation for better understanding Frank Lichtenheld 0 siblings, 1 reply; 6+ messages in thread From: Frank Lichtenheld @ 2007-04-06 21:52 UTC (permalink / raw) To: git; +Cc: Junio C Hamano, Frank Lichtenheld 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 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 4/5] cvsimport: Reorder options in documentation for better understanding 2007-04-06 21:52 ` [PATCH 3/5] cvsimport: Improve usage error reporting Frank Lichtenheld @ 2007-04-06 21:52 ` Frank Lichtenheld 2007-04-06 21:52 ` [PATCH 5/5] cvsimport: Improve formating consistency Frank Lichtenheld 0 siblings, 1 reply; 6+ messages in thread From: Frank Lichtenheld @ 2007-04-06 21:52 UTC (permalink / raw) To: git; +Cc: Junio C Hamano, Frank Lichtenheld 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 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. +-s <subst>:: + Substitute the character "/" in branch names with <subst> -p <options-for-cvsps>:: Additional options for cvsps. @@ -70,6 +81,10 @@ the old cvs2git tool. + If you need to pass multiple options, separate them with a comma. +-z <fuzz>:: + Pass the timestamp fuzz factor to cvsps, in seconds. If unset, + cvsps defaults to 300s. + -P <cvsps-output-file>:: Instead of calling cvsps, read the provided cvsps output file. Useful for debugging or when cvsps is being handled outside cvsimport. @@ -84,31 +99,13 @@ If you need to pass multiple options, separate them with a comma. regex. It can be used with -m to also see the default regexes. You must escape forward slashes. --v:: - Verbosity: let 'cvsimport' report what it is doing. - -<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. - --z <fuzz>:: - Pass the timestamp fuzz factor to cvsps, in seconds. If unset, - cvsps defaults to 300s. - --s <subst>:: - Substitute the character "/" in branch names with <subst> +-S <regex>:: + Skip paths matching the regex. -a:: Import all commits, including recent ones. cvsimport by default skips commits that have a timestamp less than 10 minutes ago. --S <regex>:: - Skip paths matching the regex. - -L <limit>:: Limit the number of commits imported. Workaround for cases where cvsimport leaks memory. @@ -136,6 +133,9 @@ It is not recommended to use this feature if you intend to export changes back to CVS again later with gitlink:git-cvsexportcommit[1]. +-h:: + Print a short usage message and exit. + OUTPUT ------ If '-v' is specified, the script reports what it is doing. -- 1.5.1 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 5/5] cvsimport: Improve formating consistency 2007-04-06 21:52 ` [PATCH 4/5] cvsimport: Reorder options in documentation for better understanding Frank Lichtenheld @ 2007-04-06 21:52 ` Frank Lichtenheld 0 siblings, 0 replies; 6+ messages in thread From: Frank Lichtenheld @ 2007-04-06 21:52 UTC (permalink / raw) To: git; +Cc: Junio C Hamano, Frank Lichtenheld Use ' ' syntax for all commandline options mentioned in text. Signed-off-by: Frank Lichtenheld <frank@lichtenheld.de> --- Documentation/git-cvsimport.txt | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Documentation/git-cvsimport.txt b/Documentation/git-cvsimport.txt index a5276f7..e0be856 100644 --- a/Documentation/git-cvsimport.txt +++ b/Documentation/git-cvsimport.txt @@ -65,7 +65,7 @@ the old cvs2git tool. not create them if they do not exist. -k:: - Kill keywords: will extract files with -kk from the CVS archive + Kill keywords: will extract files with '-kk' from the CVS archive to avoid noisy changesets. Highly recommended, but off by default to preserve compatibility with early imported trees. @@ -96,7 +96,7 @@ If you need to pass multiple options, separate them with a comma. -M <regex>:: Attempt to detect merges based on the commit message with a custom - regex. It can be used with -m to also see the default regexes. + regex. It can be used with '-m' to also see the default regexes. You must escape forward slashes. -S <regex>:: @@ -126,7 +126,7 @@ their GIT_AUTHOR_NAME and GIT_AUTHOR_EMAIL set properly all along. + For convenience, this data is saved to `$GIT_DIR/cvs-authors` -each time the -A option is provided and read from that same +each time the '-A' option is provided and read from that same file each time git-cvsimport is run. + It is not recommended to use this feature if you intend to -- 1.5.1 ^ permalink raw reply related [flat|nested] 6+ messages in thread
end of thread, other threads:[~2007-04-06 21:53 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2007-04-06 21:52 [PATCH 0/5] cvsimport: Improve documentation Frank Lichtenheld 2007-04-06 21:52 ` [PATCH 1/5] cvsimport: sync usage lines with existing options Frank Lichtenheld 2007-04-06 21:52 ` [PATCH 2/5] cvsimport: Improve documentation of CVSROOT and CVS module determination Frank Lichtenheld 2007-04-06 21:52 ` [PATCH 3/5] cvsimport: Improve usage error reporting Frank Lichtenheld 2007-04-06 21:52 ` [PATCH 4/5] cvsimport: Reorder options in documentation for better understanding Frank Lichtenheld 2007-04-06 21:52 ` [PATCH 5/5] cvsimport: Improve formating consistency Frank Lichtenheld
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 NNTP newsgroup(s).