git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Rework cvsexportcommit to handle binary files for all cases.

From
Junio C Hamano <junkio@cox.net>
Date
Nov 14, 2006, 00:47 UTC
Message-ID
<7vveli4zxc.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<200611132139.25342.robin.rosenberg@dewire.com>
Robin Rosenberg <robin.rosenberg@dewire.com> writes:
Show 7 quoted lines
>> 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.

Show 6 quoted lines
>> 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 {
Previous: Robin RosenbergNext: Robin Rosenberg
Message 4 of 7 in “Rework cvsexportcommit to handle binary files for all cases.”
  1. Rework cvsexportcommit to handle binary files for all cases.Robin Rosenberg, Nov 12, 2006
  2. Junio C HamanoNov 13, 2006
  3. Robin RosenbergNov 13, 2006
  4. Junio C HamanoNov 14, 2006
  5. Robin RosenbergNov 14, 2006
  6. Junio C HamanoNov 14, 2006
  7. Robin RosenbergNov 13, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.