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

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

From
David Kågedal <davidk@lysator.liu.se>
Date
Sep 7, 2005, 08:00 UTC
Message-ID
<u5tzmqp8fzx.fsf@lysator.liu.se>

The authorship info in commits created by git-cvsimport-script only contains the username of the CVS committer. This patch adds a flag -e <domain> to git-cvsimport-script that makes it possible to specify an email domain that is added to all email addresses in the commit "author" and "committer" fields.

--- I have stopped using cvsimport, because cvsps seems to produce bad output on the repository I'm using it with, but I had already prepared this patch.

 Documentation/git-cvsimport-script.txt |    8 +++++++-
 git-cvsimport-script                   |   18 +++++++++++++-----
 2 files changed, 20 insertions(+), 6 deletions(-)
cabbc2b5cae2dcd892d02a3c679698cdfb3b9de5
diff --git a/Documentation/git-cvsimport-script.txt b/Documentation/git-cvsimport-script.txt
--- a/Documentation/git-cvsimport-script.txt
+++ b/Documentation/git-cvsimport-script.txt
@@ -12,7 +12,9 @@ SYNOPSIS
 'git-cvsimport-script' [ -o <branch-for-HEAD> ] [ -h ] [ -v ]
 			[ -d <CVSROOT> ] [ -p <options-for-cvsps> ]
 			[ -C <GIT_repository> ] [ -i ] [ -k ]
-			[ -s <subst> ] [ -m ] [ -M regex ] [ <CVS_module> ]
+			[ -s <subst> ] [ -m ] [ -M regex ]
+			[ -e <domain> ]
+			[ <CVS_module> ]
 
 
 DESCRIPTION
@@ -86,6 +88,10 @@ OPTIONS
 -s <subst>::
 	Substitute the character "/" in branch names with <subst>
 
+-e <domain>::
+        Append '@<domain>' to the author name to use as the email
+        address in commit objects.
+
 OUTPUT
 ------
 If '-v' is specified, the script reports what it is doing.
diff --git a/git-cvsimport-script b/git-cvsimport-script
--- a/git-cvsimport-script
+++ b/git-cvsimport-script
@@ -29,19 +29,20 @@ use IPC::Open2;
 $SIG{'PIPE'}="IGNORE";
 $ENV{'TZ'}="UTC";
 
-our($opt_h,$opt_o,$opt_v,$opt_k,$opt_u,$opt_d,$opt_p,$opt_C,$opt_z,$opt_i,$opt_s,$opt_m,$opt_M);
+our($opt_h,$opt_o,$opt_v,$opt_k,$opt_u,$opt_d,$opt_p,$opt_C,$opt_z,$opt_i,$opt_s,$opt_m,$opt_M,$opt_e);
 
 sub usage() {
 	print STDERR <<END;
 Usage: ${\basename $0}     # fetch/update GIT from CVS
        [-o branch-for-HEAD] [-h] [-v] [-d CVSROOT]
        [-p opts-for-cvsps] [-C GIT_repository] [-z fuzz]
-       [-i] [-k] [-u] [-s subst] [-m] [-M regex] [CVS_module]
+       [-i] [-k] [-u] [-s subst] [-m] [-M regex] [ -e email-domain ]
+       [CVS_module]
 END
 	exit(1);
 }
 
-getopts("hivmkuo:d:p:C:z:s:M:") or usage();
+getopts("hivmkuo:d:p:C:z:s:M:e:") or usage();
 usage if $opt_h;
 
 @ARGV <= 1 or usage();
@@ -85,6 +86,13 @@ if ($opt_M) {
 	push (@mergerx, qr/$opt_M/);
 }
 
+our $email_suffix;
+if ($opt_e) {
+    $email_suffix = "@"."$opt_e";
+} else {
+    $email_suffix = "";
+}
+
 select(STDERR); $|=1; select(STDOUT);
 
 
@@ -592,10 +600,10 @@ my $commit = sub {
 
 		exec("env",
 			"GIT_AUTHOR_NAME=$author",
-			"GIT_AUTHOR_EMAIL=$author",
+			"GIT_AUTHOR_EMAIL=$author$email_suffix",
 			"GIT_AUTHOR_DATE=".strftime("+0000 %Y-%m-%d %H:%M:%S",gmtime($date)),
 			"GIT_COMMITTER_NAME=$author",
-			"GIT_COMMITTER_EMAIL=$author",
+			"GIT_COMMITTER_EMAIL=$author$email_suffix",
 			"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";
-- 
David Kågedal
Next: Junio C Hamano
Message 1 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.