git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <junkio@cox.net>
To: Alexey Nezhdanov <snake@penza-gsm.ru>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] Added an option to cvsimport to specify email domain
Date: Fri, 30 Sep 2005 01:48:57 -0700	[thread overview]
Message-ID: <7v64sj6iva.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <200509301219.42087.snake@penza-gsm.ru> (Alexey Nezhdanov's message of "Fri, 30 Sep 2005 12:19:41 +0400")

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+$//;

  reply	other threads:[~2005-09-30  8:49 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-07  8:00 [PATCH] Added an option to cvsimport to specify email domain David Kågedal
2005-09-07 19:18 ` Junio C Hamano
2005-09-14 19:34   ` Petr Baudis
2005-09-27  4:34     ` Alexey Nezhdanov
2005-09-27 12:54       ` David Mansfield
2005-09-30  8:19         ` Alexey Nezhdanov
2005-09-30  8:48           ` Junio C Hamano [this message]
2005-09-30 10:22             ` Alexey Nezhdanov
2005-09-30 13:54           ` David Mansfield
2005-09-29 10:26       ` Alexey Nezhdanov

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=7v64sj6iva.fsf@assigned-by-dhcp.cox.net \
    --to=junkio@cox.net \
    --cc=git@vger.kernel.org \
    --cc=snake@penza-gsm.ru \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).