{"thread":{"id":"1038","subject":"[PATCH] cvsimport: rewritten in Perl","startedAt":"2005-06-28T19:23:23Z","lastAt":"2005-07-06T10:24:27Z","messageCount":49,"participants":["Matthias Urlichs","Nicolas Pitre","Sven Verdoolaege","Stephen C. Tweedie","Wolfgang Denk","Linus Torvalds"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"5357","messageId":"pan.2005.06.28.19.23.08.307486@smurf.noris.de","threadId":"1038","inReplyTo":null,"subject":"[PATCH] cvsimport: rewritten in Perl","fromName":"Matthias Urlichs","fromEmail":"smurf@smurf.noris.de","sentAt":"2005-06-28T19:23:23Z","receivedAt":"2005-06-28T19:23:23Z","isPatch":true,"sender":{"key":"matthias@urlichs.de","avatar":"https://gravatar.com/avatar/2708905af227313eba6f2b2ae0f7d0259b5ac5d71baef58fe5a13c699ce0bbf0?d=mp&s=160"},"body":"I just got my machine blocked from a CVS server which didn't like\nto get hammered with connections.\n\nThat was cvs2git's shell script. Which, by the way, is slow as hell.\n\nAppended: a git-cvsimport script, written in Perl, which directly talks\nto the CVS server. If the repository is local, it runs a \"cvs server\"\nchild. It produces the same git repository as Linus' version. It can do\nincremental imports. And it's 20 times faster (on my system, with a\nlocal CVS repository).\n\ncvs2git is thus obsolete; this patch deletes it.\n\nSigned-Off-By: Matthias Urlichs <smurf@smurf.noris.de>\n\n--- \n\ndiff --git a/Documentation/cvs-migration.txt b/Documentation/cvs-migration.txt\n--- a/Documentation/cvs-migration.txt\n+++ b/Documentation/cvs-migration.txt\n@@ -63,18 +63,38 @@ Once you've gotten (and installed) cvsps\n any more familiar with it, but make sure it is in your path. After that,\n the magic command line is\n \n-\tgit cvsimport <cvsroot> <module>\n+\tgit cvsimport -v -d <cvsroot> <module> <destination>\n \n which will do exactly what you'd think it does: it will create a git\n-archive of the named CVS module. The new archive will be created in a\n-subdirectory named <module>.\n+archive of the named CVS module. The new archive will be created in the\n+subdirectory named <destination>; it'll be created if it doesn't exist.\n+Default is the local directory.\n \n It can take some time to actually do the conversion for a large archive\n since it involves checking out from CVS every revision of every file,\n-and the conversion script can be reasonably chatty, but on some not very\n-scientific tests it averaged about eight revisions per second, so a\n-medium-sized project should not take more than a couple of minutes.  For\n-larger projects or remote repositories, the process may take longer.\n+and the conversion script is reasonably chatty unless you omit the '-v'\n+option, but on some not very scientific tests it averaged about twenty\n+revisions per second, so a medium-sized project should not take more\n+than a couple of minutes.  For larger projects or remote repositories,\n+the process may take longer.\n+\n+After the (initial) import is done, the CVS archive's current head\n+revision will be checked out -- thus, you can start adding your own\n+changes right away.\n+\n+The import is incremental, i.e. if you call it again next month it'll\n+fetch any CVS updates that have been happening in the meantime. The\n+cut-off is date-based, so don't change the branches that were imported\n+from CVS.\n+\n+You can merge those updates (or, in fact, a different CVS branch) into\n+your main branch:\n+\n+\tcg-merge <branch>\n+\n+The HEAD revision from CVS is named \"origin\", not \"HEAD\", because git\n+already uses \"HEAD\". (If you don't like 'origin', use cvsimport's\n+'-o' option to change it.)\n \n \n Emulating CVS behaviour\ndiff --git a/Makefile b/Makefile\n--- a/Makefile\n+++ b/Makefile\n@@ -35,7 +35,7 @@ PROG=   git-update-cache git-diff-files \n \tgit-http-pull git-ssh-push git-ssh-pull git-rev-list git-mktag \\\n \tgit-diff-helper git-tar-tree git-local-pull git-write-blob \\\n \tgit-get-tar-commit-id git-apply git-stripspace \\\n-\tgit-cvs2git git-diff-stages git-rev-parse git-patch-id \\\n+\tgit-diff-stages git-rev-parse git-patch-id \\\n \tgit-pack-objects git-unpack-objects\n \n all: $(PROG)\n@@ -118,7 +118,6 @@ git-diff-helper: diff-helper.c\n git-tar-tree: tar-tree.c\n git-write-blob: write-blob.c\n git-stripspace: stripspace.c\n-git-cvs2git: cvs2git.c\n git-diff-stages: diff-stages.c\n git-rev-parse: rev-parse.c\n git-patch-id: patch-id.c\ndiff --git a/cvs2git.c b/cvs2git.c\ndeleted file mode 100644\n--- a/cvs2git.c\n+++ /dev/null\n@@ -1,329 +0,0 @@\n-/*\n- * cvs2git\n- *\n- * Copyright (C) Linus Torvalds 2005\n- */\n-\n-#include <stdio.h>\n-#include <ctype.h>\n-#include <string.h>\n-#include <stdlib.h>\n-#include <unistd.h>\n-\n-static int verbose = 0;\n-\n-/*\n- * This is a really stupid program that takes cvsps output, and\n- * generates a a long _shell_script_ that will create the GIT archive\n- * from it. \n- *\n- * You've been warned. I told you it was stupid.\n- *\n- * NOTE NOTE NOTE! In order to do branches correctly, this needs\n- * the fixed cvsps that has the \"Ancestor branch\" tag output.\n- * Hopefully David Mansfield will update his distribution soon\n- * enough (he's the one who wrote the patch, so at least we don't\n- * have to figt maintainer issues ;)\n- *\n- * Usage:\n- *\n- *\tTZ=UTC cvsps -A |\n- *\t\tgit-cvs2git --cvsroot=[root] --module=[module] > script\n- *\n- * Creates a shell script that will generate the .git archive of\n- * the names CVS repository.\n- *\n- *\tTZ=UTC cvsps -s 1234- -A |\n- *\t\tgit-cvs2git -u --cvsroot=[root] --module=[module] > script\n- *\n- * Creates a shell script that will update the .git archive with\n- * CVS changes from patchset 1234 until the last one.\n- *\n- * IMPORTANT NOTE ABOUT \"cvsps\"! This requires version 2.1 or better,\n- * and the \"TZ=UTC\" and the \"-A\" flag is required for sane results!\n- */\n-enum state {\n-\tHeader,\n-\tLog,\n-\tMembers\n-};\n-\n-static const char *cvsroot;\n-static const char *cvsmodule;\n-\n-static char date[100];\n-static char author[100];\n-static char branch[100];\n-static char ancestor[100];\n-static char tag[100];\n-static char log[32768];\n-static int loglen = 0;\n-static int initial_commit = 1;\n-\n-static void lookup_author(char *n, char **name, char **email)\n-{\n-\t/*\n-\t * FIXME!!! I'm lazy and stupid.\n-\t *\n-\t * This could be something like\n-\t *\n-\t *\tprintf(\"lookup_author '%s'\\n\", n);\n-\t *\t*name = \"$author_name\";\n-\t *\t*email = \"$author_email\";\n-\t *\n-\t * and that would allow the script to do its own\n-\t * lookups at run-time.\n-\t */\n-\t*name = n;\n-\t*email = n;\n-}\n-\n-static void prepare_commit(void)\n-{\n-\tchar *author_name, *author_email;\n-\tchar *src_branch;\n-\n-\tlookup_author(author, &author_name, &author_email);\n-\n-\tprintf(\"export GIT_COMMITTER_NAME=%s\\n\", author_name);\n-\tprintf(\"export GIT_COMMITTER_EMAIL=%s\\n\", author_email);\n-\tprintf(\"export GIT_COMMITTER_DATE='+0000 %s'\\n\", date);\n-\n-\tprintf(\"export GIT_AUTHOR_NAME=%s\\n\", author_name);\n-\tprintf(\"export GIT_AUTHOR_EMAIL=%s\\n\", author_email);\n-\tprintf(\"export GIT_AUTHOR_DATE='+0000 %s'\\n\", date);\n-\n-\tif (initial_commit)\n-\t\treturn;\n-\n-\tsrc_branch = *ancestor ? ancestor : branch;\n-\tif (!strcmp(src_branch, \"HEAD\"))\n-\t\tsrc_branch = \"master\";\n-\tprintf(\"ln -sf refs/heads/'%s' .git/HEAD\\n\", src_branch);\n-\n-\t/*\n-\t * Even if cvsps claims an ancestor, we'll let the new\n-\t * branch name take precedence if it already exists\n-\t */\n-\tif (*ancestor) {\n-\t\tsrc_branch = branch;\n-\t\tif (!strcmp(src_branch, \"HEAD\"))\n-\t\t\tsrc_branch = \"master\";\n-\t\tprintf(\"[ -e .git/refs/heads/'%s' ] && ln -sf refs/heads/'%s' .git/HEAD\\n\",\n-\t\t\tsrc_branch, src_branch);\n-\t}\n-\n-\tprintf(\"git-read-tree -m HEAD || exit 1\\n\");\n-\tprintf(\"git-checkout-cache -f -u -a\\n\");\n-}\n-\n-static void commit(void)\n-{\n-\tconst char *cmit_parent = initial_commit ? \"\" : \"-p HEAD\";\n-\tconst char *dst_branch;\n-\tchar *space;\n-\tint i;\n-\n-\tprintf(\"tree=$(git-write-tree)\\n\");\n-\tprintf(\"cat > .cmitmsg <<EOFMSG\\n\");\n-\n-\t/* Escape $ characters, and remove control characters */\n-\tfor (i = 0; i < loglen; i++) {\n-\t\tunsigned char c = log[i];\n-\n-\t\tswitch (c) {\n-\t\tcase '$':\n-\t\tcase '\\\\':\n-\t\tcase '`':\n-\t\t\tputchar('\\\\');\n-\t\t\tbreak;\n-\t\tcase 0 ... 31:\n-\t\t\tif (c == '\\n' || c == '\\t')\n-\t\t\t\tbreak;\n-\t\tcase 128 ... 159:\n-\t\t\tcontinue;\n-\t\t}\n-\t\tputchar(c);\n-\t}\n-\tprintf(\"\\nEOFMSG\\n\");\n-\tprintf(\"commit=$(cat .cmitmsg | git-commit-tree $tree %s)\\n\", cmit_parent);\n-\n-\tdst_branch = branch;\n-\tif (!strcmp(dst_branch, \"HEAD\"))\n-\t\tdst_branch = \"master\";\n-\n-\tprintf(\"echo $commit > .git/refs/heads/'%s'\\n\", dst_branch);\n-\n-\tspace = strchr(tag, ' ');\n-\tif (space)\n-\t\t*space = 0;\n-\tif (strcmp(tag, \"(none)\"))\n-\t\tprintf(\"echo $commit > .git/refs/tags/'%s'\\n\", tag);\n-\n-\tprintf(\"echo 'Committed (to %s):' ; cat .cmitmsg; echo\\n\", dst_branch);\n-\n-\t*date = 0;\n-\t*author = 0;\n-\t*branch = 0;\n-\t*ancestor = 0;\n-\t*tag = 0;\n-\tloglen = 0;\n-\n-\tinitial_commit = 0;\n-}\n-\n-static void update_file(char *line)\n-{\n-\tchar *name, *version;\n-\tchar *dir;\n-\n-\twhile (isspace(*line))\n-\t\tline++;\n-\tname = line;\n-\tline = strchr(line, ':');\n-\tif (!line)\n-\t\treturn;\n-\t*line++ = 0;\n-\tline = strchr(line, '>');\n-\tif (!line)\n-\t\treturn;\n-\t*line++ = 0;\n-\tversion = line;\n-\tline = strchr(line, '(');\n-\tif (line) {\t/* \"(DEAD)\" */\n-\t\tprintf(\"git-update-cache --force-remove '%s'\\n\", name);\n-\t\treturn;\n-\t}\n-\n-\tdir = strrchr(name, '/');\n-\tif (dir)\n-\t\tprintf(\"mkdir -p %.*s\\n\", (int)(dir - name), name);\n-\n-\tprintf(\"cvs -q -d %s checkout -d .git-tmp -r%s '%s/%s'\\n\", \n-\t\tcvsroot, version, cvsmodule, name);\n-\tprintf(\"mv -f .git-tmp/%s %s\\n\", dir ? dir+1 : name, name);\n-\tprintf(\"rm -rf .git-tmp\\n\");\n-\tprintf(\"git-update-cache --add -- '%s'\\n\", name);\n-}\n-\n-struct hdrentry {\n-\tconst char *name;\n-\tchar *dest;\n-} hdrs[] = {\n-\t{ \"Date:\", date },\n-\t{ \"Author:\", author },\n-\t{ \"Branch:\", branch },\n-\t{ \"Ancestor branch:\", ancestor },\n-\t{ \"Tag:\", tag },\n-\t{ \"Log:\", NULL },\n-\t{ NULL, NULL }\n-};\n-\n-int main(int argc, char **argv)\n-{\n-\tstatic char line[1000];\n-\tenum state state = Header;\n-\tint i;\n-\n-\tfor (i = 1; i < argc; i++) {\n-\t\tconst char *arg = argv[i];\n-\t\tif (!memcmp(arg, \"--cvsroot=\", 10)) {\n-\t\t\tcvsroot = arg + 10;\n-\t\t\tcontinue;\n-\t\t}\n-\t\tif (!memcmp(arg, \"--module=\", 9)) {\n-\t\t\tcvsmodule = arg+9;\n-\t\t\tcontinue;\n-\t\t} \n-\t\tif (!strcmp(arg, \"-v\")) {\n-\t\t\tverbose = 1;\n-\t\t\tcontinue;\n-\t\t}\n-\t\tif (!strcmp(arg, \"-u\")) {\n-\t\t\tinitial_commit = 0;\n-\t\t\tcontinue;\n-\t\t}\n-\t}\n-\n-\n-\tif (!cvsroot)\n-\t\tcvsroot = getenv(\"CVSROOT\");\n-\n-\tif (!cvsmodule || !cvsroot) {\n-\t\tfprintf(stderr, \"I need a CVSROOT and module name\\n\");\n-\t\texit(1);\n-\t}\n-\n-\tif (initial_commit) {\n-\t\tprintf(\"[ -d .git ] && exit 1\\n\");\n-\t\t    printf(\"git-init-db\\n\");\n-\t\tprintf(\"mkdir -p .git/refs/heads\\n\");\n-\t\tprintf(\"mkdir -p .git/refs/tags\\n\");\n-\t\tprintf(\"ln -sf refs/heads/master .git/HEAD\\n\");\n-\t}\n-\n-\twhile (fgets(line, sizeof(line), stdin) != NULL) {\n-\t\tint linelen = strlen(line);\n-\n-\t\twhile (linelen && isspace(line[linelen-1]))\n-\t\t\tline[--linelen] = 0;\n-\n-\t\tswitch (state) {\n-\t\tstruct hdrentry *entry;\n-\n-\t\tcase Header:\n-\t\t\tif (verbose)\n-\t\t\t\tprintf(\"# H: %s\\n\", line);\n-\t\t\tfor (entry = hdrs ; entry->name ; entry++) {\n-\t\t\t\tint len = strlen(entry->name);\n-\t\t\t\tchar *val;\n-\n-\t\t\t\tif (memcmp(entry->name, line, len))\n-\t\t\t\t\tcontinue;\n-\t\t\t\tif (!entry->dest) {\n-\t\t\t\t\tstate = Log;\n-\t\t\t\t\tbreak;\n-\t\t\t\t}\n-\t\t\t\tval = line + len;\n-\t\t\t\tlinelen -= len;\n-\t\t\t\twhile (isspace(*val)) {\n-\t\t\t\t\tval++;\n-\t\t\t\t\tlinelen--;\n-\t\t\t\t}\n-\t\t\t\tmemcpy(entry->dest, val, linelen+1);\n-\t\t\t\tbreak;\n-\t\t\t}\n-\t\t\tcontinue;\n-\n-\t\tcase Log:\n-\t\t\tif (verbose)\n-\t\t\t\tprintf(\"# L: %s\\n\", line);\n-\t\t\tif (!strcmp(line, \"Members:\")) {\n-\t\t\t\twhile (loglen && isspace(log[loglen-1]))\n-\t\t\t\t\tlog[--loglen] = 0;\n-\t\t\t\tprepare_commit();\n-\t\t\t\tstate = Members;\n-\t\t\t\tcontinue;\n-\t\t\t}\n-\t\t\t\t\n-\t\t\tif (loglen + linelen + 5 > sizeof(log))\n-\t\t\t\tcontinue;\n-\t\t\tmemcpy(log + loglen, line, linelen);\n-\t\t\tloglen += linelen;\n-\t\t\tlog[loglen++] = '\\n';\n-\t\t\tcontinue;\n-\n-\t\tcase Members:\n-\t\t\tif (verbose)\n-\t\t\t\tprintf(\"# M: %s\\n\", line);\n-\t\t\tif (!linelen) {\n-\t\t\t\tcommit();\n-\t\t\t\tstate = Header;\n-\t\t\t\tcontinue;\n-\t\t\t}\n-\t\t\tupdate_file(line);\n-\t\t\tcontinue;\n-\t\t}\n-\t}\n-\treturn 0;\n-}\ndiff --git a/git-cvsimport-script b/git-cvsimport-script\n--- a/git-cvsimport-script\n+++ b/git-cvsimport-script\n@@ -1,38 +1,629 @@\n-#!/bin/sh\n+#!/usr/bin/perl -w\n \n-usage () {\n-\techo \"Usage: git cvsimport [-v] [-z fuzz] <cvsroot> <module>\"\n-\texit 1\n-}\n-\n-CVS2GIT=\"\"\n-CVSPS=\"--cvs-direct -x -A\"\n-while true; do\n-\tcase \"$1\" in\n-\t-v) CVS2GIT=\"$1\" ;;\n-\t-z) shift; CVSPS=\"$CVSPS -z $1\" ;;\n-\t-*) usage ;;\n-\t*)  break ;;\n-\tesac\n-\tshift\n-done\n-\n-export CVSROOT=\"$1\"\n-export MODULE=\"$2\"\n-if [ ! \"$CVSROOT\" ] || [ ! \"$MODULE\" ] ; then\n-\tusage\n-fi\n-\n-cvsps -h 2>&1 | grep -q \"cvsps version 2.1\" >& /dev/null || {\n-\techo \"I need cvsps version 2.1\"\n-\texit 1\n-}\n-\n-mkdir \"$MODULE\" || exit 1\n-cd \"$MODULE\"\n-\n-TZ=UTC cvsps $CVSPS $MODULE > .git-cvsps-result\n-[ -s .git-cvsps-result ] || exit 1\n-git-cvs2git $CVS2GIT --cvsroot=\"$CVSROOT\" --module=\"$MODULE\" < .git-cvsps-result > .git-create-script || exit 1\n-sh .git-create-script\n+# This tool is copyright (c) 2005, Matthias Urlichs.\n+# It is released under the Gnu Public License, version 2.\n+#\n+# The basic idea is to aggregate CVS check-ins into related changes.\n+# Fortunately, \"cvsps\" does that for us; all we have to do is to parse\n+# its output.\n+#\n+# Checking out the files is done by a single long-running CVS connection\n+# / server process.\n+#\n+# The head revision is on branch \"origin\" by default.\n+# You can change that with the '-o' option.\n+\n+use strict;\n+use warnings;\n+use Getopt::Std;\n+use File::Path qw(mkpath);\n+use File::Basename qw(basename dirname);\n+use Time::Local;\n+use IO::Socket;\n+use IO::Pipe;\n+use POSIX qw(strftime dup2);\n+\n+$SIG{'PIPE'}=\"IGNORE\";\n+$ENV{'TZ'}=\"UTC\";\n+\n+our($opt_h,$opt_o,$opt_v,$opt_d);\n+\n+sub usage() {\n+\tprint STDERR <<END;\n+Usage: ${\\basename $0}     # fetch/update GIT from CVS\n+\t   [ -o branch-for-HEAD ] [ -h ] [ -v ] [ -d CVSROOT ]\n+       CVS_module [ GIT_repository ]\n+END\n+\texit(1);\n+}\n+\n+getopts(\"hqvo:d:\") or usage();\n+usage if $opt_h;\n+\n+@ARGV == 1 or @ARGV == 2 or usage();\n+\n+my($cvs_tree, $git_tree) = @ARGV;\n+\n+if($opt_d) {\n+\t$ENV{\"CVSROOT\"} = $opt_d;\n+} elsif($ENV{\"CVSROOT\"}) {\n+\t$opt_d = $ENV{\"CVSROOT\"};\n+} else {\n+\tdie \"CVSROOT needs to be set\";\n+}\n+$opt_o ||= \"origin\";\n+$git_tree ||= \".\";\n+\n+select(STDERR); $|=1; select(STDOUT);\n+\n+\n+package CVSconn;\n+# Basic CVS dialog.\n+# We're only interested in connecting and downloading, so ...\n+\n+use POSIX qw(strftime dup2);\n+\n+sub new {\n+\tmy($what,$repo,$subdir) = @_;\n+\t$what=ref($what) if ref($what);\n+\n+\tmy $self = {};\n+\t$self->{'buffer'} = \"\";\n+\tbless($self,$what);\n+\n+\t$repo =~ s#/+$##;\n+\t$self->{'fullrep'} = $repo;\n+\t$self->conn();\n+\n+\t$self->{'subdir'} = $subdir;\n+\t$self->{'lines'} = undef;\n+\n+\treturn $self;\n+}\n+\n+sub conn {\n+\tmy $self = shift;\n+\tmy $repo = $self->{'fullrep'};\n+\tif($repo =~ s/^:pserver:(?:(.*?)(?::(.*?))?@)?([^:\\/]*)(?::(\\d*))?//) {\n+\t\tmy($user,$pass,$serv,$port) = ($1,$2,$3,$4);\n+\t\t$user=\"anonymous\" unless defined $user;\n+\t\tmy $rr2 = \"-\";\n+\t\tunless($port) {\n+\t\t\t$rr2 = \":pserver:$user\\@$serv:$repo\";\n+\t\t\t$port=2401;\n+\t\t}\n+\t\tmy $rr = \":pserver:$user\\@$serv:$port$repo\";\n+\n+\t\tunless($pass) {\n+\t\t\topen(H,$ENV{'HOME'}.\"/.cvspass\") and do {\n+\t\t\t\t# :pserver:cvs@mea.tmt.tele.fi:/cvsroot/zmailer Ah<Z\n+\t\t\t\twhile(<H>) {\n+\t\t\t\t\tchomp;\n+\t\t\t\t\ts/^\\/\\d+\\s+//;\n+\t\t\t\t\tmy ($w,$p) = split(/\\s/,$_,2);\n+\t\t\t\t\tif($w eq $rr or $w eq $rr2) {\n+\t\t\t\t\t\t$pass = $p;\n+\t\t\t\t\t\tlast;\n+\t\t\t\t\t}\n+\t\t\t\t}\n+\t\t\t};\n+\t\t}\n+\t\t$pass=\"A\" unless $pass;\n+\n+\t\tmy $s = IO::Socket::INET->new(PeerHost => $serv, PeerPort => $port);\n+\t\tdie \"Socket to $serv: $!\\n\" unless defined $s;\n+\t\t$s->write(\"BEGIN AUTH REQUEST\\n$repo\\n$user\\n$pass\\nEND AUTH REQUEST\\n\")\n+\t\t\tor die \"Write to $serv: $!\\n\";\n+\t\t$s->flush();\n+\n+\t\tmy $rep = <$s>;\n+\n+\t\tif($rep ne \"I LOVE YOU\\n\") {\n+\t\t\t$rep=\"<unknown>\" unless $rep;\n+\t\t\tdie \"AuthReply: $rep\\n\";\n+\t\t}\n+\t\t$self->{'socketo'} = $s;\n+\t\t$self->{'socketi'} = $s;\n+\t} else { # local: Fork off our own cvs server.\n+\t\tmy $pr = IO::Pipe->new();\n+\t\tmy $pw = IO::Pipe->new();\n+\t\tmy $pid = fork();\n+\t\tdie \"Fork: $!\\n\" unless defined $pid;\n+\t\tunless($pid) {\n+\t\t\t$pr->writer();\n+\t\t\t$pw->reader();\n+\t\t\tdup2($pw->fileno(),0);\n+\t\t\tdup2($pr->fileno(),1);\n+\t\t\t$pr->close();\n+\t\t\t$pw->close();\n+\t\t\texec(\"cvs\",\"server\");\n+\t\t}\n+\t\t$pw->writer();\n+\t\t$pr->reader();\n+\t\t$self->{'socketo'} = $pw;\n+\t\t$self->{'socketi'} = $pr;\n+\t}\n+\t$self->{'socketo'}->write(\"Root $repo\\n\");\n+\n+\t# Trial and error says that this probably is the minimum set\n+\t$self->{'socketo'}->write(\"Valid-responses ok error Valid-requests Mode M Mbinary E F Checked-in Created Updated Merged Removed\\n\");\n+\n+\t$self->{'socketo'}->write(\"valid-requests\\n\");\n+\t$self->{'socketo'}->flush();\n+\n+\tchomp(my $rep=$self->readline());\n+\tif($rep !~ s/^Valid-requests\\s*//) {\n+\t\t$rep=\"<unknown>\" unless $rep;\n+\t\tdie \"Expected Valid-requests from server, but got: $rep\\n\";\n+\t}\n+\tchomp(my $res=$self->readline());\n+\tdie \"validReply: $res\\n\" if $res ne \"ok\";\n+\n+\t$self->{'socketo'}->write(\"UseUnchanged\\n\") if $rep =~ /\\bUseUnchanged\\b/;\n+\t$self->{'repo'} = $repo;\n+}\n+\n+sub readline {\n+\tmy($self) = @_;\n+\treturn $self->{'socketi'}->getline();\n+}\n+\n+sub _file {\n+\t# Request a file with a given revision.\n+\t# Trial and error says this is a good way to do it. :-/\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$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+\t$self->{'socketo'}->write(\"Argument $self->{'subdir'}/$fn\\n\") or return undef;\n+\t$self->{'socketo'}->write(\"Directory .\\n\") or return undef;\n+\t$self->{'socketo'}->write(\"$self->{'repo'}\\n\") or return undef;\n+\t$self->{'socketo'}->write(\"Sticky T1.1\\n\") or return undef;\n+\t$self->{'socketo'}->write(\"co\\n\") or return undef;\n+\t$self->{'socketo'}->flush() or return undef;\n+\t$self->{'lines'} = 0;\n+\treturn 1;\n+}\n+sub _line {\n+\t# Read a line from the server.\n+\t# ... except that 'line' may be an entire file. ;-)\n+\tmy($self) = @_;\n+\tdie \"Not in lines\" unless defined $self->{'lines'};\n+\n+\tmy $line;\n+\tmy $res=\"\";\n+\twhile(defined($line = $self->readline())) {\n+\t\t# M U gnupg-cvs-rep/AUTHORS\n+\t\t# Updated gnupg-cvs-rep/\n+\t\t# /daten/src/rsync/gnupg-cvs-rep/AUTHORS\n+\t\t# /AUTHORS/1.1///T1.1\n+\t\t# u=rw,g=rw,o=rw\n+\t\t# 0\n+\t\t# ok\n+\n+\t\tif($line =~ s/^(?:Created|Updated) //) {\n+\t\t\t$line = $self->readline(); # path\n+\t\t\t$line = $self->readline(); # Entries line\n+\t\t\tmy $mode = $self->readline(); chomp $mode;\n+\t\t\t$self->{'mode'} = $mode;\n+\t\t\tdefined (my $cnt = $self->readline())\n+\t\t\t\tor die \"EOF from server after 'Changed'\\n\";\n+\t\t\tchomp $cnt;\n+\t\t\tdie \"Duh: Filesize $cnt\" if $cnt !~ /^\\d+$/;\n+\t\t\t$line=\"\";\n+\t\t\t$res=\"\";\n+\t\t\twhile($cnt) {\n+\t\t\t\tmy $buf;\n+\t\t\t\tmy $num = $self->{'socketi'}->read($buf,$cnt);\n+\t\t\t\tdie \"Server: Filesize $cnt: $num: $!\\n\" if not defined $num or $num<=0;\n+\t\t\t\t$res .= $buf;\n+\t\t\t\t$cnt -= $num;\n+\t\t\t}\n+\t\t} elsif($line =~ s/^ //) {\n+\t\t\t$res .= $line;\n+\t\t} elsif($line =~ /^M\\b/) {\n+\t\t\t# output, do nothing\n+\t\t} elsif($line =~ /^Mbinary\\b/) {\n+\t\t\tmy $cnt;\n+\t\t\tdie \"EOF from server after 'Mbinary'\" unless defined ($cnt = $self->readline());\n+\t\t\tchomp $cnt;\n+\t\t\tdie \"Duh: Mbinary $cnt\" if $cnt !~ /^\\d+$/ or $cnt<1;\n+\t\t\t$line=\"\";\n+\t\t\twhile($cnt) {\n+\t\t\t\tmy $buf;\n+\t\t\t\tmy $num = $self->{'socketi'}->read($buf,$cnt);\n+\t\t\t\tdie \"S: Mbinary $cnt: $num: $!\\n\" if not defined $num or $num<=0;\n+\t\t\t\t$res .= $buf;\n+\t\t\t\t$cnt -= $num;\n+\t\t\t}\n+\t\t} else {\n+\t\t\tchomp $line;\n+\t\t\tif($line eq \"ok\") {\n+\t\t\t\t# print STDERR \"S: ok (\".length($res).\")\\n\";\n+\t\t\t\treturn $res;\n+\t\t\t} elsif($line =~ s/^E //) {\n+\t\t\t\t# print STDERR \"S: $line\\n\";\n+\t\t\t} else {\n+\t\t\t\tdie \"Unknown: $line\\n\";\n+\t\t\t}\n+\t\t}\n+\t}\n+}\n+sub file {\n+\tmy($self,$fn,$rev) = @_;\n+\tmy $res;\n+\n+\tif ($self->_file($fn,$rev)) {\n+\t\t$res = $self->_line();\n+\t\treturn $res if defined $res;\n+\t}\n+\n+\t# retry\n+\t$self->conn();\n+\t$self->_file($fn,$rev)\n+\t\tor die \"No file command send\\n\";\n+\t$res = $self->_line();\n+\tdie \"No input: $fn $rev\\n\" unless defined $res;\n+\treturn $res;\n+}\n+\n+\n+package main;\n+\n+my $cvs = CVSconn->new($opt_d, $cvs_tree);\n+\n+\n+sub pdate($) {\n+\tmy($d) = @_;\n+\tm#(\\d{2,4})/(\\d\\d)/(\\d\\d)\\s(\\d\\d):(\\d\\d)(?::(\\d\\d))?#\n+\t\tor die \"Unparseable date: $d\\n\";\n+\tmy $y=$1; $y-=1900 if $y>1900;\n+\treturn timegm($6||0,$5,$4,$3,$2-1,$y);\n+}\n+\n+sub pmode($) {\n+\tmy($mode) = @_;\n+\tmy $m = 0;\n+\tmy $mm = 0;\n+\tmy $um = 0;\n+\tfor my $x(split(//,$mode)) {\n+\t\tif($x eq \",\") {\n+\t\t\t$m |= $mm&$um;\n+\t\t\t$mm = 0;\n+\t\t\t$um = 0;\n+\t\t} elsif($x eq \"u\") { $um |= 0700;\n+\t\t} elsif($x eq \"g\") { $um |= 0070;\n+\t\t} elsif($x eq \"o\") { $um |= 0007;\n+\t\t} elsif($x eq \"r\") { $mm |= 0444;\n+\t\t} elsif($x eq \"w\") { $mm |= 0222;\n+\t\t} elsif($x eq \"x\") { $mm |= 0111;\n+\t\t} elsif($x eq \"=\") { # do nothing\n+\t\t} else { die \"Unknown mode: $mode\\n\";\n+\t\t}\n+\t}\n+\t$m |= $mm&$um;\n+\treturn $m;\n+}\n+\n+my $tmpcv = \"/var/cache/cvs\";\n+\n+sub getwd() {\n+\tmy $pwd = `pwd`;\n+\tchomp $pwd;\n+\treturn $pwd;\n+}\n+\n+-d $git_tree\n+\tor mkdir($git_tree,0777)\n+\tor die \"Could not create $git_tree: $!\";\n+chdir($git_tree);\n+\n+my $last_branch = \"\";\n+my $orig_branch = \"\";\n+my %branch_date;\n+\n+my $git_dir = $ENV{\"GIT_DIR\"} || \".git\";\n+$git_dir = getwd().\"/\".$git_dir unless $git_dir =~ m#^/#;\n+$ENV{\"GIT_DIR\"} = $git_dir;\n+unless(-d $git_dir) {\n+\tsystem(\"git-init-db\");\n+\tdie \"Cannot init the GIT db at $git_tree: $?\\n\" if $?;\n+\tsystem(\"git-read-tree\");\n+\tdie \"Cannot init an empty tree: $?\\n\" if $?;\n+\n+\t$last_branch = $opt_o;\n+\t$orig_branch = \"\";\n+} else {\n+\t$last_branch = basename(readlink(\"$git_dir/HEAD\"));\n+\tunless($last_branch) {\n+\t\twarn \"Cannot read the last branch name: $! -- assuming 'master'\\n\";\n+\t\t$last_branch = \"master\";\n+\t}\n+\t$orig_branch = $last_branch;\n+\n+\t# Get the last import timestamps\n+\topendir(D,\"$git_dir/refs/heads\");\n+\twhile(defined(my $head = readdir(D))) {\n+\t\tnext if $head =~ /^\\./;\n+\t\topen(F,\"$git_dir/refs/heads/$head\")\n+\t\t\tor die \"Bad head branch: $head: $!\\n\";\n+\t\tchomp(my $ftag = <F>);\n+\t\tclose(F);\n+\t\topen(F,\"git-cat-file commit $ftag |\");\n+\t\twhile(<F>) {\n+\t\t\tnext unless /^author\\s.*\\s(\\d+)\\s[-+]\\d{4}$/;\n+\t\t\t$branch_date{$head} = $1;\n+\t\t\tlast;\n+\t\t}\n+\t\tclose(F);\n+\t}\n+\tclosedir(D);\n+}\n+\n+-d $git_dir\n+\tor die \"Could not create git subdir ($git_dir).\\n\";\n+\n+my $pid = open(CVS,\"-|\");\n+die \"Cannot fork: $!\\n\" unless defined $pid;\n+unless($pid) {\n+\texec(\"cvsps\",\"-A\",\"--cvs-direct\",$cvs_tree);\n+\tdie \"Could not start cvsps: $!\\n\";\n+}\n+\n+\n+## cvsps output:\n+#---------------------\n+#PatchSet 314\n+#Date: 1999/09/18 13:03:59\n+#Author: wkoch\n+#Branch: STABLE-BRANCH-1-0\n+#Ancestor branch: HEAD\n+#Tag: (none)\n+#Log:\n+#    See ChangeLog: Sat Sep 18 13:03:28 CEST 1999  Werner Koch\n+#Members:\n+#\tREADME:1.57->1.57.2.1\n+#\tVERSION:1.96->1.96.2.1\n+#\n+#---------------------\n+\n+my $state = 0;\n+\n+my($patchset,$date,$author,$branch,$ancestor,$tag,$logmsg);\n+my(@old,@new);\n+my $commit = sub {\n+\tmy $pid;\n+\tsystem(\"git-update-cache\",\"--force-remove\",\"--\",@old) if @old;\n+\tdie \"Cannot remove files: $?\\n\" if $?;\n+\tsystem(\"git-update-cache\",\"--add\",\"--\",@new) if @new;\n+\tdie \"Cannot add files: $?\\n\" if $?;\n+\n+\t$pid = open(C,\"-|\");\n+\tdie \"Cannot fork: $!\" unless defined $pid;\n+\tunless($pid) {\n+\t\texec(\"git-write-tree\");\n+\t\tdie \"Cannot exec git-write-tree: $!\\n\";\n+\t}\n+\tchomp(my $tree = <C>);\n+\tlength($tree) == 40\n+\t\tor die \"Cannot get tree id ($tree): $!\\n\";\n+\tclose(C)\n+\t\tor die \"Error running git-write-tree: $?\\n\";\n+\tprint \"Tree ID $tree\\n\" if $opt_v;\n+\n+\tmy $parent = \"\";\n+\tif(open(C,\"$git_dir/refs/heads/$last_branch\")) {\n+\t\tchomp($parent = <C>);\n+\t\tclose(C);\n+\t\tlength($parent) == 40\n+\t\t\tor die \"Cannot get parent id ($parent): $!\\n\";\n+\t\tprint \"Parent ID $parent\\n\" if $opt_v;\n+\t}\n+\n+\tmy $pr = IO::Pipe->new();\n+\tmy $pw = IO::Pipe->new();\n+\t$pid = fork();\n+\tdie \"Fork: $!\\n\" unless defined $pid;\n+\tunless($pid) {\n+\t\t$pr->writer();\n+\t\t$pw->reader();\n+\t\tdup2($pw->fileno(),0);\n+\t\tdup2($pr->fileno(),1);\n+\t\t$pr->close();\n+\t\t$pw->close();\n+\n+\t\tmy @par = ();\n+\t\t@par = (\"-p\",$parent) if $parent;\n+\t\texec(\"env\",\n+\t\t\t\"GIT_AUTHOR_NAME=$author\",\n+\t\t\t\"GIT_AUTHOR_EMAIL=$author\",\n+\t\t\t\"GIT_AUTHOR_DATE=\".strftime(\"+0000 %Y-%m-%d %H:%M:%S\",gmtime($date)),\n+\t\t\t\"GIT_COMMITTER_NAME=$author\",\n+\t\t\t\"GIT_COMMITTER_EMAIL=$author\",\n+\t\t\t\"GIT_COMMITTER_DATE=\".strftime(\"+0000 %Y-%m-%d %H:%M:%S\",gmtime($date)),\n+\t\t\t\"git-commit-tree\", $tree,@par);\n+\t\tdie \"Cannot exec git-commit-tree: $!\\n\";\n+\t}\n+\t$pw->writer();\n+\t$pr->reader();\n+\tprint $pw $logmsg\n+\t\tor die \"Error writing to git-commit-tree: $!\\n\";\n+\t$pw->close();\n+\n+\tprint \"Committed patch $patchset ($branch)\\n\" if $opt_v;\n+\tchomp(my $cid = <$pr>);\n+\tlength($cid) == 40\n+\t\tor die \"Cannot get commit id ($cid): $!\\n\";\n+\tprint \"Commit ID $cid\\n\" if $opt_v;\n+\t$pr->close();\n+\n+\twaitpid($pid,0);\n+\tdie \"Error running git-commit-tree: $?\\n\" if $?;\n+\n+\topen(C,\">$git_dir/refs/heads/$branch\")\n+\t\tor die \"Cannot open branch $branch for update: $!\\n\";\n+\tprint C \"$cid\\n\"\n+\t\tor die \"Cannot write branch $branch for update: $!\\n\";\n+\tclose(C)\n+\t\tor die \"Cannot write branch $branch for update: $!\\n\";\n+\n+\tif($tag) {\n+\t\topen(C,\">$git_dir/refs/tags/$tag\")\n+\t\t\tor die \"Cannot create tag $tag: $!\\n\";\n+\t\tprint C \"$cid\\n\"\n+\t\t\tor die \"Cannot write tag $branch: $!\\n\";\n+\t\tclose(C)\n+\t\t\tor die \"Cannot write tag $branch: $!\\n\";\n+\t\tprint \"Created tag '$tag' on '$branch'\\n\" if $opt_v;\n+\t}\n+\n+\t@old = ();\n+\t@new = ();\n+};\n+\n+while(<CVS>) {\n+\tchomp;\n+\tif($state == 0 and /^-+$/) {\n+\t\t$state = 1;\n+\t} elsif($state == 0) {\n+\t\t$state = 1;\n+\t\tredo;\n+\t} elsif(($state==0 or $state==1) and s/^PatchSet\\s+//) {\n+\t\t$patchset = 0+$_;\n+\t\t$state=2;\n+\t} elsif($state == 2 and s/^Date:\\s+//) {\n+\t\t$date = pdate($_);\n+\t\tunless($date) {\n+\t\t\tprint STDERR \"Could not parse date: $_\\n\";\n+\t\t\t$state=0;\n+\t\t\tnext;\n+\t\t}\n+\t\t$state=3;\n+\t} elsif($state == 3 and s/^Author:\\s+//) {\n+\t\ts/\\s+$//;\n+\t\t$author = $_;\n+\t\t$state = 4;\n+\t} elsif($state == 4 and s/^Branch:\\s+//) {\n+\t\ts/\\s+$//;\n+\t\t$branch = $_;\n+\t\t$state = 5;\n+\t} elsif($state == 5 and s/^Ancestor branch:\\s+//) {\n+\t\ts/\\s+$//;\n+\t\t$ancestor = $_;\n+\t\t$ancestor = $opt_o if $ancestor == \"HEAD\";\n+\t\t$state = 6;\n+\t} elsif($state == 5) {\n+\t\t$ancestor = undef;\n+\t\t$state = 6;\n+\t\tredo;\n+\t} elsif($state == 6 and s/^Tag:\\s+//) {\n+\t\ts/\\s+$//;\n+\t\tif($_ eq \"(none)\") {\n+\t\t\t$tag = undef;\n+\t\t} else {\n+\t\t\t$tag = $_;\n+\t\t}\n+\t\t$state = 7;\n+\t} elsif($state == 7 and /^Log:/) {\n+\t\t$logmsg = \"\";\n+\t\t$state = 8;\n+\t} elsif($state == 8 and /^Members:/) {\n+\t\t$branch = $opt_o if $branch eq \"HEAD\";\n+\t\tif(defined $branch_date{$branch} and $branch_date{$branch} >= $date) {\n+\t\t\t# skip\n+\t\t\tprint \"skip patchset $patchset: $date before $branch_date{$branch}\\n\";\n+\t\t\t$state = 11;\n+\t\t\tnext;\n+\t\t}\n+\t\tif($ancestor) {\n+\t\t\tif(-f \"$git_dir/refs/heads/$branch\") {\n+\t\t\t\tprint STDERR \"Branch $branch already exists!\\n\";\n+\t\t\t\t$state=11;\n+\t\t\t\tnext;\n+\t\t\t}\n+\t\t\tunless(open(H,\"$git_dir/refs/heads/$ancestor\")) {\n+\t\t\t\tprint STDERR \"Branch $ancestor does not exist!\\n\";\n+\t\t\t\t$state=11;\n+\t\t\t\tnext;\n+\t\t\t}\n+\t\t\tchomp(my $id = <H>);\n+\t\t\tclose(H);\n+\t\t\tunless(open(H,\"> $git_dir/refs/heads/$branch\")) {\n+\t\t\t\tprint STDERR \"Could not create branch $branch: $!\\n\";\n+\t\t\t\t$state=11;\n+\t\t\t\tnext;\n+\t\t\t}\n+\t\t\tprint H \"$id\\n\"\n+\t\t\t\tor die \"Could not write branch $branch: $!\";\n+\t\t\tclose(H)\n+\t\t\t\tor die \"Could not write branch $branch: $!\";\n+\t\t}\n+\t\tif(($ancestor || $branch) ne $last_branch) {\n+\t\t\tprint \"Switching from $last_branch to $branch\\n\" if $opt_v;\n+\t\t\tsystem(\"git-read-tree\",\"-m\",\"-u\",\"$last_branch\",\"$branch\");\n+\t\t\tdie \"read-tree failed: $?\\n\" if $?;\n+\t\t}\n+\t\tif($branch ne $last_branch) {\n+\t\t\tunlink(\"$git_dir/HEAD\");\n+\t\t\tsymlink(\"refs/heads/$branch\",\"$git_dir/HEAD\");\n+\t\t\t$last_branch = $branch;\n+\t\t}\n+\t\t$state = 9;\n+\t} elsif($state == 8) {\n+\t\t$logmsg .= \"$_\\n\";\n+\t} elsif($state == 9 and /^\\s+(\\S+):(INITIAL|\\d(?:\\.\\d+)+)->(\\d(?:\\.\\d+)+)\\s*$/) {\n+#\tVERSION:1.96->1.96.2.1\n+\t\tmy $init = ($2 eq \"INITIAL\");\n+\t\tmy $fn = $1;\n+\t\tmy $rev = $3;\n+\t\t$fn =~ s#^/+##;\n+\t\tmy $data = $cvs->file($fn,$rev);\n+\t\tprint \"\".($init ? \"New\" : \"Update\").\" $fn: \".length($data).\" bytes.\\n\";\n+\t\tmkpath(dirname($fn),$opt_v);\n+\t\topen(F,\"> ./$fn\")\n+\t\t\tor die \"Cannot create '$fn': $!\\n\";\n+\t\tprint F $data\n+\t\t\tor die \"Cannot write to '$fn': $!\\n\";\n+\t\tclose(F)\n+\t\t\tor die \"Cannot write to '$fn': $!\\n\";\n+\t\tchmod(pmode($cvs->{'mode'}), $fn);\n+\t\tpush(@new,$fn); # may be resurrected!\n+\t} elsif($state == 9 and /^\\s+(\\S+):\\d(?:\\.\\d+)+->(\\d(?:\\.\\d+)+)\\(DEAD\\)\\s*$/) {\n+\t\tmy $fn = $1;\n+\t\t$fn =~ s#^/+##;\n+\t\tpush(@old,$fn);\n+\t} elsif($state == 9 and /^\\s*$/) {\n+\t\t$state = 10;\n+\t} elsif(($state == 9 or $state == 10) and /^-+$/) {\n+\t\t&$commit();\n+\t\t$state = 1;\n+\t} elsif($state == 11 and /^-+$/) {\n+\t\t$state = 1;\n+\t} elsif(/^-+$/) { # end of unknown-line processing\n+\t\t$state = 1;\n+\t} elsif($state != 11) { # ignore stuff when skipping\n+\t\tprint \"* UNKNOWN LINE * $_\\n\";\n+\t}\n+}\n+&$commit() if $branch and $state != 11;\n+\n+# Now switch back to the branch we were in before all of this happened\n+if($orig_branch) {\n+\tprint \"DONE; switching back to $orig_branch\\n\" if $opt_v;\n+} else {\n+\t$orig_branch = \"master\";\n+\tprint \"DONE; creating $orig_branch branch\\n\" if $opt_v;\n+\tsystem(\"cp\",\"$git_dir/refs/heads/$opt_o\",\"$git_dir/refs/heads/master\")\n+\t\tunless -f \"$git_dir/refs/heads/master\";\n+}\n+\n+system(\"git-read-tree\",\"-m\",\"-u\",\"$last_branch\",\"$orig_branch\");\n+die \"read-tree failed: $?\\n\" if $?;\n+\n+unlink(\"$git_dir/HEAD\");\n+symlink(\"refs/heads/$orig_branch\",\"$git_dir/HEAD\");\n \n"},{"id":"5414","messageId":"Pine.LNX.4.63.0506291048140.1667@localhost.localdomain","threadId":"1038","inReplyTo":"pan.2005.06.28.19.23.08.307486@smurf.noris.de","subject":"Re: [PATCH] cvsimport: rewritten in Perl","fromName":"Nicolas Pitre","fromEmail":"nico@cam.org","sentAt":"2005-06-29T15:06:03Z","receivedAt":"2005-06-29T15:06:03Z","isPatch":true,"sender":{"key":"nico@fluxnic.net","avatar":"https://avatars.githubusercontent.com/u/702790?v=4"},"body":"On Tue, 28 Jun 2005, Matthias Urlichs wrote:\n\n> I just got my machine blocked from a CVS server which didn't like\n> to get hammered with connections.\n> \n> That was cvs2git's shell script. Which, by the way, is slow as hell.\n> \n> Appended: a git-cvsimport script, written in Perl, which directly talks\n> to the CVS server. If the repository is local, it runs a \"cvs server\"\n> child. It produces the same git repository as Linus' version. It can do\n> incremental imports. And it's 20 times faster (on my system, with a\n> local CVS repository).\n\nTried it on the bkcvs repository from \nftp.kernel.org/pub/scm/linux/kernel/bkcvs/linux-2.5/\n(it can be retrieved with rsync as well)\n\nYour script died after about 30 seconds with:\n\n[...]\nNew scripts/lxdialog/Makefile: 0 bytes.\nNew scripts/lxdialog/checklist.c: 0 bytes.\nNew scripts/lxdialog/colors.h: 0 bytes.\nNew scripts/lxdialog/dialog.h: 0 bytes.\nNew scripts/lxdialog/inputbox.c: 0 bytes.\nNew scripts/lxdialog/lxdialog.c: 0 bytes.\nNew scripts/lxdialog/menubox.c: 0 bytes.\nNew scripts/lxdialog/msgbox.c: 0 bytes.\nNew scripts/lxdialog/textbox.c: 0 bytes.\nNew scripts/lxdialog/util.c: 0 bytes.\nNew scripts/lxdialog/yesno.c: 0 bytes.\nCan't exec \"git-update-cache\": Argument list too long at /home/nico/bin/git-cvsimport-script line 402, <CVS> line 8254.\nCannot add files: -1\n\nThe original Linus version, although painfully slow, successfully \nconverts the whole thing after a couple hours.\n\nAlso aren't those \"0 bytes\" a bit suspicious?\n\n\nNicolas\n"},{"id":"5419","messageId":"pan.2005.06.29.20.40.37.811830@smurf.noris.de","threadId":"1038","inReplyTo":"Pine.LNX.4.63.0506291048140.1667@localhost.localdomain","subject":"Re: [PATCH] cvsimport: rewritten in Perl","fromName":"Matthias Urlichs","fromEmail":"smurf@smurf.noris.de","sentAt":"2005-06-29T20:40:40Z","receivedAt":"2005-06-29T20:40:40Z","isPatch":true,"sender":{"key":"matthias@urlichs.de","avatar":"https://gravatar.com/avatar/2708905af227313eba6f2b2ae0f7d0259b5ac5d71baef58fe5a13c699ce0bbf0?d=mp&s=160"},"body":"Hi, Nicolas Pitre wrote:\n\n> ftp.kernel.org/pub/scm/linux/kernel/bkcvs/linux-2.5/\n\nOh well, I'll have a look. (I never bothered with bk2cvs; there's a\nbetter tool which does bk2git directly.)\n\n> New scripts/lxdialog/yesno.c: 0 bytes.\n\n0-byte files are quite common in real-world repositories, so\nthrowing an error when I see one won't work.\n\n> Can't exec \"git-update-cache\": Argument list too long at\n> /home/nico/bin/git-cvsimport-script line 402, <CVS> line 8254.\n\nThat, at least, is easily fixable, I'll do a followup patch.\n\n-- \nMatthias Urlichs   |   {M:U} IT Design @ m-u-it.de   |  smurf@smurf.noris.de\nDisclaimer: The quote was selected randomly. Really. | http://smurf.noris.de\n - -\n\"A 'meaning of life' removes the overriding fear that existance is\n useless -- while denying the fact that living is its own greatest reward.\"\n          [Fredric Rice, HolySmoke, December 1996]\n"},{"id":"5447","messageId":"pan.2005.06.30.10.30.21.176648@smurf.noris.de","threadId":"1038","inReplyTo":"pan.2005.06.29.20.40.37.811830@smurf.noris.de","subject":"Re: [PATCH] cvsimport: rewritten in Perl","fromName":"Matthias Urlichs","fromEmail":"smurf@smurf.noris.de","sentAt":"2005-06-30T10:30:25Z","receivedAt":"2005-06-30T10:30:25Z","isPatch":true,"sender":{"key":"matthias@urlichs.de","avatar":"https://gravatar.com/avatar/2708905af227313eba6f2b2ae0f7d0259b5ac5d71baef58fe5a13c699ce0bbf0?d=mp&s=160"},"body":"Hi, Matthias Urlichs wrote:\n\n> Hi, Nicolas Pitre wrote:\n> \n>> ftp.kernel.org/pub/scm/linux/kernel/bkcvs/linux-2.5/\n> \n> Oh well, I'll have a look. (I never bothered with bk2cvs; there's a\n> better tool which does bk2git directly.)\n> \nOK -- pulled, tested.\n\n... though why you'd want the kernel via CVS instead of by direct\nBK->GIT import is beyond me. ;-)\n\n>> New scripts/lxdialog/yesno.c: 0 bytes.\n> \nThat's a feature. All the r1.1 CVS versions are zero-byte files, because\nthey're copied from BK/SCCS 1.0 versions, which are empty too (BK adds\nthe actual content in revision 1.1).\n\n>> Can't exec \"git-update-cache\": Argument list too long at\n>> /home/nico/bin/git-cvsimport-script line 402, <CVS> line 8254.\n> \nFixed; patch mailed separately.\n\n-- \nMatthias Urlichs   |   {M:U} IT Design @ m-u-it.de   |  smurf@smurf.noris.de\nDisclaimer: The quote was selected randomly. Really. | http://smurf.noris.de\n - -\nMy mother had a baby once.\n\t\t\t\t\t-- Jigger\n"},{"id":"5448","messageId":"pan.2005.06.30.10.34.00.807346@smurf.noris.de","threadId":"1038","inReplyTo":"pan.2005.06.28.19.23.08.307486@smurf.noris.de","subject":"[PATCH] cvsimport-in-Perl: Limit the number of arguments to git-update-cache","fromName":"Matthias Urlichs","fromEmail":"smurf@smurf.noris.de","sentAt":"2005-06-30T10:34:00Z","receivedAt":"2005-06-30T10:34:00Z","isPatch":true,"sender":{"key":"matthias@urlichs.de","avatar":"https://gravatar.com/avatar/2708905af227313eba6f2b2ae0f7d0259b5ac5d71baef58fe5a13c699ce0bbf0?d=mp&s=160"},"body":"A small fix to git-cvsimport-script:\n\nLimit the number of arguments to git-update-cache.\n(Limiting their length may make a bit more sense, but I'm lazy.)\n\nSigned-Off-By: Matthias Urlichs <smurf@smurf.noris.de>\n\n---\n\ndiff --git a/git-cvsimport-script b/git-cvsimport-script\n--- a/git-cvsimport-script\n+++ b/git-cvsimport-script\n@@ -395,14 +395,32 @@ my $state = 0;\n \n my($patchset,$date,$author,$branch,$ancestor,$tag,$logmsg);\n my(@old,@new);\n my $commit = sub {\n \tmy $pid;\n-\tsystem(\"git-update-cache\",\"--force-remove\",\"--\",@old) if @old;\n-\tdie \"Cannot remove files: $?\\n\" if $?;\n-\tsystem(\"git-update-cache\",\"--add\",\"--\",@new) if @new;\n-\tdie \"Cannot add files: $?\\n\" if $?;\n+\twhile(@old) {\n+\t\tmy @o2;\n+\t\tif(@old > 55) {\n+\t\t\t@o2 = splice(@old,0,50);\n+\t\t} else {\n+\t\t\t@o2 = @old;\n+\t\t\t@old = ();\n+\t\t}\n+\t\tsystem(\"git-update-cache\",\"--force-remove\",\"--\",@o2);\n+\t\tdie \"Cannot remove files: $?\\n\" if $?;\n+\t}\n+\twhile(@new) {\n+\t\tmy @n2;\n+\t\tif(@new > 55) {\n+\t\t\t@n2 = splice(@new,0,50);\n+\t\t} else {\n+\t\t\t@n2 = @new;\n+\t\t\t@new = ();\n+\t\t}\n+\t\tsystem(\"git-update-cache\",\"--add\",\"--\",@n2);\n+\t\tdie \"Cannot add files: $?\\n\" if $?;\n+\t}\n \n \t$pid = open(C,\"-|\");\n \tdie \"Cannot fork: $!\" unless defined $pid;\n \tunless($pid) {\n \t\texec(\"git-write-tree\");\n@@ -478,13 +496,10 @@ my $commit = sub {\n \t\t\tor die \"Cannot write tag $branch: $!\\n\";\n \t\tclose(C)\n \t\t\tor die \"Cannot write tag $branch: $!\\n\";\n \t\tprint \"Created tag '$tag' on '$branch'\\n\" if $opt_v;\n \t}\n-\n-\t@old = ();\n-\t@new = ();\n };\n \n while(<CVS>) {\n \tchomp;\n \tif($state == 0 and /^-+$/) {\n"},{"id":"5452","messageId":"20050630145528.GA18553@pc117b.liacs.nl","threadId":"1038","inReplyTo":"pan.2005.06.28.19.23.08.307486@smurf.noris.de","subject":"[PATCH] cvsimport: perform string comparison on \"HEAD\"","fromName":"Sven Verdoolaege","fromEmail":"skimo@liacs.nl","sentAt":"2005-06-30T14:55:28Z","receivedAt":"2005-06-30T14:55:28Z","isPatch":true,"sender":{"key":"skimo@kotnet.org","avatar":null},"body":"--\ndiff --git a/git-cvsimport-script b/git-cvsimport-script\n--- a/git-cvsimport-script\n+++ b/git-cvsimport-script\n@@ -529,7 +529,7 @@ while(<CVS>) {\n \t} elsif($state == 5 and s/^Ancestor branch:\\s+//) {\n \t\ts/\\s+$//;\n \t\t$ancestor = $_;\n-\t\t$ancestor = $opt_o if $ancestor == \"HEAD\";\n+\t\t$ancestor = $opt_o if $ancestor eq \"HEAD\";\n \t\t$state = 6;\n \t} elsif($state == 5) {\n \t\t$ancestor = undef;\n"},{"id":"5453","messageId":"20050630150239.GA20928@pc117b.liacs.nl","threadId":"1038","inReplyTo":"pan.2005.06.28.19.23.08.307486@smurf.noris.de","subject":"Re: [PATCH] cvsimport: rewritten in Perl","fromName":"Sven Verdoolaege","fromEmail":"skimo@liacs.nl","sentAt":"2005-06-30T15:02:39Z","receivedAt":"2005-06-30T15:02:39Z","isPatch":true,"sender":{"key":"skimo@kotnet.org","avatar":null},"body":"On Tue, Jun 28, 2005 at 09:23:23PM +0200, Matthias Urlichs wrote:\n> I just got my machine blocked from a CVS server which didn't like\n> to get hammered with connections.\n> \n> That was cvs2git's shell script. Which, by the way, is slow as hell.\n> \n> Appended: a git-cvsimport script, written in Perl, which directly talks\n> to the CVS server. If the repository is local, it runs a \"cvs server\"\n> child. It produces the same git repository as Linus' version. It can do\n> incremental imports. And it's 20 times faster (on my system, with a\n> local CVS repository).\n> \n\nCould you try to make the resulting repository compatible\nwith a repository generated with the old cvs2git ?\n\nThis is the original version:\nsh-3.00$ git-cat-file commit f6a92a7a774473bce12415200bab2788ea3b18f0\ntree a0ec41a61461476c72c3967576225bd4772b6c8f\nauthor risset <risset> 995295631 +0000\ncommitter risset <risset> 995295631 +0000\n\nInitial revision\nsh-3.00$ \n\n\nThis is your version:\nsh-3.00$ git-cat-file commit db3540e3f670d4af4acefc723bab41a077c9300e\ntree a0ec41a61461476c72c3967576225bd4772b6c8f\nauthor risset <risset> 995295631 +0000\ncommitter risset <risset> 995295631 +0000\n\nInitial revision\n\nsh-3.00$ \n\nNote the extra empty line.\nEvery commit is now different.\n\nI'd really prefer it if I would not have to do the whole\nconversion again.\n\nskimo\n"},{"id":"5454","messageId":"20050630152125.GO10850@kiste.smurf.noris.de","threadId":"1038","inReplyTo":"20050630150239.GA20928@pc117b.liacs.nl","subject":"Re: [PATCH] cvsimport: rewritten in Perl","fromName":"Matthias Urlichs","fromEmail":"smurf@smurf.noris.de","sentAt":"2005-06-30T15:21:25Z","receivedAt":"2005-06-30T15:21:25Z","isPatch":true,"sender":{"key":"matthias@urlichs.de","avatar":"https://gravatar.com/avatar/2708905af227313eba6f2b2ae0f7d0259b5ac5d71baef58fe5a13c699ce0bbf0?d=mp&s=160"},"body":"Hi,\n\nSven Verdoolaege:\n> Could you try to make the resulting repository compatible\n> with a repository generated with the old cvs2git ?\n> \nI believe I did... at least it worked that way two days ago. ;-)\n\n> This is the original version:\n\nWhich repository is that?\n\n> I'd really prefer it if I would not have to do the whole\n> conversion again.\n> \nSo do I. ;-)\n\n-- \nMatthias Urlichs   |   {M:U} IT Design @ m-u-it.de   |  smurf@smurf.noris.de\nDisclaimer: The quote was selected randomly. Really. | http://smurf.noris.de\n - -\nImitation is the sincerest form of television.\n\t\t-- Fred Allen\n"},{"id":"5455","messageId":"20050630152150.GP10850@kiste.smurf.noris.de","threadId":"1038","inReplyTo":"20050630145528.GA18553@pc117b.liacs.nl","subject":"Re: [PATCH] cvsimport: perform string comparison on \"HEAD\"","fromName":"Matthias Urlichs","fromEmail":"smurf@smurf.noris.de","sentAt":"2005-06-30T15:21:51Z","receivedAt":"2005-06-30T15:21:51Z","isPatch":true,"sender":{"key":"matthias@urlichs.de","avatar":"https://gravatar.com/avatar/2708905af227313eba6f2b2ae0f7d0259b5ac5d71baef58fe5a13c699ce0bbf0?d=mp&s=160"},"body":"Hi,\n\nSven Verdoolaege:\n> -\t\t$ancestor = $opt_o if $ancestor == \"HEAD\";\n> +\t\t$ancestor = $opt_o if $ancestor eq \"HEAD\";\n\nDuh. Thanks for spotting that. :-/\n\n-- \nMatthias Urlichs   |   {M:U} IT Design @ m-u-it.de   |  smurf@smurf.noris.de\nDisclaimer: The quote was selected randomly. Really. | http://smurf.noris.de\n - -\nI am enough of an artist to draw freely upon my imagination.\nImagination is more important than knowledge.\nKnowledge is limited. Imagination encircles the world.\n\t\t-- Albert Einstein\n"},{"id":"5456","messageId":"20050630154453.GA26808@pc117b.liacs.nl","threadId":"1038","inReplyTo":"20050630152125.GO10850@kiste.smurf.noris.de","subject":"Re: [PATCH] cvsimport: rewritten in Perl","fromName":"Sven Verdoolaege","fromEmail":"skimo@liacs.nl","sentAt":"2005-06-30T15:44:53Z","receivedAt":"2005-06-30T15:44:53Z","isPatch":true,"sender":{"key":"skimo@kotnet.org","avatar":null},"body":"On Thu, Jun 30, 2005 at 05:21:25PM +0200, Matthias Urlichs wrote:\n> Sven Verdoolaege:\n> > Could you try to make the resulting repository compatible\n> > with a repository generated with the old cvs2git ?\n> > \n> I believe I did... at least it worked that way two days ago. ;-)\n> \n> > This is the original version:\n> \n> Which repository is that?\n> \n\nThat was a private repository, but I tried it on another one\nand I see that each commit message has an extra empty line\nwhen compared to both an earlier cvs2git conversion and\n\"cvs log\".\nPresumably you have an extraneous \"\\n\" somewhere.\n\n-d :pserver:anonymous@exp-prolog.cs.kuleuven.ac.be:/cvs/dtse/ Polylib \n\nsverdool@pc117b:/local/kul/Polylib> cvs log typemap  |tail -n 15\nmake Polyhedron subclass of Domain\n----------------------------\nrevision 1.2\ndate: 2001/11/16 16:01:58;  author: sven;  state: Exp;  lines: +15 -1\ntake array when matrix is needed\n----------------------------\nrevision 1.1\ndate: 2001/11/06 15:19:44;  author: sven;  state: Exp;\nbranches:  1.1.1;\nInitial revision\n----------------------------\nrevision 1.1.1.1\ndate: 2001/11/06 15:19:44;  author: sven;  state: Exp;  lines: +0 -0\n\n=============================================================================\n\nsverdool@pc117b:/local/git/Polylib> cg-log typemap | tail -n 26\ncommit b53b0121ac62e9fa9cceb2c483e121d6ba1e24ed\ntree 8d3d8125b8642a21cb9a5efb4e308f91ede06d56\nparent 74d88525870de6c5648580a90920e85f294cae8c\nauthor sven <sven> Mon, 14 Jan 2002 12:48:11 +0000\ncommitter sven <sven> Mon, 14 Jan 2002 12:48:11 +0000\n\n    make Polyhedron subclass of Domain\n    \n\ncommit df6e38c6efe4f161ee35d60728813ddc0f1cb9cf\ntree 43eef31ade1f7a88256e6dff9e66c2e7ca3201db\nparent e38797be1f09c649600e681c8c7dc322e2db504d\nauthor sven <sven> Fri, 16 Nov 2001 16:01:58 +0000\ncommitter sven <sven> Fri, 16 Nov 2001 16:01:58 +0000\n\n    take array when matrix is needed\n    \n\ncommit 4c91382f379478f2ef8b9d875e7c81bddcb3aa57\ntree e0ed0e7b11f9fc0341cdddaa95a8872fe5b01a5c\nauthor sven <sven> Tue, 06 Nov 2001 15:19:44 +0000\ncommitter sven <sven> Tue, 06 Nov 2001 15:19:44 +0000\n\n    Initial revision\n    \n\nsverdool@pc117b:/local/git/Polylib> \n\nskimo\n"},{"id":"5457","messageId":"20050630161043.GR10850@kiste.smurf.noris.de","threadId":"1038","inReplyTo":"20050630154453.GA26808@pc117b.liacs.nl","subject":"Re: [PATCH] cvsimport: rewritten in Perl","fromName":"Matthias Urlichs","fromEmail":"smurf@smurf.noris.de","sentAt":"2005-06-30T16:10:43Z","receivedAt":"2005-06-30T16:10:43Z","isPatch":true,"sender":{"key":"matthias@urlichs.de","avatar":"https://gravatar.com/avatar/2708905af227313eba6f2b2ae0f7d0259b5ac5d71baef58fe5a13c699ce0bbf0?d=mp&s=160"},"body":"Hi,\n\nSven Verdoolaege:\n> Presumably you have an extraneous \"\\n\" somewhere.\n> \nStrange.\nThat must have crept in when I switched from cg-commit to git-commit-tree.\n\nI'll find it. However, you don't actually need to re-import your\nexisting CVS->GIT trees; as long as the dates and the branch names\nmatch, my script will continue where the other left off.\n\n-- \nMatthias Urlichs   |   {M:U} IT Design @ m-u-it.de   |  smurf@smurf.noris.de\nDisclaimer: The quote was selected randomly. Really. | http://smurf.noris.de\n - -\nYou do not have mail.\n"},{"id":"5458","messageId":"20050630161423.GC26808@pc117b.liacs.nl","threadId":"1038","inReplyTo":"20050630161043.GR10850@kiste.smurf.noris.de","subject":"Re: [PATCH] cvsimport: rewritten in Perl","fromName":"Sven Verdoolaege","fromEmail":"skimo@liacs.nl","sentAt":"2005-06-30T16:14:23Z","receivedAt":"2005-06-30T16:14:23Z","isPatch":true,"sender":{"key":"skimo@kotnet.org","avatar":null},"body":"On Thu, Jun 30, 2005 at 06:10:43PM +0200, Matthias Urlichs wrote:\n> I'll find it. However, you don't actually need to re-import your\n> existing CVS->GIT trees; as long as the dates and the branch names\n> match, my script will continue where the other left off.\n\nI wanted to check first whether it would do the right thing.\nI'll wait for your update to do further checking.\n\nskimo\n"},{"id":"5459","messageId":"20050630163000.GT10850@kiste.smurf.noris.de","threadId":"1038","inReplyTo":"20050630161423.GC26808@pc117b.liacs.nl","subject":"Re: [PATCH] cvsimport: rewritten in Perl","fromName":"Matthias Urlichs","fromEmail":"smurf@smurf.noris.de","sentAt":"2005-06-30T16:30:00Z","receivedAt":"2005-06-30T16:30:00Z","isPatch":true,"sender":{"key":"matthias@urlichs.de","avatar":"https://gravatar.com/avatar/2708905af227313eba6f2b2ae0f7d0259b5ac5d71baef58fe5a13c699ce0bbf0?d=mp&s=160"},"body":"Hi,\n\nSven Verdoolaege:\n> I'll wait for your update to do further checking.\n> \nAh, found it -- that was my slightly modified version of cvsps, which\nhappens not to print an extra empty line at the end. cvs2git.c dutifully\nstrips these.\n\nDuh. Will post an incremental patch shortly.\n\n-- \nMatthias Urlichs   |   {M:U} IT Design @ m-u-it.de   |  smurf@smurf.noris.de\nDisclaimer: The quote was selected randomly. Really. | http://smurf.noris.de\n - -\nAs I learn to trust the universe, I no longer need to carry a gun.\n"},{"id":"5460","messageId":"20050630163850.GU10850@kiste.smurf.noris.de","threadId":"1038","inReplyTo":"20050630145528.GA18553@pc117b.liacs.nl","subject":"[PATCH] cvsimport: Limit the log string to 32k","fromName":"Matthias Urlichs","fromEmail":"smurf@smurf.noris.de","sentAt":"2005-06-30T16:38:50Z","receivedAt":"2005-06-30T16:38:50Z","isPatch":true,"sender":{"key":"matthias@urlichs.de","avatar":"https://gravatar.com/avatar/2708905af227313eba6f2b2ae0f7d0259b5ac5d71baef58fe5a13c699ce0bbf0?d=mp&s=160"},"body":"Teach the new cvsimport script to chop the log string's trailing whitespace.\n\nLimit the log string to 32k, in order to be compatible with the old\ncvs2git program.\n\nSigned-Off-By: Matthias Urlichs <smurf@smurf.noris.de>\n\n---\n\ndiff --git a/git-cvsimport-script b/git-cvsimport-script\n--- a/git-cvsimport-script\n+++ b/git-cvsimport-script\n@@ -468,7 +468,12 @@ my $commit = sub {\n \t}\n \t$pw->writer();\n \t$pr->reader();\n-\tprint $pw $logmsg\n+\n+\t# compatibility with git2cvs\n+\tsubstr($logmsg,32767) = \"\" if length($logmsg) > 32767;\n+\t$logmsg =~ s/[\\s\\n]+\\z//;\n+\n+\tprint $pw \"$logmsg\\n\"\n \t\tor die \"Error writing to git-commit-tree: $!\\n\";\n \t$pw->close();\n \n"},{"id":"5461","messageId":"Pine.LNX.4.63.0506301246170.1667@localhost.localdomain","threadId":"1038","inReplyTo":"pan.2005.06.30.10.30.21.176648@smurf.noris.de","subject":"Re: [PATCH] cvsimport: rewritten in Perl","fromName":"Nicolas Pitre","fromEmail":"nico@cam.org","sentAt":"2005-06-30T16:48:34Z","receivedAt":"2005-06-30T16:48:34Z","isPatch":true,"sender":{"key":"nico@fluxnic.net","avatar":"https://avatars.githubusercontent.com/u/702790?v=4"},"body":"On Thu, 30 Jun 2005, Matthias Urlichs wrote:\n\n> Hi, Matthias Urlichs wrote:\n> \n> > Hi, Nicolas Pitre wrote:\n> > \n> >> ftp.kernel.org/pub/scm/linux/kernel/bkcvs/linux-2.5/\n> > \n> > Oh well, I'll have a look. (I never bothered with bk2cvs; there's a\n> > better tool which does bk2git directly.)\n> > \n> OK -- pulled, tested.\n> \n> ... though why you'd want the kernel via CVS instead of by direct\n> BK->GIT import is beyond me. ;-)\n\nThat's just a nice big test case.\n\nYou could try with, say, the gcc CVS as well for example.\n\n\nNicolas\n"},{"id":"5462","messageId":"Pine.LNX.4.63.0506301249550.1667@localhost.localdomain","threadId":"1038","inReplyTo":"pan.2005.06.30.10.34.00.807346@smurf.noris.de","subject":"Re: [PATCH] cvsimport-in-Perl: Limit the number of arguments to git-update-cache","fromName":"Nicolas Pitre","fromEmail":"nico@cam.org","sentAt":"2005-06-30T16:54:07Z","receivedAt":"2005-06-30T16:54:07Z","isPatch":true,"sender":{"key":"nico@fluxnic.net","avatar":"https://avatars.githubusercontent.com/u/702790?v=4"},"body":"On Thu, 30 Jun 2005, Matthias Urlichs wrote:\n\n> A small fix to git-cvsimport-script:\n> \n> Limit the number of arguments to git-update-cache.\n> (Limiting their length may make a bit more sense, but I'm lazy.)\n\nWhy not using:\n\n\twrite( \"| xargs | git-update-cache --add --\", @new)\n\nor the like (I forget what the exact perl incantation is).\n\n\nNicolas\n"},{"id":"5463","messageId":"Pine.LNX.4.63.0506301314280.1667@localhost.localdomain","threadId":"1038","inReplyTo":"Pine.LNX.4.63.0506301249550.1667@localhost.localdomain","subject":"Re: [PATCH] cvsimport-in-Perl: Limit the number of arguments to git-update-cache","fromName":"Nicolas Pitre","fromEmail":"nico@cam.org","sentAt":"2005-06-30T17:15:14Z","receivedAt":"2005-06-30T17:15:14Z","isPatch":true,"sender":{"key":"nico@fluxnic.net","avatar":"https://avatars.githubusercontent.com/u/702790?v=4"},"body":"On Thu, 30 Jun 2005, Nicolas Pitre wrote:\n\n> On Thu, 30 Jun 2005, Matthias Urlichs wrote:\n> \n> > A small fix to git-cvsimport-script:\n> > \n> > Limit the number of arguments to git-update-cache.\n> > (Limiting their length may make a bit more sense, but I'm lazy.)\n> \n> Why not using:\n> \n> \twrite( \"| xargs | git-update-cache --add --\", @new)\n\nThat example should be:\n\n\twrite( \"| xargs git-update-cache --add --\", @new)\n\nof course.\n\n\nNicolas\n"},{"id":"5464","messageId":"Pine.LNX.4.63.0506301321350.1667@localhost.localdomain","threadId":"1038","inReplyTo":"20050630163000.GT10850@kiste.smurf.noris.de","subject":"Re: [PATCH] cvsimport: rewritten in Perl","fromName":"Nicolas Pitre","fromEmail":"nico@cam.org","sentAt":"2005-06-30T17:22:53Z","receivedAt":"2005-06-30T17:22:53Z","isPatch":true,"sender":{"key":"nico@fluxnic.net","avatar":"https://avatars.githubusercontent.com/u/702790?v=4"},"body":"On Thu, 30 Jun 2005, Matthias Urlichs wrote:\n\n> Duh. Will post an incremental patch shortly.\n\nUntil Linus merges it I'd suggest that you post the updated full patch \ninstead.\n\n\nNicolas\n"},{"id":"5467","messageId":"20050630180224.GW10850@kiste.smurf.noris.de","threadId":"1038","inReplyTo":"Pine.LNX.4.63.0506301314280.1667@localhost.localdomain","subject":"Re: [PATCH] cvsimport-in-Perl: Limit the number of arguments to git-update-cache","fromName":"Matthias Urlichs","fromEmail":"smurf@smurf.noris.de","sentAt":"2005-06-30T18:02:24Z","receivedAt":"2005-06-30T18:02:24Z","isPatch":true,"sender":{"key":"matthias@urlichs.de","avatar":"https://gravatar.com/avatar/2708905af227313eba6f2b2ae0f7d0259b5ac5d71baef58fe5a13c699ce0bbf0?d=mp&s=160"},"body":"Hi,\n\nNicolas Pitre:\n> That example should be:\n> \n> \twrite( \"| xargs git-update-cache --add --\", @new)\n> \n> of course.\n> \nActually, 'local $\\ = \"\\0\";' and 'xargs -0', which is roughly the point\nwhere doing it all in Perl starts being more readable. ;-)\n\n-- \nMatthias Urlichs   |   {M:U} IT Design @ m-u-it.de   |  smurf@smurf.noris.de\nDisclaimer: The quote was selected randomly. Really. | http://smurf.noris.de\n - -\nThe only secure computer is one that's unplugged, locked in a safe,\nand buried 20 feet under the ground in a secret location... and I'm\nnot even too sure about that one.\n\t\t-- Dennis Huges, FBI.\n"},{"id":"5471","messageId":"1120157313.2066.324.camel@sisko.sctweedie.blueyonder.co.uk","threadId":"1038","inReplyTo":"pan.2005.06.28.19.23.08.307486@smurf.noris.de","subject":"Re: [PATCH] cvsimport: rewritten in Perl","fromName":"Stephen C. Tweedie","fromEmail":"sct@redhat.com","sentAt":"2005-06-30T18:48:33Z","receivedAt":"2005-06-30T18:48:33Z","isPatch":true,"sender":{"key":"sct@redhat.com","avatar":null},"body":"Hi,\n\nOn Tue, 2005-06-28 at 20:23, Matthias Urlichs wrote:\n\n> That was cvs2git's shell script. Which, by the way, is slow as hell.\n\nI discovered why yesterday --- it's this patch:\n\ncommit deb153a75ae1f5eca628a38b911474a69edd242d\n...\n    [PATCH] cvs2git and file permissions\n    git-cvs2git: propagate mode information\n     \n    Let cvs checkout in a temporary directory rather than\n    using the pipe option to avoid loss of mode information.\n\nThis has a very unfortunate side effect --- when CVS checks out into a\nnew directory, it then waits for the time to advance to the next second\nso that it can guarantee that future writes to the checked-out file\nalways change the timestamp from what it stores in CVS/Entries.\n\nAnd when you're doing repeated checkouts, that means you get one per\nsecond, max.  And so the git cvs import was taking one ... second ...\nper ... revision ... per ... file, instead of the 8 complete changesets\nor better I was getting before the above change.\n\nReverting the change back to checkout-via-pipe fixed the performance\nproblem for me, but obviously we're back to losing the mode information.\n\n--Stephen\n"},{"id":"5474","messageId":"20050630193825.GA17345@pc117b.liacs.nl","threadId":"1038","inReplyTo":"20050630161043.GR10850@kiste.smurf.noris.de","subject":"Re: [PATCH] cvsimport: rewritten in Perl","fromName":"Sven Verdoolaege","fromEmail":"skimo@liacs.nl","sentAt":"2005-06-30T19:38:25Z","receivedAt":"2005-06-30T19:38:25Z","isPatch":true,"sender":{"key":"skimo@kotnet.org","avatar":null},"body":"On Thu, Jun 30, 2005 at 06:10:43PM +0200, Matthias Urlichs wrote:\n> I'll find it. However, you don't actually need to re-import your\n> existing CVS->GIT trees; as long as the dates and the branch names\n> match, my script will continue where the other left off.\n\nThat seems to work, once I figured out I had to pass in the \"-o master\"\noption (as cvs2git didn't create an \"origin\" branch).\n\nIf you don't, you get a rather cryptic message:\nusage: git-read-tree (<sha> | -m [-u] <sha1> [<sha2> [<sha3>]])\nread-tree failed: 256\n\nYou probably want to check whether the origin branch actually\nexists.\n\nApparently you also need to pass the '-x' option to cvsps.\nOtherwise, it won't look at anything new.\n\nIt would also be nice if the user could pass extra options\nto cvsps (notably '-z').\n\nskimo\n"},{"id":"5486","messageId":"20050630210023.GY10850@kiste.smurf.noris.de","threadId":"1038","inReplyTo":"20050630193825.GA17345@pc117b.liacs.nl","subject":"Re: [PATCH] cvsimport: rewritten in Perl","fromName":"Matthias Urlichs","fromEmail":"smurf@smurf.noris.de","sentAt":"2005-06-30T21:00:23Z","receivedAt":"2005-06-30T21:00:23Z","isPatch":true,"sender":{"key":"matthias@urlichs.de","avatar":"https://gravatar.com/avatar/2708905af227313eba6f2b2ae0f7d0259b5ac5d71baef58fe5a13c699ce0bbf0?d=mp&s=160"},"body":"Hi,\n\nSven Verdoolaege:\n> On Thu, Jun 30, 2005 at 06:10:43PM +0200, Matthias Urlichs wrote:\n> > I'll find it. However, you don't actually need to re-import your\n> > existing CVS->GIT trees; as long as the dates and the branch names\n> > match, my script will continue where the other left off.\n> \n> That seems to work, once I figured out I had to pass in the \"-o master\"\n> option (as cvs2git didn't create an \"origin\" branch).\n> \nYes -- that's intentional, as the \"master\" branch is the one you're\ngoing to add your own work to once the improt is finished. Using\n\"master\" as CVS HEAD would mean that incremental imports no longer work.\n\n> If you don't, you get a rather cryptic message:\n> usage: git-read-tree (<sha> | -m [-u] <sha1> [<sha2> [<sha3>]])\n> read-tree failed: 256\n> \n> You probably want to check whether the origin branch actually\n> exists.\n> \nI'll add that, thanks.\n\n> Apparently you also need to pass the '-x' option to cvsps.\n> Otherwise, it won't look at anything new.\n> \nDitto.\n\n> It would also be nice if the user could pass extra options\n> to cvsps (notably '-z').\n> \nDitto.  ;-)\n\n-- \nMatthias Urlichs   |   {M:U} IT Design @ m-u-it.de   |  smurf@smurf.noris.de\nDisclaimer: The quote was selected randomly. Really. | http://smurf.noris.de\n - -\nDon't let grass grow on the path of friendship.\n\t\t-- Blackfoot Indian\n"},{"id":"5527","messageId":"20050701070108.GA25803@pc117b.liacs.nl","threadId":"1038","inReplyTo":"20050630210023.GY10850@kiste.smurf.noris.de","subject":"Re: [PATCH] cvsimport: rewritten in Perl","fromName":"Sven Verdoolaege","fromEmail":"skimo@liacs.nl","sentAt":"2005-07-01T07:01:09Z","receivedAt":"2005-07-01T07:01:09Z","isPatch":true,"sender":{"key":"skimo@kotnet.org","avatar":null},"body":"On Thu, Jun 30, 2005 at 11:00:23PM +0200, Matthias Urlichs wrote:\n> Sven Verdoolaege:\n> > It would also be nice if the user could pass extra options\n> > to cvsps (notably '-z').\n> > \n> Ditto.  ;-)\n> \n\nActually, do you really have to call cvsps from within your\nscript ?  Why don't you just keep the small shell script\nthat links cvsps to cvs2git (your version) ?\n\nskimo\n"},{"id":"5528","messageId":"20050701072519.GF10850@kiste.smurf.noris.de","threadId":"1038","inReplyTo":"20050701070108.GA25803@pc117b.liacs.nl","subject":"Re: [PATCH] cvsimport: rewritten in Perl","fromName":"Matthias Urlichs","fromEmail":"smurf@smurf.noris.de","sentAt":"2005-07-01T07:25:19Z","receivedAt":"2005-07-01T07:25:19Z","isPatch":true,"sender":{"key":"matthias@urlichs.de","avatar":"https://gravatar.com/avatar/2708905af227313eba6f2b2ae0f7d0259b5ac5d71baef58fe5a13c699ce0bbf0?d=mp&s=160"},"body":"Hi,\n\nSven Verdoolaege:\n> On Thu, Jun 30, 2005 at 11:00:23PM +0200, Matthias Urlichs wrote:\n> > Sven Verdoolaege:\n> > > It would also be nice if the user could pass extra options\n> > > to cvsps (notably '-z').\n> > > \n> > Ditto.  ;-)\n> \n> Actually, do you really have to call cvsps from within your\n> script ?  Why don't you just keep the small shell script\n> that links cvsps to cvs2git (your version) ?\n\nI dislike temporary files, a shell pipe can't catch errors in earlier\nstages without major hackery, Linus didn't have a problem with ripping\nit out, and in an earlier life this script was called cvs2bk and called\nbk directly, so I kept that.\n\nEnough reasons? ;-)  Sure, none of them really prevent me from doing it,\nbut OTOH I see no reason to resurrect the shell script either.\n\n-- \nMatthias Urlichs   |   {M:U} IT Design @ m-u-it.de   |  smurf@smurf.noris.de\nDisclaimer: The quote was selected randomly. Really. | http://smurf.noris.de\n - -\nChristianity has nothing to offer a happy man\nliving in a natural, intelligible universe.\n\t\t-- George H. Smith, \"Atheism: The Case Against God\"\n"},{"id":"5529","messageId":"pan.2005.07.01.09.43.24.106822@smurf.noris.de","threadId":"1038","inReplyTo":"Pine.LNX.4.63.0506301321350.1667@localhost.localdomain","subject":"Re: cvsimport: rewritten in Perl","fromName":"Matthias Urlichs","fromEmail":"smurf@smurf.noris.de","sentAt":"2005-07-01T09:43:34Z","receivedAt":"2005-07-01T09:43:34Z","isPatch":false,"sender":{"key":"matthias@urlichs.de","avatar":"https://gravatar.com/avatar/2708905af227313eba6f2b2ae0f7d0259b5ac5d71baef58fe5a13c699ce0bbf0?d=mp&s=160"},"body":"Hi, Nicolas Pitre wrote:\n\n> On Thu, 30 Jun 2005, Matthias Urlichs wrote:\n> \n>> Duh. Will post an incremental patch shortly.\n> \n> Until Linus merges it I'd suggest that you post the updated full patch \n> instead.\n\nPersonally, I'd prefer merging.\n\nLinus/everybody_else  :-) : Please pull from\n\nrsync://netz.smurf.noris.de/git.git#cvs2git\n\n-- \nMatthias Urlichs   |   {M:U} IT Design @ m-u-it.de   |  smurf@smurf.noris.de\nDisclaimer: The quote was selected randomly. Really. | http://smurf.noris.de\n - -\nWe were hungry when we got to Moscow, Soviet.\n\t\t\t\t\t-- Groucho Marx\n"},{"id":"5595","messageId":"20050703103517.GJ5992MdfPADPa@garage.linux.student.kuleuven.ac.be","threadId":"1038","inReplyTo":"pan.2005.07.01.09.43.24.106822@smurf.noris.de","subject":"Re: cvsimport: rewritten in Perl","fromName":"Sven Verdoolaege","fromEmail":"skimo@kotnet.org","sentAt":"2005-07-03T10:35:17Z","receivedAt":"2005-07-03T10:35:17Z","isPatch":false,"sender":{"key":"skimo@kotnet.org","avatar":null},"body":"On Fri, Jul 01, 2005 at 11:43:34AM +0200, Matthias Urlichs wrote:\n> Personally, I'd prefer merging.\n> \nPull this one then:\n\nhttp://www.liacs.nl/~sverdool/git.git#cvs2git\n\nskimo\n"},{"id":"5596","messageId":"20050703103654.GK5992MdfPADPa@garage.linux.student.kuleuven.ac.be","threadId":"1038","inReplyTo":"20050703103517.GJ5992MdfPADPa@garage.linux.student.kuleuven.ac.be","subject":"[PATCH] Make specification of CVS module to convert optional.","fromName":"Sven Verdoolaege","fromEmail":"skimo@kotnet.org","sentAt":"2005-07-03T10:36:54Z","receivedAt":"2005-07-03T10:36:54Z","isPatch":true,"sender":{"key":"skimo@kotnet.org","avatar":null},"body":"Make specification of CVS module to convert optional.\n\nIf we're inside a checked out CVS repository, there is\nno need to explicitly specify the module as it is\navailable in CVS/Repository.\nAlso read CVS/Root if it's available and -d is not specified.\nFinally, explicitly pass root to cvsps as CVS/Root takes\nprecedence over CVSROOT.\n\nSigned-off-by: Sven Verdoolaege <skimo@kotnet.org>\n\n---\ncommit f9714a4a0cd4ed0ccca3833743d98ea874a2232d\ntree de5d7bba63538f29b8ea2b801d932b7679289b96\nparent 1cd3674add10d1e511446f3034a1d233a3da7eab\nauthor Sven Verdoolaege <skimo@kotnet.org> Sun, 03 Jul 2005 11:34:59 +0200\ncommitter Sven Verdoolaege <skimo@kotnet.org> Sun, 03 Jul 2005 11:40:44 +0200\n\n Documentation/git-cvsimport-script.txt |    2 +-\n git-cvsimport-script                   |   34 ++++++++++++++++++++++++--------\n 2 files changed, 27 insertions(+), 9 deletions(-)\n\ndiff --git a/Documentation/git-cvsimport-script.txt b/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<CVS_module> [ <GIT_repository> ]\n+\t\t\t[ -C <GIT_repository> ] [ <CVS_module> ]\n \n \n DESCRIPTION\ndiff --git a/git-cvsimport-script b/git-cvsimport-script\n--- a/git-cvsimport-script\n+++ b/git-cvsimport-script\n@@ -26,35 +26,53 @@ 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);\n+our($opt_h,$opt_o,$opt_v,$opt_d,$opt_p,$opt_C);\n \n sub usage() {\n \tprint STDERR <<END;\n Usage: ${\\basename $0}     # fetch/update GIT from CVS\n \t   [ -o branch-for-HEAD ] [ -h ] [ -v ] [ -d CVSROOT ]\n-       [ -p opts-for-cvsps ]\n-       CVS_module [ GIT_repository ]\n+       [ -p opts-for-cvsps ] [ -C GIT_repository ]\n+       [ CVS_module ]\n END\n \texit(1);\n }\n \n-getopts(\"hqvo:d:p:\") or usage();\n+getopts(\"hqvo:d:p:C:\") or usage();\n usage if $opt_h;\n \n-@ARGV == 1 or @ARGV == 2 or usage();\n-\n-my($cvs_tree, $git_tree) = @ARGV;\n+@ARGV <= 1 or usage();\n \n if($opt_d) {\n \t$ENV{\"CVSROOT\"} = $opt_d;\n+} elsif(-f 'CVS/Root') {\n+\topen my $f, '<', 'CVS/Root' or die 'Failed to open CVS/Root';\n+\t$opt_d = <$f>;\n+\tchomp $opt_d;\n+\tclose $f;\n+\t$ENV{\"CVSROOT\"} = $opt_d;\n } elsif($ENV{\"CVSROOT\"}) {\n \t$opt_d = $ENV{\"CVSROOT\"};\n } else {\n \tdie \"CVSROOT needs to be set\";\n }\n $opt_o ||= \"origin\";\n+my $git_tree = $opt_C;\n $git_tree ||= \".\";\n \n+my $cvs_tree;\n+if ($#ARGV == 0) {\n+\t$cvs_tree = $ARGV[0];\n+} elsif (-f 'CVS/Repository') {\n+\topen my $f, '<', 'CVS/Repository' or \n+\t    die 'Failed to open CVS/Repository';\n+\t$cvs_tree = <$f>;\n+\tchomp $cvs_tree;\n+\tclose $f\n+} else {\n+\tusage();\n+}\n+\n select(STDERR); $|=1; select(STDOUT);\n \n \n@@ -378,7 +396,7 @@ die \"Cannot fork: $!\\n\" unless defined $\n unless($pid) {\n \tmy @opt;\n \t@opt = split(/,/,$opt_p) if defined $opt_p;\n-\texec(\"cvsps\",@opt,\"-x\",\"-A\",\"--cvs-direct\",$cvs_tree);\n+\texec(\"cvsps\",@opt,\"-x\",\"-A\",\"--cvs-direct\",'--root',$opt_d,$cvs_tree);\n \tdie \"Could not start cvsps: $!\\n\";\n }\n \n"},{"id":"5597","messageId":"20050703103753.GL5992MdfPADPa@garage.linux.student.kuleuven.ac.be","threadId":"1038","inReplyTo":"20050703103517.GJ5992MdfPADPa@garage.linux.student.kuleuven.ac.be","subject":"git-cvsimport-script: clean up documentation","fromName":"Sven Verdoolaege","fromEmail":"skimo@kotnet.org","sentAt":"2005-07-03T10:37:54Z","receivedAt":"2005-07-03T10:37:54Z","isPatch":false,"sender":{"key":"skimo@kotnet.org","avatar":null},"body":"git-cvsimport-script: clean up documentation\n\nRemove documentation of irrelevant \"type\" option.\n\nSigned-off-by: Sven Verdoolaege <skimo@kotnet.org>\n\n---\ncommit a92bebe6978edaea2885a627e7bef6f7f8b208c2\ntree 25e9a3324ac489b7987be562923fd8e81a5de358\nparent f9714a4a0cd4ed0ccca3833743d98ea874a2232d\nauthor Sven Verdoolaege <skimo@kotnet.org> Sun, 03 Jul 2005 11:38:06 +0200\ncommitter Sven Verdoolaege <skimo@kotnet.org> Sun, 03 Jul 2005 11:40:45 +0200\n\n Documentation/git-cvsimport-script.txt |    8 --------\n 1 files changed, 0 insertions(+), 8 deletions(-)\n\ndiff --git a/Documentation/git-cvsimport-script.txt b/Documentation/git-cvsimport-script.txt\n--- a/Documentation/git-cvsimport-script.txt\n+++ b/Documentation/git-cvsimport-script.txt\n@@ -48,14 +48,6 @@ OPTIONS\n <CVS_module>::\n \tThe CVS module you want to import. Relative to <CVSROOT>.\n \n-<type>::\n-\tTypically this matches the real type of <object> but asking\n-\tfor a type that can trivially dereferenced from the given\n-\t<object> is also permitted.  An example is to ask for a\n-\t\"tree\" with <object> being a commit object that contains it,\n-\tor to ask for a \"blob\" with <object> being a tag object that\n-\tpoints at it.\n-\n -h::\n \tPrint a short usage message and exit.\n \n"},{"id":"5599","messageId":"20050703113736.GA18608MdfPADPa@garage.linux.student.kuleuven.ac.be","threadId":"1038","inReplyTo":"20050703103517.GJ5992MdfPADPa@garage.linux.student.kuleuven.ac.be","subject":"git-cvsimport-script: Honour CVS_SERVER.","fromName":"Sven Verdoolaege","fromEmail":"skimo@kotnet.org","sentAt":"2005-07-03T11:37:36Z","receivedAt":"2005-07-03T11:37:36Z","isPatch":false,"sender":{"key":"skimo@kotnet.org","avatar":null},"body":"Honour CVS_SERVER.\n\n---\ncommit 8d0ea3117597933610e02907d14b443f8996ca3b\ntree 8a8aba2772a770082e7d6bd47abd42c3e239ed2c\nparent a92bebe6978edaea2885a627e7bef6f7f8b208c2\nauthor Sven Verdoolaege <skimo@kotnet.org> Sun, 03 Jul 2005 12:26:51 +0200\ncommitter Sven Verdoolaege <skimo@kotnet.org> Sun, 03 Jul 2005 12:26:51 +0200\n\n git-cvsimport-script |    4 +++-\n 1 files changed, 3 insertions(+), 1 deletions(-)\n\ndiff --git a/git-cvsimport-script b/git-cvsimport-script\n--- a/git-cvsimport-script\n+++ b/git-cvsimport-script\n@@ -148,6 +148,8 @@ sub conn {\n \t\tmy $pw = IO::Pipe->new();\n \t\tmy $pid = fork();\n \t\tdie \"Fork: $!\\n\" unless defined $pid;\n+\t\tmy $cvs = 'cvs';\n+\t\t$cvs = $ENV{CVS_SERVER} if exists $ENV{CVS_SERVER};\n \t\tunless($pid) {\n \t\t\t$pr->writer();\n \t\t\t$pw->reader();\n@@ -155,7 +157,7 @@ sub conn {\n \t\t\tdup2($pr->fileno(),1);\n \t\t\t$pr->close();\n \t\t\t$pw->close();\n-\t\t\texec(\"cvs\",\"server\");\n+\t\t\texec($cvs,\"server\");\n \t\t}\n \t\t$pw->writer();\n \t\t$pr->reader();\n"},{"id":"5600","messageId":"20050703113830.GB18608MdfPADPa@garage.linux.student.kuleuven.ac.be","threadId":"1038","inReplyTo":"20050703103517.GJ5992MdfPADPa@garage.linux.student.kuleuven.ac.be","subject":"[PATCH] git-cvsimport-script: Support :ext: access method.","fromName":"Sven Verdoolaege","fromEmail":"skimo@kotnet.org","sentAt":"2005-07-03T11:38:30Z","receivedAt":"2005-07-03T11:38:30Z","isPatch":true,"sender":{"key":"skimo@kotnet.org","avatar":null},"body":"Support :ext: access method.\n\n---\ncommit 34155390a576d8124e0adc864aaf2f11bbf5168b\ntree 4918235816314f1d9981456cb05e395b6030c035\nparent 8d0ea3117597933610e02907d14b443f8996ca3b\nauthor Sven Verdoolaege <skimo@kotnet.org> Sun, 03 Jul 2005 13:02:06 +0200\ncommitter Sven Verdoolaege <skimo@kotnet.org> Sun, 03 Jul 2005 13:02:06 +0200\n\n Documentation/git-cvsimport-script.txt |    3 ++-\n git-cvsimport-script                   |   23 +++++++++++++++++++++--\n 2 files changed, 23 insertions(+), 3 deletions(-)\n\ndiff --git a/Documentation/git-cvsimport-script.txt b/Documentation/git-cvsimport-script.txt\n--- a/Documentation/git-cvsimport-script.txt\n+++ b/Documentation/git-cvsimport-script.txt\n@@ -26,7 +26,8 @@ OPTIONS\n -------\n -d <CVSROOT>::\n \tThe root of the CVS archive. May be local (a simple path) or remote;\n-\tcurrently, only the :pserver: access method is supported.\n+\tcurrently, only the :local:, :ext: and :pserver: access methods \n+\tare supported.\n \n -o <branch-for-HEAD>::\n \tThe 'HEAD' branch from CVS is imported to the 'origin' branch within\ndiff --git a/git-cvsimport-script b/git-cvsimport-script\n--- a/git-cvsimport-script\n+++ b/git-cvsimport-script\n@@ -143,13 +143,32 @@ sub conn {\n \t\t}\n \t\t$self->{'socketo'} = $s;\n \t\t$self->{'socketi'} = $s;\n-\t} else { # local: Fork off our own cvs server.\n+\t} else { # local or ext: Fork off our own cvs server.\n \t\tmy $pr = IO::Pipe->new();\n \t\tmy $pw = IO::Pipe->new();\n \t\tmy $pid = fork();\n \t\tdie \"Fork: $!\\n\" unless defined $pid;\n \t\tmy $cvs = 'cvs';\n \t\t$cvs = $ENV{CVS_SERVER} if exists $ENV{CVS_SERVER};\n+\t\tmy $rsh = 'rsh';\n+\t\t$rsh = $ENV{CVS_RSH} if exists $ENV{CVS_RSH};\n+\n+\t\tmy @cvs = ($cvs, 'server');\n+\t\tmy ($local, $user, $host);\n+\t\t$local = $repo =~ s/:local://;\n+\t\tif (!$local) {\n+\t\t    $repo =~ s/:ext://;\n+\t\t    $local = !($repo =~ s/^(?:([^\\@:]+)\\@)?([^:]+)://);\n+\t\t    ($user, $host) = ($1, $2);\n+\t\t}\n+\t\tif (!$local) {\n+\t\t    if ($user) {\n+\t\t\tunshift @cvs, $rsh, '-l', $user, $host;\n+\t\t    } else {\n+\t\t\tunshift @cvs, $rsh, $host;\n+\t\t    }\n+\t\t}\n+\n \t\tunless($pid) {\n \t\t\t$pr->writer();\n \t\t\t$pw->reader();\n@@ -157,7 +176,7 @@ sub conn {\n \t\t\tdup2($pr->fileno(),1);\n \t\t\t$pr->close();\n \t\t\t$pw->close();\n-\t\t\texec($cvs,\"server\");\n+\t\t\texec(@cvs);\n \t\t}\n \t\t$pw->writer();\n \t\t$pr->reader();\n"},{"id":"5602","messageId":"20050703122110.GC18608MdfPADPa@garage.linux.student.kuleuven.ac.be","threadId":"1038","inReplyTo":"20050703103517.GJ5992MdfPADPa@garage.linux.student.kuleuven.ac.be","subject":"Re: cvsimport: rewritten in Perl","fromName":"Sven Verdoolaege","fromEmail":"skimo@kotnet.org","sentAt":"2005-07-03T12:21:10Z","receivedAt":"2005-07-03T12:21:10Z","isPatch":false,"sender":{"key":"skimo@kotnet.org","avatar":null},"body":"On Sun, Jul 03, 2005 at 12:35:17PM +0200, Sven Verdoolaege wrote:\n> On Fri, Jul 01, 2005 at 11:43:34AM +0200, Matthias Urlichs wrote:\n> > Personally, I'd prefer merging.\n> > \n> Pull this one then:\n> \n> http://www.liacs.nl/~sverdool/git.git#cvs2git\n\nThat was a cogito branch, btw.\nIn git you'd say:\n\ngit-http-pull -c -v -t -a heads/cvs2git http://www.liacs.nl/~sverdool/git.git/\n\nskimo\n"},{"id":"5604","messageId":"pan.2005.07.03.13.44.46.995524@smurf.noris.de","threadId":"1038","inReplyTo":"20050703122110.GC18608MdfPADPa@garage.linux.student.kuleuven.ac.be","subject":"Re: cvsimport: rewritten in Perl","fromName":"Matthias Urlichs","fromEmail":"smurf@smurf.noris.de","sentAt":"2005-07-03T13:44:47Z","receivedAt":"2005-07-03T13:44:47Z","isPatch":false,"sender":{"key":"matthias@urlichs.de","avatar":"https://gravatar.com/avatar/2708905af227313eba6f2b2ae0f7d0259b5ac5d71baef58fe5a13c699ce0bbf0?d=mp&s=160"},"body":"Hi, Sven Verdoolaege wrote:\n\n>> http://www.liacs.nl/~sverdool/git.git#cvs2git\n> \n> That was a cogito branch, btw.\n> In git you'd say:\n> \n> git-http-pull -c -v -t -a heads/cvs2git http://www.liacs.nl/~sverdool/git.git/\n> \nYour patches make sense -- thanks; imported.\n\nLinus: Please grab http://netz.smurf.noris.de/git/git.git/#cvs2git.\n\n(A very git-ty URL, that.)\n\n-- \nMatthias Urlichs   |   {M:U} IT Design @ m-u-it.de   |  smurf@smurf.noris.de\nDisclaimer: The quote was selected randomly. Really. | http://smurf.noris.de\n - -\nQuantum Mechanics is God's version of \"Trust me.\"\n"},{"id":"5614","messageId":"20050703230326.GF18608MdfPADPa@garage.linux.student.kuleuven.ac.be","threadId":"1038","inReplyTo":"20050630152125.GO10850@kiste.smurf.noris.de","subject":"Re: [PATCH] cvsimport: rewritten in Perl","fromName":"Sven Verdoolaege","fromEmail":"skimo@kotnet.org","sentAt":"2005-07-03T23:03:26Z","receivedAt":"2005-07-03T23:03:26Z","isPatch":true,"sender":{"key":"skimo@kotnet.org","avatar":null},"body":"On Thu, Jun 30, 2005 at 05:21:25PM +0200, Matthias Urlichs wrote:\n> Sven Verdoolaege:\n> > Could you try to make the resulting repository compatible\n> > with a repository generated with the old cvs2git ?\n> > \n> I believe I did... at least it worked that way two days ago. ;-)\n> \n\nI've found another difference.\n\nOn -p -z,60 -d :ext:anoncvs@savannah.gnu.org:/cvsroot/libtool libtool\non the gord branch,\nthe old cvs2git would create\n\n[..]\ncommit 9d829ba90211956c53ebd40d2ba5daa454bedf03\ntree e5aab59ed74c6e9fa1686dd914e2c7f7526f3bb6\nparent 22acdc03db3de37ce19fac68babc1f2ec0011a42\nauthor gord <gord> Tue, 01 Apr 1997 18:29:23 +0000\ncommitter gord <gord> Tue, 01 Apr 1997 18:29:23 +0000\n\n    *** empty log message ***\n\ncommit 22acdc03db3de37ce19fac68babc1f2ec0011a42\ntree 4f8d0cc71683897d1332b485e59d164ff6a233c2\nparent 27236f713eec57889949b0498cfaf446735b670d\nauthor gord <gord> Tue, 01 Apr 1997 18:29:23 +0000\ncommitter gord <gord> Tue, 01 Apr 1997 18:29:23 +0000\n\n\n[..]\nwhereas your script creates:\n\n[..]\ncommit f9450d4e45bdd760183383a4f698a70136e17f03\ntree e5aab59ed74c6e9fa1686dd914e2c7f7526f3bb6\nparent a8b919fa4784e5845f7cf61f53251804945c1b35\nauthor gord <gord> Tue, 01 Apr 1997 18:29:23 +0000\ncommitter gord <gord> Tue, 01 Apr 1997 18:29:23 +0000\n\n\ncommit a8b919fa4784e5845f7cf61f53251804945c1b35\ntree b82881ae63c0cef645cd2d50050d2961d2c8871d\nparent 27236f713eec57889949b0498cfaf446735b670d\nauthor gord <gord> Tue, 01 Apr 1997 18:29:23 +0000\ncommitter gord <gord> Tue, 01 Apr 1997 18:29:23 +0000\n\n    *** empty log message ***\n\n[..]\n\nNote how the patchsets with the same date have somehow\nbeen reversed.  Any ideas ?\n\nI've also found another typo in your script; see my repo.\n\nskimo\n"},{"id":"5617","messageId":"20050704014948.GK29809@kiste.smurf.noris.de","threadId":"1038","inReplyTo":"20050703230326.GF18608MdfPADPa@garage.linux.student.kuleuven.ac.be","subject":"Re: [PATCH] cvsimport: rewritten in Perl","fromName":"Matthias Urlichs","fromEmail":"smurf@smurf.noris.de","sentAt":"2005-07-04T01:49:48Z","receivedAt":"2005-07-04T01:49:48Z","isPatch":true,"sender":{"key":"matthias@urlichs.de","avatar":"https://gravatar.com/avatar/2708905af227313eba6f2b2ae0f7d0259b5ac5d71baef58fe5a13c699ce0bbf0?d=mp&s=160"},"body":"Hi,\n\nSven Verdoolaege:\n> Note how the patchsets with the same date have somehow\n> been reversed.  Any ideas ?\n> \nNo. I process the lines from cvsps in the order I get them...\n\n> I've also found another typo in your script; see my repo.\n> \nThanks. I guess. ;-)\n\n-- \nMatthias Urlichs   |   {M:U} IT Design @ m-u-it.de   |  smurf@smurf.noris.de\nDisclaimer: The quote was selected randomly. Really. | http://smurf.noris.de\n - -\nPeople who run down others are taking a roundabout way of praising themselves.\n"},{"id":"5623","messageId":"20050704104739.GH18608MdfPADPa@garage.linux.student.kuleuven.ac.be","threadId":"1038","inReplyTo":"20050704014948.GK29809@kiste.smurf.noris.de","subject":"Re: [PATCH] cvsimport: rewritten in Perl","fromName":"Sven Verdoolaege","fromEmail":"skimo@kotnet.org","sentAt":"2005-07-04T10:47:39Z","receivedAt":"2005-07-04T10:47:39Z","isPatch":true,"sender":{"key":"skimo@kotnet.org","avatar":null},"body":"Hi,\n\nOn Mon, Jul 04, 2005 at 03:49:48AM +0200, Matthias Urlichs wrote:\n> Sven Verdoolaege:\n> > Note how the patchsets with the same date have somehow\n> > been reversed.  Any ideas ?\n> > \n> No. I process the lines from cvsps in the order I get them...\n> \n\nOk, I reran cvs2git and now I get the same order as with\nyour script.  Something must have changed in the output\nof cvsps.\n\nskimo\n"},{"id":"5624","messageId":"20050704121309.GI18608MdfPADPa@garage.linux.student.kuleuven.ac.be","threadId":"1038","inReplyTo":"20050703103517.GJ5992MdfPADPa@garage.linux.student.kuleuven.ac.be","subject":"[PATCH] git-cvsimport-script: leave working directory alone.","fromName":"Sven Verdoolaege","fromEmail":"skimo@kotnet.org","sentAt":"2005-07-04T12:13:09Z","receivedAt":"2005-07-04T12:13:09Z","isPatch":true,"sender":{"key":"skimo@kotnet.org","avatar":null},"body":"git-cvsimport-script: leave working directory alone.\n\n---\ncommit 2eb6d82eaa869a1faf4ba3326fd628f76f9f93a8\ntree 3e59c8c298e51a8ae20102b4b139c84c79fa54a0\nparent 866d13108e969773347828daa9b7f3476ec70cb8\nauthor Sven Verdoolaege <skimo@kotnet.org> Mon, 04 Jul 2005 00:43:26 +0200\ncommitter Sven Verdoolaege <skimo@kotnet.org> Mon, 04 Jul 2005 00:43:26 +0200\n\n git-cvsimport-script |   81 ++++++++++++++++++++++++++++++--------------------\n 1 files changed, 48 insertions(+), 33 deletions(-)\n\ndiff --git a/git-cvsimport-script b/git-cvsimport-script\n--- a/git-cvsimport-script\n+++ b/git-cvsimport-script\n@@ -80,6 +80,8 @@ package CVSconn;\n # Basic CVS dialog.\n # We're only interested in connecting and downloading, so ...\n \n+use File::Spec;\n+use File::Temp qw(tempfile);\n use POSIX qw(strftime dup2);\n \n sub new {\n@@ -231,11 +233,11 @@ sub _file {\n sub _line {\n \t# Read a line from the server.\n \t# ... except that 'line' may be an entire file. ;-)\n-\tmy($self) = @_;\n+\tmy($self, $fh) = @_;\n \tdie \"Not in lines\" unless defined $self->{'lines'};\n \n \tmy $line;\n-\tmy $res=\"\";\n+\tmy $res=0;\n \twhile(defined($line = $self->readline())) {\n \t\t# M U gnupg-cvs-rep/AUTHORS\n \t\t# Updated gnupg-cvs-rep/\n@@ -255,16 +257,18 @@ sub _line {\n \t\t\tchomp $cnt;\n \t\t\tdie \"Duh: Filesize $cnt\" if $cnt !~ /^\\d+$/;\n \t\t\t$line=\"\";\n-\t\t\t$res=\"\";\n+\t\t\t$res=0;\n \t\t\twhile($cnt) {\n \t\t\t\tmy $buf;\n \t\t\t\tmy $num = $self->{'socketi'}->read($buf,$cnt);\n \t\t\t\tdie \"Server: Filesize $cnt: $num: $!\\n\" if not defined $num or $num<=0;\n-\t\t\t\t$res .= $buf;\n+\t\t\t\tprint $fh $buf;\n+\t\t\t\t$res += $num;\n \t\t\t\t$cnt -= $num;\n \t\t\t}\n \t\t} elsif($line =~ s/^ //) {\n-\t\t\t$res .= $line;\n+\t\t\tprint $fh $line;\n+\t\t\t$res += length($line);\n \t\t} elsif($line =~ /^M\\b/) {\n \t\t\t# output, do nothing\n \t\t} elsif($line =~ /^Mbinary\\b/) {\n@@ -277,7 +281,8 @@ sub _line {\n \t\t\t\tmy $buf;\n \t\t\t\tmy $num = $self->{'socketi'}->read($buf,$cnt);\n \t\t\t\tdie \"S: Mbinary $cnt: $num: $!\\n\" if not defined $num or $num<=0;\n-\t\t\t\t$res .= $buf;\n+\t\t\t\tprint $fh $buf;\n+\t\t\t\t$res += $num;\n \t\t\t\t$cnt -= $num;\n \t\t\t}\n \t\t} else {\n@@ -297,18 +302,21 @@ sub file {\n \tmy($self,$fn,$rev) = @_;\n \tmy $res;\n \n-\tif ($self->_file($fn,$rev)) {\n-\t\t$res = $self->_line();\n-\t\treturn $res if defined $res;\n+\tmy ($fh, $name) = tempfile('gitcvs.XXXXXX', \n+\t\t    DIR => File::Spec->tmpdir(), UNLINK => 1);\n+\n+\t$self->_file($fn,$rev) and $res = $self->_line($fh);\n+\n+\tif (!defined $res) {\n+\t    # retry\n+\t    $self->conn();\n+\t    $self->_file($fn,$rev)\n+\t\t    or die \"No file command send\\n\";\n+\t    $res = $self->_line($fh);\n+\t    die \"No input: $fn $rev\\n\" unless defined $res;\n \t}\n \n-\t# retry\n-\t$self->conn();\n-\t$self->_file($fn,$rev)\n-\t\tor die \"No file command send\\n\";\n-\t$res = $self->_line();\n-\tdie \"No input: $fn $rev\\n\" unless defined $res;\n-\treturn $res;\n+\treturn ($name, $res);\n }\n \n \n@@ -457,13 +465,14 @@ my $commit = sub {\n \t}\n \twhile(@new) {\n \t\tmy @n2;\n-\t\tif(@new > 55) {\n-\t\t\t@n2 = splice(@new,0,50);\n+\t\tif(@new > 12) {\n+\t\t\t@n2 = splice(@new,0,10);\n \t\t} else {\n \t\t\t@n2 = @new;\n \t\t\t@new = ();\n \t\t}\n-\t\tsystem(\"git-update-cache\",\"--add\",\"--\",@n2);\n+\t\tsystem(\"git-update-cache\",\"--add\",\n+\t\t\t(map { ('--cacheinfo', @$_) } @n2));\n \t\tdie \"Cannot add files: $?\\n\" if $?;\n \t}\n \n@@ -631,7 +640,7 @@ while(<CVS>) {\n \t\t}\n \t\tif(($ancestor || $branch) ne $last_branch) {\n \t\t\tprint \"Switching from $last_branch to $branch\\n\" if $opt_v;\n-\t\t\tsystem(\"git-read-tree\",\"-m\",\"-u\",\"$last_branch\",\"$branch\");\n+\t\t\tsystem(\"git-read-tree\",\"-m\",\"$last_branch\",\"$branch\");\n \t\t\tdie \"read-tree failed: $?\\n\" if $?;\n \t\t}\n \t\tif($branch ne $last_branch) {\n@@ -648,17 +657,16 @@ while(<CVS>) {\n \t\tmy $fn = $1;\n \t\tmy $rev = $3;\n \t\t$fn =~ s#^/+##;\n-\t\tmy $data = $cvs->file($fn,$rev);\n-\t\tprint \"\".($init ? \"New\" : \"Update\").\" $fn: \".length($data).\" bytes.\\n\" if $opt_v;\n-\t\tmkpath(dirname($fn),$opt_v);\n-\t\topen(F,\"> ./$fn\")\n-\t\t\tor die \"Cannot create '$fn': $!\\n\";\n-\t\tprint F $data\n-\t\t\tor die \"Cannot write to '$fn': $!\\n\";\n-\t\tclose(F)\n-\t\t\tor die \"Cannot write to '$fn': $!\\n\";\n-\t\tchmod(pmode($cvs->{'mode'}), $fn);\n-\t\tpush(@new,$fn); # may be resurrected!\n+\t\tmy ($tmpname, $size) = $cvs->file($fn,$rev);\n+\t\tprint \"\".($init ? \"New\" : \"Update\").\" $fn: $size bytes.\\n\" if $opt_v;\n+\t\topen my $F, '-|', \"git-write-blob $tmpname\"\n+\t\t\tor die \"Cannot create object: $!\\n\";\n+\t\tmy $sha = <$F>;\n+\t\tchomp $sha;\n+\t\tclose $F;\n+\t\tunlink($tmpname);\n+\t\tmy $mode = pmode($cvs->{'mode'});\n+\t\tpush(@new,[$mode, $sha, $fn]); # may be resurrected!\n \t} elsif($state == 9 and /^\\s+(\\S+):\\d(?:\\.\\d+)+->(\\d(?:\\.\\d+)+)\\(DEAD\\)\\s*$/) {\n \t\tmy $fn = $1;\n \t\t$fn =~ s#^/+##;\n@@ -688,8 +696,15 @@ if($orig_branch) {\n \t\tunless -f \"$git_dir/refs/heads/master\";\n }\n \n-system(\"git-read-tree\",\"-m\",\"-u\",\"$last_branch\",\"$orig_branch\");\n-die \"read-tree failed: $?\\n\" if $?;\n+if ($orig_branch) {\n+\tsystem(\"git-read-tree\",$last_branch);\n+\tdie \"read-tree failed: $?\\n\" if $?;\n+} else {\n+\tsystem('git-read-tree', $orig_branch);\n+\tdie \"read-tree failed: $?\\n\" if $?;\n+\tsystem('git-checkout-cache', '-a');\n+\tdie \"checkout-cache failed: $?\\n\" if $?;\n+}\n \n unlink(\"$git_dir/HEAD\");\n symlink(\"refs/heads/$orig_branch\",\"$git_dir/HEAD\");\n"},{"id":"5625","messageId":"20050704121344.GJ18608MdfPADPa@garage.linux.student.kuleuven.ac.be","threadId":"1038","inReplyTo":"20050703103517.GJ5992MdfPADPa@garage.linux.student.kuleuven.ac.be","subject":"[PATCH] git-cvsimport-script: use private index.","fromName":"Sven Verdoolaege","fromEmail":"skimo@kotnet.org","sentAt":"2005-07-04T12:13:44Z","receivedAt":"2005-07-04T12:13:44Z","isPatch":true,"sender":{"key":"skimo@kotnet.org","avatar":null},"body":"git-cvsimport-script: use private index.\n\n---\ncommit 79ee456cf222982f7ee3f003440c57b5f7cffa8b\ntree c27c7f8bafa48d81a4d9f7562b851681984a9c7e\nparent 2eb6d82eaa869a1faf4ba3326fd628f76f9f93a8\nauthor Sven Verdoolaege <skimo@kotnet.org> Mon, 04 Jul 2005 13:36:59 +0200\ncommitter Sven Verdoolaege <skimo@kotnet.org> Mon, 04 Jul 2005 13:36:59 +0200\n\n git-cvsimport-script |   43 +++++++++++++++++++++++--------------------\n 1 files changed, 23 insertions(+), 20 deletions(-)\n\ndiff --git a/git-cvsimport-script b/git-cvsimport-script\n--- a/git-cvsimport-script\n+++ b/git-cvsimport-script\n@@ -16,6 +16,8 @@\n use strict;\n use warnings;\n use Getopt::Std;\n+use File::Spec;\n+use File::Temp qw(tempfile);\n use File::Path qw(mkpath);\n use File::Basename qw(basename dirname);\n use Time::Local;\n@@ -377,6 +379,12 @@ my %branch_date;\n my $git_dir = $ENV{\"GIT_DIR\"} || \".git\";\n $git_dir = getwd().\"/\".$git_dir unless $git_dir =~ m#^/#;\n $ENV{\"GIT_DIR\"} = $git_dir;\n+my $orig_git_index;\n+$orig_git_index = $ENV{GIT_INDEX_FILE} if exists $ENV{GIT_INDEX_FILE};\n+my ($git_ih, $git_index) = tempfile('gitXXXXXX', SUFFIX => '.idx',\n+\t\t\t\t    DIR => File::Spec->tmpdir());\n+close ($git_ih);\n+$ENV{GIT_INDEX_FILE} = $git_index;\n unless(-d $git_dir) {\n \tsystem(\"git-init-db\");\n \tdie \"Cannot init the GIT db at $git_tree: $?\\n\" if $?;\n@@ -398,6 +406,9 @@ unless(-d $git_dir) {\n \t}\n \t$orig_branch = $last_branch;\n \n+\t# populate index\n+\tsystem('git-read-tree', $last_branch);\n+\n \t# Get the last import timestamps\n \topendir(D,\"$git_dir/refs/heads\");\n \twhile(defined(my $head = readdir(D))) {\n@@ -643,11 +654,6 @@ while(<CVS>) {\n \t\t\tsystem(\"git-read-tree\",\"-m\",\"$last_branch\",\"$branch\");\n \t\t\tdie \"read-tree failed: $?\\n\" if $?;\n \t\t}\n-\t\tif($branch ne $last_branch) {\n-\t\t\tunlink(\"$git_dir/HEAD\");\n-\t\t\tsymlink(\"refs/heads/$branch\",\"$git_dir/HEAD\");\n-\t\t\t$last_branch = $branch;\n-\t\t}\n \t\t$state = 9;\n \t} elsif($state == 8) {\n \t\t$logmsg .= \"$_\\n\";\n@@ -686,26 +692,23 @@ while(<CVS>) {\n }\n &$commit() if $branch and $state != 11;\n \n+unlink($git_index);\n+\n # Now switch back to the branch we were in before all of this happened\n if($orig_branch) {\n-\tprint \"DONE; switching back to $orig_branch\\n\" if $opt_v;\n+\tprint \"DONE\\n\" if $opt_v;\n } else {\n \t$orig_branch = \"master\";\n \tprint \"DONE; creating $orig_branch branch\\n\" if $opt_v;\n \tsystem(\"cp\",\"$git_dir/refs/heads/$opt_o\",\"$git_dir/refs/heads/master\")\n \t\tunless -f \"$git_dir/refs/heads/master\";\n+\tunlink(\"$git_dir/HEAD\");\n+\tsymlink(\"refs/heads/$orig_branch\",\"$git_dir/HEAD\");\n+\tif (defined $orig_git_index) {\n+\t    $ENV{GIT_INDEX_FILE} = $orig_git_index;\n+\t} else {\n+\t    delete $ENV{GIT_INDEX_FILE};\n+\t}\n+\tsystem('git checkout');\n+\tdie \"checkout failed: $?\\n\" if $?;\n }\n-\n-if ($orig_branch) {\n-\tsystem(\"git-read-tree\",$last_branch);\n-\tdie \"read-tree failed: $?\\n\" if $?;\n-} else {\n-\tsystem('git-read-tree', $orig_branch);\n-\tdie \"read-tree failed: $?\\n\" if $?;\n-\tsystem('git-checkout-cache', '-a');\n-\tdie \"checkout-cache failed: $?\\n\" if $?;\n-}\n-\n-unlink(\"$git_dir/HEAD\");\n-symlink(\"refs/heads/$orig_branch\",\"$git_dir/HEAD\");\n-\n"},{"id":"5628","messageId":"20050704130324.GK18608MdfPADPa@garage.linux.student.kuleuven.ac.be","threadId":"1038","inReplyTo":"20050630210023.GY10850@kiste.smurf.noris.de","subject":"Re: [PATCH] cvsimport: rewritten in Perl","fromName":"Sven Verdoolaege","fromEmail":"skimo@kotnet.org","sentAt":"2005-07-04T13:03:24Z","receivedAt":"2005-07-04T13:03:24Z","isPatch":true,"sender":{"key":"skimo@kotnet.org","avatar":null},"body":"On Thu, Jun 30, 2005 at 11:00:23PM +0200, Matthias Urlichs wrote:\n> Sven Verdoolaege:\n> > It would also be nice if the user could pass extra options\n> > to cvsps (notably '-z').\n> > \n> Ditto.  ;-)\n\nWhy not an explicit '-z' option as in the current git-cvsimport-script ?\n\nskimo\n"},{"id":"5630","messageId":"20050704134611.GM18608MdfPADPa@garage.linux.student.kuleuven.ac.be","threadId":"1038","inReplyTo":"20050704135327.GA32098@kiste.smurf.noris.de","subject":"Re: [PATCH] cvsimport: rewritten in Perl","fromName":"Sven Verdoolaege","fromEmail":"skimo@kotnet.org","sentAt":"2005-07-04T13:46:11Z","receivedAt":"2005-07-04T13:46:11Z","isPatch":true,"sender":{"key":"skimo@kotnet.org","avatar":null},"body":"On Mon, Jul 04, 2005 at 03:53:27PM +0200, Matthias Urlichs wrote:\n> Hi,\n> \n> Sven Verdoolaege:\n> > Why not an explicit '-z' option as in the current git-cvsimport-script ?\n> \n> Because my code doesn't support compressed cvs connections:\n> a -z that doesn't work except for the rlog part would be a lie.\n\nI was talking about the cvsps '-z' option (see current git-cvsimport-script).\nAre you saying you want to reserve that option to signify compressed\ncvs connections ?\n\nskimo\n"},{"id":"5629","messageId":"20050704135327.GA32098@kiste.smurf.noris.de","threadId":"1038","inReplyTo":"20050704130324.GK18608MdfPADPa@garage.linux.student.kuleuven.ac.be","subject":"Re: [PATCH] cvsimport: rewritten in Perl","fromName":"Matthias Urlichs","fromEmail":"smurf@smurf.noris.de","sentAt":"2005-07-04T13:53:27Z","receivedAt":"2005-07-04T13:53:27Z","isPatch":true,"sender":{"key":"matthias@urlichs.de","avatar":"https://gravatar.com/avatar/2708905af227313eba6f2b2ae0f7d0259b5ac5d71baef58fe5a13c699ce0bbf0?d=mp&s=160"},"body":"Hi,\n\nSven Verdoolaege:\n> Why not an explicit '-z' option as in the current git-cvsimport-script ?\n\nBecause my code doesn't support compressed cvs connections:\na -z that doesn't work except for the rlog part would be a lie.\n\nFeel free to add that code. ;-)\n\n-- \nMatthias Urlichs   |   {M:U} IT Design @ m-u-it.de   |  smurf@smurf.noris.de\nDisclaimer: The quote was selected randomly. Really. | http://smurf.noris.de\n - -\nConfidence is simply that quiet, assured feeling you have before you\nfall flat on your face.\n"},{"id":"5631","messageId":"20050704140616.GN18608MdfPADPa@garage.linux.student.kuleuven.ac.be","threadId":"1038","inReplyTo":"20050703103517.GJ5992MdfPADPa@garage.linux.student.kuleuven.ac.be","subject":"[PATCH] git-cvsimport-script: fix branch switching","fromName":"Sven Verdoolaege","fromEmail":"skimo@kotnet.org","sentAt":"2005-07-04T14:06:16Z","receivedAt":"2005-07-04T14:06:16Z","isPatch":true,"sender":{"key":"skimo@kotnet.org","avatar":null},"body":"git-cvsimport-script: fix branch switching\n\nPrevious patch broke branch switching.\n\n---\ncommit 46e63efc072bc440e4c6aad33d3157b70f5172b6\ntree 2c4fd7286e29e6041808d07874ef2151e3876676\nparent 79ee456cf222982f7ee3f003440c57b5f7cffa8b\nauthor Sven Verdoolaege <skimo@kotnet.org> Mon, 04 Jul 2005 15:28:36 +0200\ncommitter Sven Verdoolaege <skimo@kotnet.org> Mon, 04 Jul 2005 15:28:36 +0200\n\n git-cvsimport-script |    3 ++-\n 1 files changed, 2 insertions(+), 1 deletions(-)\n\ndiff --git a/git-cvsimport-script b/git-cvsimport-script\n--- a/git-cvsimport-script\n+++ b/git-cvsimport-script\n@@ -651,9 +651,10 @@ while(<CVS>) {\n \t\t}\n \t\tif(($ancestor || $branch) ne $last_branch) {\n \t\t\tprint \"Switching from $last_branch to $branch\\n\" if $opt_v;\n-\t\t\tsystem(\"git-read-tree\",\"-m\",\"$last_branch\",\"$branch\");\n+\t\t\tsystem(\"git-read-tree\", $branch);\n \t\t\tdie \"read-tree failed: $?\\n\" if $?;\n \t\t}\n+\t\t$last_branch = $branch if $branch ne $last_branch;\n \t\t$state = 9;\n \t} elsif($state == 8) {\n \t\t$logmsg .= \"$_\\n\";\n"},{"id":"5632","messageId":"20050704140946.GO18608MdfPADPa@garage.linux.student.kuleuven.ac.be","threadId":"1038","inReplyTo":"20050703103517.GJ5992MdfPADPa@garage.linux.student.kuleuven.ac.be","subject":"[PATCH] git-cvsimport-script: update cvsps cache instead of rebuilding it","fromName":"Sven Verdoolaege","fromEmail":"skimo@kotnet.org","sentAt":"2005-07-04T14:09:46Z","receivedAt":"2005-07-04T14:09:46Z","isPatch":true,"sender":{"key":"skimo@kotnet.org","avatar":null},"body":"git-cvsimport-script: update cvsps cache instead of rebuilding it\n\nUpdating the cache is sufficient for most purposes.\nIf users really want to rebuild the cache, they can specify\nthe option themselves.\n\n---\ncommit 6e7e37b0bfc921aa1f0cb30560fc128e87a41966\ntree 12a9303d4ba4566d9e081b2c375648685ce41e93\nparent 46e63efc072bc440e4c6aad33d3157b70f5172b6\nauthor Sven Verdoolaege <skimo@kotnet.org> Mon, 04 Jul 2005 15:35:30 +0200\ncommitter Sven Verdoolaege <skimo@kotnet.org> Mon, 04 Jul 2005 15:35:30 +0200\n\n git-cvsimport-script |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/git-cvsimport-script b/git-cvsimport-script\n--- a/git-cvsimport-script\n+++ b/git-cvsimport-script\n@@ -436,7 +436,7 @@ die \"Cannot fork: $!\\n\" unless defined $\n unless($pid) {\n \tmy @opt;\n \t@opt = split(/,/,$opt_p) if defined $opt_p;\n-\texec(\"cvsps\",@opt,\"-x\",\"-A\",\"--cvs-direct\",'--root',$opt_d,$cvs_tree);\n+\texec(\"cvsps\",@opt,\"-u\",\"-A\",\"--cvs-direct\",'--root',$opt_d,$cvs_tree);\n \tdie \"Could not start cvsps: $!\\n\";\n }\n \n"},{"id":"5633","messageId":"20050704143637.GB32098@kiste.smurf.noris.de","threadId":"1038","inReplyTo":"20050704134611.GM18608MdfPADPa@garage.linux.student.kuleuven.ac.be","subject":"Re: [PATCH] cvsimport: rewritten in Perl","fromName":"Matthias Urlichs","fromEmail":"smurf@smurf.noris.de","sentAt":"2005-07-04T14:36:37Z","receivedAt":"2005-07-04T14:36:37Z","isPatch":true,"sender":{"key":"matthias@urlichs.de","avatar":"https://gravatar.com/avatar/2708905af227313eba6f2b2ae0f7d0259b5ac5d71baef58fe5a13c699ce0bbf0?d=mp&s=160"},"body":"Hi,\n\nSven Verdoolaege:\n> > Because my code doesn't support compressed cvs connections:\n> > a -z that doesn't work except for the rlog part would be a lie.\n> \n> I was talking about the cvsps '-z' option (see current git-cvsimport-script).\n> Are you saying you want to reserve that option to signify compressed\n> cvs connections ?\n> \nSorry, I was confused -- with cvsps, -capital-Z says to compress.\n\nIdeally, I'd prefer to recycle standard CVS options as much as possible, \nbut given that the confusion is already there (worse: cvs' -z wants an\nargument (compression level), cvsps' -Z doesn't) that may not actually\nmake sense. *Shrug*\n\nI'm too happy when other people improve my tools to get hung up on\ndetails like that. ;-)\n\n-- \nMatthias Urlichs   |   {M:U} IT Design @ m-u-it.de   |  smurf@smurf.noris.de\nDisclaimer: The quote was selected randomly. Really. | http://smurf.noris.de\n - -\nYou'll feel much better once you've given up hope.\n"},{"id":"5634","messageId":"20050704155226.GQ18608MdfPADPa@garage.linux.student.kuleuven.ac.be","threadId":"1038","inReplyTo":"20050704143637.GB32098@kiste.smurf.noris.de","subject":"Re: [PATCH] cvsimport: rewritten in Perl","fromName":"Sven Verdoolaege","fromEmail":"skimo@kotnet.org","sentAt":"2005-07-04T15:52:26Z","receivedAt":"2005-07-04T15:52:26Z","isPatch":true,"sender":{"key":"skimo@kotnet.org","avatar":null},"body":"On Mon, Jul 04, 2005 at 04:36:37PM +0200, Matthias Urlichs wrote:\n> Ideally, I'd prefer to recycle standard CVS options as much as possible, \n> but given that the confusion is already there (worse: cvs' -z wants an\n> argument (compression level), cvsps' -Z doesn't) that may not actually\n> make sense. *Shrug*\n> \n> I'm too happy when other people improve my tools to get hung up on\n> details like that. ;-)\n\nHere it is, then.\n\nskimo\n--\ngit-cvsimport-script: provide direct support for cvsps -z option\n\n---\ncommit 28537171e7ec23c8677ea6e77c208583f95caa28\ntree ca80ed2fad05b150984c14a5364dac8d3e307120\nparent 6e7e37b0bfc921aa1f0cb30560fc128e87a41966\nauthor Sven Verdoolaege <skimo@kotnet.org> Mon, 04 Jul 2005 17:10:06 +0200\ncommitter Sven Verdoolaege <skimo@kotnet.org> Mon, 04 Jul 2005 17:10:06 +0200\n\n git-cvsimport-script |    9 +++++----\n 1 files changed, 5 insertions(+), 4 deletions(-)\n\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);\n+our($opt_h,$opt_o,$opt_v,$opt_d,$opt_p,$opt_C,$opt_z);\n \n sub usage() {\n \tprint STDERR <<END;\n Usage: ${\\basename $0}     # fetch/update GIT from CVS\n-\t   [ -o branch-for-HEAD ] [ -h ] [ -v ] [ -d CVSROOT ]\n-       [ -p opts-for-cvsps ] [ -C GIT_repository ]\n+       [ -o branch-for-HEAD ] [ -h ] [ -v ] [ -d CVSROOT ]\n+       [ -p opts-for-cvsps ] [ -C GIT_repository ] [ -z fuzz ]\n        [ CVS_module ]\n END\n \texit(1);\n }\n \n-getopts(\"hqvo:d:p:C:\") or usage();\n+getopts(\"hqvo:d:p:C:z:\") or usage();\n usage if $opt_h;\n \n @ARGV <= 1 or usage();\n@@ -436,6 +436,7 @@ die \"Cannot fork: $!\\n\" unless defined $\n unless($pid) {\n \tmy @opt;\n \t@opt = split(/,/,$opt_p) if defined $opt_p;\n+\tunshift @opt, '-z', $opt_z if defined $opt_z;\n \texec(\"cvsps\",@opt,\"-u\",\"-A\",\"--cvs-direct\",'--root',$opt_d,$cvs_tree);\n \tdie \"Could not start cvsps: $!\\n\";\n }\n"},{"id":"5678","messageId":"20050705230226.0F9F4353A69@atlas.denx.de","threadId":"1038","inReplyTo":"pan.2005.07.03.13.44.46.995524@smurf.noris.de","subject":"Re: cvsimport: rewritten in Perl","fromName":"Wolfgang Denk","fromEmail":"wd@denx.de","sentAt":"2005-07-05T23:02:26Z","receivedAt":"2005-07-05T23:02:26Z","isPatch":false,"sender":{"key":"wd@denx.de","avatar":null},"body":"In message <pan.2005.07.03.13.44.46.995524@smurf.noris.de> you wrote:\n> \n> Linus: Please grab http://netz.smurf.noris.de/git/git.git/#cvs2git.\n\nI tested this on the U-Boot CVS repository (available at\nhttp://cvs.sourceforge.net/cvstarballs/u-boot-cvsroot.tar.bz2).\n\nI got:\n\n-> ~/test/git-cvsimport-script -d ~/git/u-boot-SF/u-boot -C u-boot u-boot\ncvs_direct initialized to CVSROOT /home/wd/git/u-boot-SF/u-boot\ncvs rlog: Logging u-boot\ncvs rlog: Logging u-boot/board\n...\ncvs rlog: Logging u-boot/tools/scripts\ncvs rlog: Logging u-boot/tools/updater\nWARNING: Invalid PatchSet 815, Tag LABEL_2003_12_08_MKR:\n    include/configs/svm_sc8xx.h:1.3=after, CHANGELOG:1.170=before. Treated as 'before'\nWARNING: Invalid PatchSet 816, Tag LABEL_2003_12_08_MKR:\n    include/configs/rmu.h:1.4=after, CHANGELOG:1.171=before. Treated as 'before'\nWARNING: Invalid PatchSet 815, Tag LABEL_2003_12_08_MKR:\n    include/configs/TQM823M.h:1.3=after, CHANGELOG:1.170=before. Treated as 'before'\nWARNING: Invalid PatchSet 815, Tag LABEL_2003_12_08_MKR:\n    include/configs/TQM823L.h:1.9=after, CHANGELOG:1.170=before. Treated as 'before'\nWARNING: Invalid PatchSet 816, Tag LABEL_2003_12_08_MKR:\n    include/configs/IceCube.h:1.16=after, CHANGELOG:1.171=before. Treated as 'before'\nWARNING: Invalid PatchSet 810, Tag LABEL_2003_12_08_MKR:\n    fs/fat/fat.c:1.5=after, CHANGELOG:1.165=before. Treated as 'before'\nWARNING: Invalid PatchSet 810, Tag LABEL_2003_12_08_MKR:\n    fs/fat/fat.c:1.5=after, board/RRvision/RRvision.c:1.2=before. Treated as 'before'\nWARNING: Invalid PatchSet 810, Tag LABEL_2003_12_08_MKR:\n    fs/fat/fat.c:1.5=after, board/atc/atc.c:1.6=before. Treated as 'before'\nWARNING: Invalid PatchSet 810, Tag LABEL_2003_12_08_MKR:\n    fs/fat/fat.c:1.5=after, board/c2mon/c2mon.c:1.2=before. Treated as 'before'\nWARNING: Invalid PatchSet 810, Tag LABEL_2003_12_08_MKR:\n    fs/fat/fat.c:1.5=after, board/etx094/etx094.c:1.2=before. Treated as 'before'\nWARNING: Invalid PatchSet 810, Tag LABEL_2003_12_08_MKR:\n    fs/fat/fat.c:1.5=after, board/evb64260/flash.c:1.5=before. Treated as 'before'\nWARNING: Invalid PatchSet 810, Tag LABEL_2003_12_08_MKR:\n    fs/fat/fat.c:1.5=after, board/rmu/rmu.c:1.3=before. Treated as 'before'\nWARNING: Invalid PatchSet 810, Tag LABEL_2003_12_08_MKR:\n    fs/fat/fat.c:1.5=after, board/tqm8260/tqm8260.c:1.4=before. Treated as 'before'\nWARNING: Invalid PatchSet 810, Tag LABEL_2003_12_08_MKR:\n    fs/fat/fat.c:1.5=after, board/tqm8xx/tqm8xx.c:1.4=before. Treated as 'before'\nWARNING: Invalid PatchSet 810, Tag LABEL_2003_12_08_MKR:\n    fs/fat/fat.c:1.5=after, include/version.h:1.20=before. Treated as 'before'\nWARNING: Invalid PatchSet 810, Tag LABEL_2003_12_08_MKR:\n    fs/fat/fat.c:1.5=after, lib_arm/board.c:1.19=before. Treated as 'before'\nWARNING: Invalid PatchSet 815, Tag LABEL_2003_12_08_MKR:\n    cpu/mpc8xx/lcd.c:1.14=after, CHANGELOG:1.170=before. Treated as 'before'\nWARNING: Invalid PatchSet 817, Tag LABEL_2003_12_08_MKR:\n    common/cmd_bootm.c:1.31=after, CHANGELOG:1.172=before. Treated as 'before'\nWARNING: Invalid PatchSet 815, Tag LABEL_2003_12_08_MKR:\n    board/tqm8xx/tqm8xx.c:1.5=after, CHANGELOG:1.170=before. Treated as 'before'\nWARNING: Invalid PatchSet 815, Tag LABEL_2003_12_08_MKR:\n    README:1.60=after, CHANGELOG:1.170=before. Treated as 'before'\nWARNING: Invalid PatchSet 815, Tag LABEL_2003_12_08_MKR:\n    Makefile:1.65=after, CHANGELOG:1.170=before. Treated as 'before'\nWARNING: Invalid PatchSet 816, Tag LABEL_2003_12_08_MKR:\n    include/configs/IceCube.h:1.16=after, CHANGELOG:1.171=before. Treated as 'before'\nWARNING: Invalid PatchSet 815, Tag LABEL_2003_12_08_MKR:\n    include/configs/TQM823M.h:1.3=after, CHANGELOG:1.170=before. Treated as 'before'\nWARNING: Invalid PatchSet 815, Tag LABEL_2003_12_08_MKR:\n    include/configs/svm_sc8xx.h:1.3=after, CHANGELOG:1.170=before. Treated as 'before'\nWARNING: Invalid PatchSet 817, Tag LABEL_2003_12_08_MKR:\n    common/cmd_bootm.c:1.31=after, CHANGELOG:1.172=before. Treated as 'before'\nWARNING: Invalid PatchSet 815, Tag LABEL_2003_12_08_MKR:\n    cpu/mpc8xx/lcd.c:1.14=after, CHANGELOG:1.170=before. Treated as 'before'\nWARNING: Invalid PatchSet 810, Tag LABEL_2003_12_08_MKR:\n    fs/fat/fat.c:1.5=after, CHANGELOG:1.165=before. Treated as 'before'\nWARNING: Invalid PatchSet 810, Tag LABEL_2003_12_08_MKR:\n    fs/fat/fat.c:1.5=after, board/RRvision/RRvision.c:1.2=before. Treated as 'before'\nWARNING: Invalid PatchSet 810, Tag LABEL_2003_12_08_MKR:\n    fs/fat/fat.c:1.5=after, board/atc/atc.c:1.6=before. Treated as 'before'\nWARNING: Invalid PatchSet 810, Tag LABEL_2003_12_08_MKR:\n    fs/fat/fat.c:1.5=after, board/c2mon/c2mon.c:1.2=before. Treated as 'before'\nWARNING: Invalid PatchSet 810, Tag LABEL_2003_12_08_MKR:\n    fs/fat/fat.c:1.5=after, board/etx094/etx094.c:1.2=before. Treated as 'before'\nWARNING: Invalid PatchSet 810, Tag LABEL_2003_12_08_MKR:\n    fs/fat/fat.c:1.5=after, board/evb64260/flash.c:1.5=before. Treated as 'before'\nWARNING: Invalid PatchSet 810, Tag LABEL_2003_12_08_MKR:\n    fs/fat/fat.c:1.5=after, board/rmu/rmu.c:1.3=before. Treated as 'before'\nWARNING: Invalid PatchSet 810, Tag LABEL_2003_12_08_MKR:\n    fs/fat/fat.c:1.5=after, board/tqm8260/tqm8260.c:1.4=before. Treated as 'before'\nWARNING: Invalid PatchSet 810, Tag LABEL_2003_12_08_MKR:\n    fs/fat/fat.c:1.5=after, board/tqm8xx/tqm8xx.c:1.4=before. Treated as 'before'\nWARNING: Invalid PatchSet 810, Tag LABEL_2003_12_08_MKR:\n    fs/fat/fat.c:1.5=after, include/version.h:1.20=before. Treated as 'before'\nWARNING: Invalid PatchSet 810, Tag LABEL_2003_12_08_MKR:\n    fs/fat/fat.c:1.5=after, lib_arm/board.c:1.19=before. Treated as 'before'\nWARNING: Invalid PatchSet 815, Tag LABEL_2003_12_08_MKR:\n    include/configs/TQM823L.h:1.9=after, CHANGELOG:1.170=before. Treated as 'before'\nWARNING: Invalid PatchSet 815, Tag LABEL_2003_12_08_MKR:\n    board/tqm8xx/tqm8xx.c:1.5=after, CHANGELOG:1.170=before. Treated as 'before'\nWARNING: Invalid PatchSet 815, Tag LABEL_2003_12_08_MKR:\n    Makefile:1.65=after, CHANGELOG:1.170=before. Treated as 'before'\nWARNING: Invalid PatchSet 816, Tag LABEL_2003_12_08_MKR:\n    include/configs/rmu.h:1.4=after, CHANGELOG:1.171=before. Treated as 'before'\nWARNING: Invalid PatchSet 815, Tag LABEL_2003_12_08_MKR:\n    README:1.60=after, CHANGELOG:1.170=before. Treated as 'before'\nWARNING: Invalid PatchSet 810, Tag LABEL_2003_11_26_MKR:\n    fs/fat/fat.c:1.5=after, CHANGELOG:1.165=before. Treated as 'before'\nWARNING: Invalid PatchSet 810, Tag LABEL_2003_11_26_MKR:\n    fs/fat/fat.c:1.5=after, board/RRvision/RRvision.c:1.2=before. Treated as 'before'\nWARNING: Invalid PatchSet 810, Tag LABEL_2003_11_26_MKR:\n    fs/fat/fat.c:1.5=after, board/atc/atc.c:1.6=before. Treated as 'before'\nWARNING: Invalid PatchSet 810, Tag LABEL_2003_11_26_MKR:\n    fs/fat/fat.c:1.5=after, board/c2mon/c2mon.c:1.2=before. Treated as 'before'\nWARNING: Invalid PatchSet 810, Tag LABEL_2003_11_26_MKR:\n    fs/fat/fat.c:1.5=after, board/etx094/etx094.c:1.2=before. Treated as 'before'\nWARNING: Invalid PatchSet 810, Tag LABEL_2003_11_26_MKR:\n    fs/fat/fat.c:1.5=after, board/evb64260/flash.c:1.5=before. Treated as 'before'\nWARNING: Invalid PatchSet 810, Tag LABEL_2003_11_26_MKR:\n    fs/fat/fat.c:1.5=after, board/rmu/rmu.c:1.3=before. Treated as 'before'\nWARNING: Invalid PatchSet 810, Tag LABEL_2003_11_26_MKR:\n    fs/fat/fat.c:1.5=after, board/tqm8260/tqm8260.c:1.4=before. Treated as 'before'\nWARNING: Invalid PatchSet 810, Tag LABEL_2003_11_26_MKR:\n    fs/fat/fat.c:1.5=after, board/tqm8xx/tqm8xx.c:1.4=before. Treated as 'before'\nWARNING: Invalid PatchSet 810, Tag LABEL_2003_11_26_MKR:\n    fs/fat/fat.c:1.5=after, include/version.h:1.20=before. Treated as 'before'\nWARNING: Invalid PatchSet 810, Tag LABEL_2003_11_26_MKR:\n    fs/fat/fat.c:1.5=after, lib_arm/board.c:1.19=before. Treated as 'before'\nWARNING: Invalid PatchSet 810, Tag LABEL_2003_11_26_MKR:\n    fs/fat/fat.c:1.5=after, CHANGELOG:1.165=before. Treated as 'before'\nWARNING: Invalid PatchSet 810, Tag LABEL_2003_11_26_MKR:\n    fs/fat/fat.c:1.5=after, board/RRvision/RRvision.c:1.2=before. Treated as 'before'\nWARNING: Invalid PatchSet 810, Tag LABEL_2003_11_26_MKR:\n    fs/fat/fat.c:1.5=after, board/atc/atc.c:1.6=before. Treated as 'before'\nWARNING: Invalid PatchSet 810, Tag LABEL_2003_11_26_MKR:\n    fs/fat/fat.c:1.5=after, board/c2mon/c2mon.c:1.2=before. Treated as 'before'\nWARNING: Invalid PatchSet 810, Tag LABEL_2003_11_26_MKR:\n    fs/fat/fat.c:1.5=after, board/etx094/etx094.c:1.2=before. Treated as 'before'\nWARNING: Invalid PatchSet 810, Tag LABEL_2003_11_26_MKR:\n    fs/fat/fat.c:1.5=after, board/evb64260/flash.c:1.5=before. Treated as 'before'\nWARNING: Invalid PatchSet 810, Tag LABEL_2003_11_26_MKR:\n    fs/fat/fat.c:1.5=after, board/rmu/rmu.c:1.3=before. Treated as 'before'\nWARNING: Invalid PatchSet 810, Tag LABEL_2003_11_26_MKR:\n    fs/fat/fat.c:1.5=after, board/tqm8260/tqm8260.c:1.4=before. Treated as 'before'\nWARNING: Invalid PatchSet 810, Tag LABEL_2003_11_26_MKR:\n    fs/fat/fat.c:1.5=after, board/tqm8xx/tqm8xx.c:1.4=before. Treated as 'before'\nWARNING: Invalid PatchSet 810, Tag LABEL_2003_11_26_MKR:\n    fs/fat/fat.c:1.5=after, include/version.h:1.20=before. Treated as 'before'\nWARNING: Invalid PatchSet 810, Tag LABEL_2003_11_26_MKR:\n    fs/fat/fat.c:1.5=after, lib_arm/board.c:1.19=before. Treated as 'before'\nCommitting initial tree 2183da96d548c02bd4f99b05e673395f81212878\nCannot create object: Too many open files\n-> ulimit -n\n1024\n\nAny ideas?\n\n\nBest regards,\n\nWolfgang Denk\n\n-- \nSoftware Engineering:  Embedded and Realtime Systems,  Embedded Linux\nPhone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de\n\"It is easier to port a shell than a shell script.\"      - Larry Wall\n"},{"id":"5684","messageId":"Pine.LNX.4.58.0507051936350.3570@g5.osdl.org","threadId":"1038","inReplyTo":"20050705230226.0F9F4353A69@atlas.denx.de","subject":"Re: cvsimport: rewritten in Perl","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2005-07-06T02:41:30Z","receivedAt":"2005-07-06T02:41:30Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Wed, 6 Jul 2005, Wolfgang Denk wrote:\n> \n> I tested this on the U-Boot CVS repository (available at\n> http://cvs.sourceforge.net/cvstarballs/u-boot-cvsroot.tar.bz2).\n>\n> Committing initial tree 2183da96d548c02bd4f99b05e673395f81212878\n> Cannot create object: Too many open files\n\nIf you make it print out its <pid> and then pause, you can use \n\n\tls -l /proc/<pid>/fd/\n\nto get an idea of what the files may be. Looks like the new perl version \nis leaking file descriptors..\n\nMatthias?\n\n\t\tLinus\n\t\n"},{"id":"5688","messageId":"20050706063712.GV18608MdfPADPa@garage.linux.student.kuleuven.ac.be","threadId":"1038","inReplyTo":"Pine.LNX.4.58.0507051936350.3570@g5.osdl.org","subject":"Re: cvsimport: rewritten in Perl","fromName":"Sven Verdoolaege","fromEmail":"skimo@kotnet.org","sentAt":"2005-07-06T06:37:12Z","receivedAt":"2005-07-06T06:37:12Z","isPatch":false,"sender":{"key":"skimo@kotnet.org","avatar":null},"body":"On Tue, Jul 05, 2005 at 07:41:30PM -0700, Linus Torvalds wrote:\n> If you make it print out its <pid> and then pause, you can use \n> \n> \tls -l /proc/<pid>/fd/\n> \n> to get an idea of what the files may be. Looks like the new perl version \n> is leaking file descriptors..\n> \n> Matthias?\n\nThat was my mistake, actually.\nThanks for spotting this.\n\nskimo\n--\ngit-cvsimport-script: close temporary file.\n\n---\ncommit 6b6fdaa290f7dfd178a518fcafb9e14e652eb8ac\ntree 725e7c6ecc75a0e90a6bc002ce540bd74dca999e\nparent f4b3a4c30b5ea3a5de2a2597a3c53266017d02ba\nauthor Sven Verdoolaege <skimo@kotnet.org> Wed, 06 Jul 2005 08:01:47 +0200\ncommitter Sven Verdoolaege <skimo@kotnet.org> Wed, 06 Jul 2005 08:01:47 +0200\n\n git-cvsimport-script |    1 +\n 1 files changed, 1 insertions(+), 0 deletions(-)\n\ndiff --git a/git-cvsimport-script b/git-cvsimport-script\n--- a/git-cvsimport-script\n+++ b/git-cvsimport-script\n@@ -317,6 +317,7 @@ sub file {\n \t    $res = $self->_line($fh);\n \t    die \"No input: $fn $rev\\n\" unless defined $res;\n \t}\n+\tclose ($fh);\n \n \treturn ($name, $res);\n }\n"},{"id":"5691","messageId":"20050706073237.GE11514@kiste.smurf.noris.de","threadId":"1038","inReplyTo":"20050706063712.GV18608MdfPADPa@garage.linux.student.kuleuven.ac.be","subject":"Re: cvsimport: rewritten in Perl","fromName":"Matthias Urlichs","fromEmail":"smurf@smurf.noris.de","sentAt":"2005-07-06T07:32:37Z","receivedAt":"2005-07-06T07:32:37Z","isPatch":false,"sender":{"key":"matthias@urlichs.de","avatar":"https://gravatar.com/avatar/2708905af227313eba6f2b2ae0f7d0259b5ac5d71baef58fe5a13c699ce0bbf0?d=mp&s=160"},"body":"Hi,\n\nSven Verdoolaege:\n> > to get an idea of what the files may be. Looks like the new perl version \n> > is leaking file descriptors..\n> > \n> > Matthias?\n> \n> That was my mistake, actually.\n> Thanks for spotting this.\n> \nOuch. For me, the main danger of lots of Python programming is that\nI tend not to see this kind of problem any more, because in Python it\nSimply Doesn't Happen. \n\n-- \nMatthias Urlichs   |   {M:U} IT Design @ m-u-it.de   |  smurf@smurf.noris.de\nDisclaimer: The quote was selected randomly. Really. | http://smurf.noris.de\n - -\nConscience is the inner voice that warns us somebody is looking\n\t\t\t\t\t-- H. L. Mencken\n"},{"id":"5704","messageId":"20050706102427.A6B12353A6A@atlas.denx.de","threadId":"1038","inReplyTo":"Pine.LNX.4.58.0507051936350.3570@g5.osdl.org","subject":"Re: cvsimport: rewritten in Perl","fromName":"Wolfgang Denk","fromEmail":"wd@denx.de","sentAt":"2005-07-06T10:24:27Z","receivedAt":"2005-07-06T10:24:27Z","isPatch":false,"sender":{"key":"wd@denx.de","avatar":null},"body":"In message <Pine.LNX.4.58.0507051936350.3570@g5.osdl.org> Linus Torvalds wrote:\n> \n> If you make it print out its <pid> and then pause, you can use \n> \n> \tls -l /proc/<pid>/fd/\n> \n> to get an idea of what the files may be. Looks like the new perl version \n> is leaking file descriptors..\n\nIt does. In case it's still of interest:  log file attached.\n\nBest regards,\n\nWolfgang Denk\n\n\nSoftware Engineering:  Embedded and Realtime Systems,  Embedded Linux\nPhone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de\nIt seems intuitively obvious to me, which  means  that  it  might  be\nwrong.                                                 -- Chris Torek\n\n"}]}