From: "David Kågedal" <davidk@lysator.liu.se>
To: git@vger.kernel.org
Subject: [PATCH] Added an option to cvsimport to specify email domain
Date: Wed, 07 Sep 2005 10:00:02 +0200 [thread overview]
Message-ID: <u5tzmqp8fzx.fsf@lysator.liu.se> (raw)
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 reply other threads:[~2005-09-07 8:02 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-09-07 8:00 David Kågedal [this message]
2005-09-07 19:18 ` [PATCH] Added an option to cvsimport to specify email domain 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
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=u5tzmqp8fzx.fsf@lysator.liu.se \
--to=davidk@lysator.liu.se \
--cc=git@vger.kernel.org \
/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).