{"thread":{"id":"1513","subject":"[PATCH] Add -k kill keyword expansion option to git-cvsimport","startedAt":"2005-08-15T07:10:09Z","lastAt":"2005-08-15T07:10:09Z","messageCount":1,"participants":["Martin Langhoff"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"7269","messageId":"46a038f9050815001072ebc8c1@mail.gmail.com","threadId":"1513","inReplyTo":null,"subject":"[PATCH] Add -k kill keyword expansion option to git-cvsimport","fromName":"Martin Langhoff","fromEmail":"martin.langhoff@gmail.com","sentAt":"2005-08-15T07:10:09Z","receivedAt":"2005-08-15T07:10:09Z","isPatch":true,"sender":{"key":"martin.langhoff@gmail.com","avatar":"https://gravatar.com/avatar/1e3f311b6c4c15836501901ca58f8c0b0667246488084ba524d8bc9867e22fd9?d=mp&s=160"},"body":"Early versions of git-cvsimport defaulted to using preexisting keyword\nexpansion settings. This change preserves compatibility with existing cvs\nimports and allows new repository migrations to kill keyword expansion.\n\nShould improve our chances of detecting merges and reduce imported\nrepository size.\n\nSigned-off: Martin Langhoff <martin.langhoff@gmail.com>\n---\n\n Documentation/git-cvsimport-script.txt |    7 ++++++-\n git-cvsimport-script                   |   12 +++++++-----\n 2 files changed, 13 insertions(+), 6 deletions(-)\n\n68d02ed3485e389315f33ab6387c0f1fc028b255\ndiff --git a/Documentation/git-cvsimport-script.txt\nb/Documentation/git-cvsimport-script.txt\n--- a/Documentation/git-cvsimport-script.txt\n+++ b/Documentation/git-cvsimport-script.txt\n@@ -11,7 +11,7 @@ SYNOPSIS\n --------\n 'git-cvsimport-script' [ -o <branch-for-HEAD> ] [ -h ] [ -v ]\n \t\t\t[ -d <CVSROOT> ] [ -p <options-for-cvsps> ]\n-\t\t\t[ -C <GIT_repository> ] [ -i ] [ <CVS_module> ]\n+\t\t\t[ -C <GIT_repository> ] [ -i ] [ -k ] [ <CVS_module> ]\n \n \n DESCRIPTION\n@@ -34,6 +34,11 @@ OPTIONS\n \tensures the working directory and cache remain untouched and will\n \tnot create them if they do not exist.\n \n+-k::\n+\tKill keywords: will extract files with -ko from the CVS archive\n+\tto avoid noisy changesets. Highly recommended, but off by default\n+\tto preserve compatibility with early imported trees. \n+\n -o <branch-for-HEAD>::\n \tThe 'HEAD' branch from CVS is imported to the 'origin' branch within\n \tthe git repository, as 'HEAD' already has a special meaning for git.\ndiff --git a/git-cvsimport-script b/git-cvsimport-script\n--- a/git-cvsimport-script\n+++ b/git-cvsimport-script\n@@ -28,19 +28,19 @@ use POSIX qw(strftime dup2);\n $SIG{'PIPE'}=\"IGNORE\";\n $ENV{'TZ'}=\"UTC\";\n \n-our($opt_h,$opt_o,$opt_v,$opt_d,$opt_p,$opt_C,$opt_z,$opt_i);\n+our($opt_h,$opt_o,$opt_v,$opt_k,$opt_d,$opt_p,$opt_C,$opt_z,$opt_i);\n \n sub usage() {\n \tprint STDERR <<END;\n Usage: ${\\basename $0}     # fetch/update GIT from CVS\n        [ -o branch-for-HEAD ] [ -h ] [ -v ] [ -d CVSROOT ]\n        [ -p opts-for-cvsps ] [ -C GIT_repository ] [ -z fuzz ]\n-       [ -i ] [ CVS_module ]\n+       [ -i ] [ -k ] [ CVS_module ]\n END\n \texit(1);\n }\n \n-getopts(\"hivo:d:p:C:z:\") or usage();\n+getopts(\"hivko:d:p:C:z:\") or usage();\n usage if $opt_h;\n \n @ARGV <= 1 or usage();\n@@ -218,8 +218,10 @@ sub _file {\n \tmy($self,$fn,$rev) = @_;\n \t$self->{'socketo'}->write(\"Argument -N\\n\") or return undef;\n \t$self->{'socketo'}->write(\"Argument -P\\n\") or return undef;\n-\t# $self->{'socketo'}->write(\"Argument -ko\\n\") or return undef;\n-\t# -ko: Linus' version doesn't use it\n+\t# -ko: Linus' version doesn't use it - defaults to off\n+\tif ($opt_k) {\n+\t    $self->{'socketo'}->write(\"Argument -ko\\n\") or return undef;\n+\t}\n \t$self->{'socketo'}->write(\"Argument -r\\n\") or return undef;\n \t$self->{'socketo'}->write(\"Argument $rev\\n\") or return undef;\n \t$self->{'socketo'}->write(\"Argument --\\n\") or return undef;\n"}]}