git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <junkio@cox.net>
To: Robin Rosenberg <robin.rosenberg@dewire.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] Rework cvsexportcommit to handle binary files for all cases.
Date: Mon, 13 Nov 2006 16:47:27 -0800	[thread overview]
Message-ID: <7vveli4zxc.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: 200611132139.25342.robin.rosenberg@dewire.com

Robin Rosenberg <robin.rosenberg@dewire.com> writes:

>> It would also be nice to rework this program so that it can work
>> with whitespaces in pathnames.  I do not think it currently
>> works with them at all.
>
> I sent a patch earlier, which was not applied, due to imperfections that I 
> cannot solve fully. One issue was that patch 2.5.9 was required and hacking 
> it to handle binary diffs with spaces would require and even worse kludge,

I suspect that we should not be using patch, but instead be
using git-apply perhaps with -C option if people want fuzz.

>> It appears that this program was never used in western
>> hemisphere, by the way ;-).
>
> Now, Sweden is definitely in the northern hemisphere, even during the cold 
> war, though a number of computer games colored it red (or was it only 
> Finland) during the cold war.

I know this script originally came from southern hemisphere, but
I was talking about _western_ hemisphere.  The comment refers to
the part of the code the attached patch fixes, which I will
apply along with your updated patch.

> The tests work with my locale (swedish ISO-8859-15),  even though they like 
> all other tests run in the C "hemishpere" by default. AFAIK, git isn't very 
> user friendly with non-ascii filenames as it is today and cvsexportcommit 
> didn't work on such files before, and it doesn't now. No change there. 

That is a separate issue.  I think scripts that work with git
plumbing should read from -z output when they need to and are
capable of, as we have done for git-cvsserver recently, and
things written in Perl certainly are capable of doing so.

diff --git a/git-cvsexportcommit.perl b/git-cvsexportcommit.perl
index facb466..b1cc014 100755
--- a/git-cvsexportcommit.perl
+++ b/git-cvsexportcommit.perl
@@ -68,9 +68,9 @@ foreach my $line (@commit) {
     if ($stage eq 'headers') {
 	if ($line =~ m/^parent (\w{40})$/) { # found a parent
 	    push @parents, $1;
-	} elsif ($line =~ m/^author (.+) \d+ \+\d+$/) {
+	} elsif ($line =~ m/^author (.+) \d+ [-+]\d+$/) {
 	    $author = $1;
-	} elsif ($line =~ m/^committer (.+) \d+ \+\d+$/) {
+	} elsif ($line =~ m/^committer (.+) \d+ [-+]\d+$/) {
 	    $committer = $1;
 	}
     } else {

  reply	other threads:[~2006-11-14  0:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-12 15:29 [PATCH] Rework cvsexportcommit to handle binary files for all cases Robin Rosenberg
2006-11-13  4:39 ` Junio C Hamano
2006-11-13 20:39   ` Robin Rosenberg
2006-11-14  0:47     ` Junio C Hamano [this message]
2006-11-14  6:49       ` Robin Rosenberg
2006-11-14  6:56         ` Junio C Hamano
2006-11-13 20:40   ` Robin Rosenberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7vveli4zxc.fsf@assigned-by-dhcp.cox.net \
    --to=junkio@cox.net \
    --cc=git@vger.kernel.org \
    --cc=robin.rosenberg@dewire.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).