{"thread":{"id":"1524","subject":"[PATCH] Fixed two bugs in git-cvsimport-script.","startedAt":"2005-08-15T18:18:25Z","lastAt":"2005-08-17T11:22:03Z","messageCount":6,"participants":["David Kågedal","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"7305","messageId":"u5tacjjdpxq.fsf@lysator.liu.se","threadId":"1524","inReplyTo":null,"subject":"[PATCH] Fixed two bugs in git-cvsimport-script.","fromName":"David Kågedal","fromEmail":"davidk@lysator.liu.se","sentAt":"2005-08-15T18:18:25Z","receivedAt":"2005-08-15T18:18:25Z","isPatch":true,"sender":{"key":"davidk@lysator.liu.se","avatar":"https://avatars.githubusercontent.com/u/60530?v=4"},"body":"The git-cvsimport-script had a copule of small bugs that prevented me\nfrom importing a big CVS repository.\n\nThe first was that it didn't handle removed files with a multi-digit\nprimary revision number.\n\nThe second was that it was asking the CVS server for \"F\" messages,\nalthough they were not handled.\n\nI also updated the documentation for that script to correspond to\nactual flags.\n\nSigned-off-by: David Kågedal <davidk@lysator.liu.se>\n---\n\n Documentation/git-cvsimport-script.txt |    9 ++++++++-\n git-cvsimport-script                   |    4 ++--\n 2 files changed, 10 insertions(+), 3 deletions(-)\n\n50452f9c0c2df1f04d83a26266ba704b13861632\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@@ -29,6 +29,10 @@ OPTIONS\n \tcurrently, only the :local:, :ext: and :pserver: access methods \n \tare supported.\n \n+-C <target-dir>::\n+        The GIT repository to import to.  If the directory doesn't\n+        exist, it will be created.  Default is the current directory.\n+\n -i::\n \tImport-only: don't perform a checkout after importing.  This option\n \tensures the working directory and cache remain untouched and will\n@@ -44,7 +48,7 @@ OPTIONS\n \n -p <options-for-cvsps>::\n \tAdditional options for cvsps.\n-\tThe options '-x' and '-A' are implicit and should not be used here.\n+\tThe options '-u' and '-A' are implicit and should not be used here.\n \n \tIf you need to pass multiple options, separate them with a comma.\n \n@@ -57,6 +61,9 @@ OPTIONS\n -h::\n \tPrint a short usage message and exit.\n \n+-z <fuzz>::\n+        Pass the timestamp fuzz factor to cvsps.\n+\n OUTPUT\n ------\n If '-v' is specified, the script reports what it is doing.\ndiff --git a/git-cvsimport-script b/git-cvsimport-script\n--- a/git-cvsimport-script\n+++ b/git-cvsimport-script\n@@ -190,7 +190,7 @@ sub conn {\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+\t$self->{'socketo'}->write(\"Valid-responses ok error Valid-requests Mode M Mbinary E Checked-in Created Updated Merged Removed\\n\");\n \n \t$self->{'socketo'}->write(\"valid-requests\\n\");\n \t$self->{'socketo'}->flush();\n@@ -691,7 +691,7 @@ while(<CVS>) {\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} 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\n-- \nDavid Kågedal\n"},{"id":"7432","messageId":"u5tiry50ywy.fsf@lysator.liu.se","threadId":"1524","inReplyTo":"u5tacjjdpxq.fsf@lysator.liu.se","subject":"Re: [PATCH] Fixed two bugs in git-cvsimport-script.","fromName":"David Kågedal","fromEmail":"davidk@lysator.liu.se","sentAt":"2005-08-17T08:07:25Z","receivedAt":"2005-08-17T08:07:25Z","isPatch":true,"sender":{"key":"davidk@lysator.liu.se","avatar":"https://avatars.githubusercontent.com/u/60530?v=4"},"body":"David Kågedal <davidk@lysator.liu.se> writes:\n\n> The git-cvsimport-script had a copule of small bugs that prevented me\n> from importing a big CVS repository.\n>\n> The first was that it didn't handle removed files with a multi-digit\n> primary revision number.\n\nI noticed that this patch was accepted, which is great.  But there is\na problem with the character encoding in the commit message.\n\nThe commit in question is b0921331030d52febf52839753eee1b2b9ca1f24\n\nThe \"author\" field is written as \"iso-8859-1?Q?David_K=E5gedal\n<davidk@lysator.liu.se>\", which is taken from the \"From:\" line in my\nemail.  This should be decoded by the patch import script before\ngenerating the commit message.\n\nBut the trickier question is what encoding to use in the commit\nmessage.\n\nThis is the signed-off line in my mail:\n\n  Signed-off-by: David Kågedal <davidk@lysator.liu.se>\n\nThis is what appears in the commit:\n\n  Signed-off-by: David K?5gedal <davidk@lysator.liu.se>\n\nUsing ISO-8859-15 or UTF-8 would probably have made more sense here.\n\nApparently, my mail was encoded as QP, which is not very popular\naround here.  But it seems that the diff part was decoded properly\nbefore applying.  Was that done manually?\n\nSince my name contains a character that is not part of ASCII, it isn't\nreally an option to send the mails encoded as ASCII.  I could probably\nconvince my mailer (Gnus) to send it as \"8bit\" or \"binary\", but that\nis a pretty limited solution.  An it isn't even legal to use anything\nbut ASCII in the mail header.\n\n-- \nDavid Kågedal\n"},{"id":"7438","messageId":"7v3bp829zj.fsf@assigned-by-dhcp.cox.net","threadId":"1524","inReplyTo":"u5tiry50ywy.fsf@lysator.liu.se","subject":"Re: [PATCH] Fixed two bugs in git-cvsimport-script.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-08-17T09:22:56Z","receivedAt":"2005-08-17T09:22:56Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"> Apparently, my mail was encoded as QP, which is not very popular\n> around here.  But it seems that the diff part was decoded properly\n> before applying.  Was that done manually?\n\nYes, the patch had some context conflicts with some other patch\nso the patch application was done by hand, and I did a quick and\ndirty cut & paste of the commit message from \"cat mbox\" output.\n\nI will probably drop future patches encoded in QP.\n"},{"id":"7440","messageId":"7vacjgyj94.fsf@assigned-by-dhcp.cox.net","threadId":"1524","inReplyTo":"7v3bp829zj.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Fixed two bugs in git-cvsimport-script.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-08-17T10:01:43Z","receivedAt":"2005-08-17T10:01:43Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <junkio@cox.net> writes:\n\n> Yes, the patch had some context conflicts with some other patch\n> so the patch application was done by hand, and I did a quick and\n> dirty cut & paste of the commit message from \"cat mbox\" output.\n>\n> I will probably drop future patches encoded in QP.\n\nThis was totally inappropriate; sorry, but I was in a bad mood.\n\nA more serious response.\n\n - I personally consider commit message encoding a per project\n   issue (so is blob contents encoding).  If for example a\n   project is Japanese only, MS-DOS^WWindows programming\n   project, I do not think it is unreasonable if all the commit\n   messages and source files are encoded in Shift-JIS.  More\n   Unixy projects over there might use EUC-JP in source files\n   and maybe ISO-2022 in the log messages (because the latter is\n   the standard way to exchange e-mails there).  As long as\n   project participants agree to use the same encodings, things\n   should work just fine within a project.\n\n - However, weird people are known to merge projects that\n   started out as totally separate into one.  It would be a\n   disaster for the commit log viewer when this happens.  For\n   this reason, some people recommend using a common deniminator\n   encoding, namely UTF-8, for commit logs from day one, even if\n   you do not envision such a merge may happen in the future.\n\n   This recommendation also goes to author and committer\n   identification (but not blob contents).  But this is just an\n   recommendation, and it is still up to the individual project\n   what encoding to use in the log messages, and the low-level\n   GIT should not dictate nor interfere; \"git-commit-tree\" and\n   \"git-cat-file commit\" are 8-bit clean.\n\n - The e-mail patch acceptance machinery found in tools/\n   directory is tuned for the established patch exchange\n   practice used in the linux-kernel mailing list.  No MIME, no\n   QP, no guarantee to pass things outside ASCII.\n\n - Eventually, tools/mailinfo.c should be taught about MIME to\n   do at least:\n\n   - detect whitespace corrupted patch via sending MUA using\n     flowed-text and reject it;\n\n   - detect multipart PGP signed message, discard the attached\n     signature which is often useless, and unwrap the payload;\n\n   - decode QP and B encodings as necessary, and after splitting\n     the message to the info, msg and patch part, transliterate\n     the info and msg part from original encoding to UTF-8 (when\n     '--utf8' flag is given, perhaps).\n\n   One of the requirement there is that it still needs to be\n   _fast_.  Linus needs to be able to make 5 commits per second\n   out of his mailbox.\n\nSo that is the technical part of the response.  There is one\nProject policy part of the response: I would endorse the\napplication of that UTF-8 recommendation to the git project\nitself, at least in principle.\n\nBut that in practice would happen only after the above mailinfo\nupdate takes place.  Until then, it is very likely that I will\noccasionally fail to spot and to hand-correct people's name left\nundecoded the way the patch acceptance machinery passed through\nin the log message.  Please live with it (or send such patches\nto mailinfo ;-).\n"},{"id":"7441","messageId":"u5t64u427x7.fsf@lysator.liu.se","threadId":"1524","inReplyTo":"7v3bp829zj.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Fixed two bugs in git-cvsimport-script.","fromName":"David Kågedal","fromEmail":"davidk@lysator.liu.se","sentAt":"2005-08-17T10:07:32Z","receivedAt":"2005-08-17T10:07:32Z","isPatch":true,"sender":{"key":"davidk@lysator.liu.se","avatar":"https://avatars.githubusercontent.com/u/60530?v=4"},"body":"Junio C Hamano <junkio@cox.net> writes:\n\n>> Apparently, my mail was encoded as QP, which is not very popular\n>> around here.  But it seems that the diff part was decoded properly\n>> before applying.  Was that done manually?\n>\n> Yes, the patch had some context conflicts with some other patch\n> so the patch application was done by hand, and I did a quick and\n> dirty cut & paste of the commit message from \"cat mbox\" output.\n>\n> I will probably drop future patches encoded in QP.\n\nOk, but do you have an answer to my real question?  What is the\ncharacter encoding for commit objects in your git repository?\n\nIt is obviously one that is compatible with ASCII, which probably\nleaves you with the alternatives ASCII, Latin1, and UTF-8.  And plain\nASCII obviously doesn't work very well for me.\n\n-- \nDavid Kågedal\n"},{"id":"7442","messageId":"u5t1x4s24h0.fsf@lysator.liu.se","threadId":"1524","inReplyTo":"7vacjgyj94.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Fixed two bugs in git-cvsimport-script.","fromName":"David Kågedal","fromEmail":"davidk@lysator.liu.se","sentAt":"2005-08-17T11:22:03Z","receivedAt":"2005-08-17T11:22:03Z","isPatch":true,"sender":{"key":"davidk@lysator.liu.se","avatar":"https://avatars.githubusercontent.com/u/60530?v=4"},"body":"Junio C Hamano <junkio@cox.net> writes:\n\n> Junio C Hamano <junkio@cox.net> writes:\n>\n>> Yes, the patch had some context conflicts with some other patch\n>> so the patch application was done by hand, and I did a quick and\n>> dirty cut & paste of the commit message from \"cat mbox\" output.\n>>\n>> I will probably drop future patches encoded in QP.\n>\n> This was totally inappropriate; sorry, but I was in a bad mood.\n>\n> A more serious response.\n>\n>  - I personally consider commit message encoding a per project\n>    issue (so is blob contents encoding).\n\nAgreed.  And your response is probably good enough for now.  I also\nthink that having UTF-8 as the standard convention is the way to go.\n\n-- \nDavid Kågedal\n"}]}