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

Re: [PATCH] Added an option to cvsimport to specify email domain

From
Junio C Hamano <junkio@cox.net>
Date
Sep 30, 2005, 08:48 UTC
Message-ID
<7v64sj6iva.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<200509301219.42087.snake@penza-gsm.ru>
Alexey Nezhdanov <snake@penza-gsm.ru> writes:
> Unfortunately I do not know perl so I can not write a patch for git-cvsimport-script.
> So I asking you, Matthias, to help with this or may somebody on this list can do it instead.
Untested, but something like this?

------------ [PATCH] Pass CVSps generated A U Thor <author@domain.xz> intact.

Alexey Nezhdanov updated CVSps to generate author-name and author-email information in its output.

If the input looks like it has that already properly formatted, use that without our own munging.

Signed-off-by: Junio C Hamano <junkio@cox.net>
---
diff --git a/git-cvsimport.perl b/git-cvsimport.perl
--- a/git-cvsimport.perl
+++ b/git-cvsimport.perl
@@ -510,7 +510,7 @@ unless($pid) {
 
 my $state = 0;
 
-my($patchset,$date,$author,$branch,$ancestor,$tag,$logmsg);
+my($patchset,$date,$author_name,$author_email,$branch,$ancestor,$tag,$logmsg);
 my(@old,@new);
 my $commit = sub {
 	my $pid;
@@ -591,11 +591,11 @@ my $commit = sub {
 		}
 
 		exec("env",
-			"GIT_AUTHOR_NAME=$author",
-			"GIT_AUTHOR_EMAIL=$author",
+			"GIT_AUTHOR_NAME=$author_name",
+			"GIT_AUTHOR_EMAIL=$author_email",
 			"GIT_AUTHOR_DATE=".strftime("+0000 %Y-%m-%d %H:%M:%S",gmtime($date)),
-			"GIT_COMMITTER_NAME=$author",
-			"GIT_COMMITTER_EMAIL=$author",
+			"GIT_COMMITTER_NAME=$author_name",
+			"GIT_COMMITTER_EMAIL=$author_email",
 			"GIT_COMMITTER_DATE=".strftime("+0000 %Y-%m-%d %H:%M:%S",gmtime($date)),
 			"git-commit-tree", $tree,@par);
 		die "Cannot exec git-commit-tree: $!\n";
@@ -638,7 +638,7 @@ my $commit = sub {
 		print $out "object $cid\n".
 		    "type commit\n".
 		    "tag $xtag\n".
-		    "tagger $author <$author>\n"
+		    "tagger $author_name <$author_email>\n"
 		    or die "Cannot create tag object $xtag: $!\n";
 		close($out)
 		    or die "Cannot create tag object $xtag: $!\n";
@@ -683,7 +683,11 @@ while(<CVS>) {
 		$state=3;
 	} elsif($state == 3 and s/^Author:\s+//) {
 		s/\s+$//;
-		$author = $_;
+		if (/^(.*?)\s+<(.*)>/) {
+		    ($author_name, $author_email) = ($1, $2);
+		} else {
+		    $author_name = $author_email = $_;
+		}
 		$state = 4;
 	} elsif($state == 4 and s/^Branch:\s+//) {
 		s/\s+$//;
Previous: Alexey NezhdanovNext: Alexey Nezhdanov
Message 7 of 10 in “Added an option to cvsimport to specify email domain”
  1. Added an option to cvsimport to specify email domainDavid Kågedal, Sep 7, 2005
  2. Junio C HamanoSep 7, 2005
  3. Petr BaudisSep 14, 2005
  4. Alexey NezhdanovSep 27, 2005
  5. David MansfieldSep 27, 2005
  6. Alexey NezhdanovSep 30, 2005
  7. Junio C HamanoSep 30, 2005
  8. Alexey NezhdanovSep 30, 2005
  9. David MansfieldSep 30, 2005
  10. Alexey NezhdanovSep 29, 2005

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.