{"thread":{"id":"2305","subject":"[PATCH] cvsimport: introduce -P <cvsps-output-file> option","startedAt":"2005-11-02T00:48:47Z","lastAt":"2005-11-02T00:48:47Z","messageCount":1,"participants":["Martin Langhoff"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"10976","messageId":"11308925271764-git-send-email-martin@catalyst.net.nz","threadId":"2305","inReplyTo":null,"subject":"[PATCH] cvsimport: introduce -P <cvsps-output-file> option","fromName":"Martin Langhoff","fromEmail":"martin@catalyst.net.nz","sentAt":"2005-11-02T00:48:47Z","receivedAt":"2005-11-02T00:48:47Z","isPatch":true,"sender":{"key":"martin@laptop.org","avatar":null},"body":"-P:: <cvsps-output-file>\n       Instead of calling cvsps, read the provided cvsps output file. Useful\n       for debugging or when cvsps is being handled outside cvsimport.\n\nSigned-off-by: Martin Langhoff <martin@catalyst.net.nz>\n\n\n---\n\n Documentation/git-cvsimport.txt |    4 ++++\n git-cvsimport.perl              |   12 ++++++++----\n 2 files changed, 12 insertions(+), 4 deletions(-)\n\napplies-to: a0f3f0cdfb22033b0dd52a0abc7c5cebfc17e56d\n16f5165e7258fcd0dc209f7eb4e85d4222ecaaa4\ndiff --git a/Documentation/git-cvsimport.txt b/Documentation/git-cvsimport.txt\nindex f5248c9..a2f97b3 100644\n--- a/Documentation/git-cvsimport.txt\n+++ b/Documentation/git-cvsimport.txt\n@@ -60,6 +60,10 @@ the old cvs2git tool.\n +\n If you need to pass multiple options, separate them with a comma.\n \n+-P:: <cvsps-output-file>\n+\tInstead of calling cvsps, read the provided cvsps output file. Useful\n+\tfor debugging or when cvsps is being handled outside cvsimport.\n+\n -m::    \n \tAttempt to detect merges based on the commit message. This option\n \twill enable default regexes that try to capture the name source \ndiff --git a/git-cvsimport.perl b/git-cvsimport.perl\nindex e3cad5a..0144670 100755\n--- a/git-cvsimport.perl\n+++ b/git-cvsimport.perl\n@@ -29,7 +29,7 @@ use IPC::Open2;\n $SIG{'PIPE'}=\"IGNORE\";\n $ENV{'TZ'}=\"UTC\";\n \n-our($opt_h,$opt_o,$opt_v,$opt_k,$opt_u,$opt_d,$opt_p,$opt_C,$opt_z,$opt_i,$opt_s,$opt_m,$opt_M);\n+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);\n \n sub usage() {\n \tprint STDERR <<END;\n@@ -41,7 +41,7 @@ END\n \texit(1);\n }\n \n-getopts(\"hivmkuo:d:p:C:z:s:M:\") or usage();\n+getopts(\"hivmkuo:d:p:C:z:s:M:P:\") or usage();\n usage if $opt_h;\n \n @ARGV <= 1 or usage();\n@@ -494,8 +494,12 @@ unless($pid) {\n \tunless (defined($opt_p) && $opt_p =~ m/--no-cvs-direct/) {\n \t\tpush @opt, '--cvs-direct';\n \t}\n-\texec(\"cvsps\",@opt,\"-u\",\"-A\",'--root',$opt_d,$cvs_tree);\n-\tdie \"Could not start cvsps: $!\\n\";\n+\tif ($opt_P) {\n+\t    exec(\"cat\", $opt_P);\n+\t} else {\n+\t    exec(\"cvsps\",@opt,\"-u\",\"-A\",'--root',$opt_d,$cvs_tree);\n+\t    die \"Could not start cvsps: $!\\n\";\n+\t}\n }\n \n \n---\n0.99.8.GIT\n"}]}